Commit c50506b7 authored by hujun's avatar hujun

Merge remote-tracking branch 'origin/wx0604' into wx0604

parents 40890ffb 05ebb74e
...@@ -71,7 +71,7 @@ class AppointmentTime extends Basic ...@@ -71,7 +71,7 @@ class AppointmentTime extends Basic
return $this->response("101", "楼盘信息不能为空"); return $this->response("101", "楼盘信息不能为空");
} }
//todo 参数校验 //todo 参数校验
if (!isset($params["phone"]) || !preg_match('/^1[345678]\d{9}$/', $params["phone"])) { if (!isset($params["phone"]) || !preg_match('/^1[3456789]\d{9}$/', $params["phone"])) {
return $this->response("101", "手机号为空或手机号无效"); return $this->response("101", "手机号为空或手机号无效");
} }
......
...@@ -483,16 +483,33 @@ class Member extends Basic ...@@ -483,16 +483,33 @@ class Member extends Basic
*/ */
public function getUserInfo() { public function getUserInfo() {
$data['status'] = 200; $params = $this->params;
$data['data'] = ''; /* $params = array(
if ($this->params['AuthToken']) { "user_id" => 1
$fields = 'id,user_pswd,user_nick,user_phone,user_pic,referrer_id,referrer_source,integral,create_time,update_time,last_login_time,last_login_ip'; );*/
$data['data'] = $this->user->selectUser($this->userId, $fields); $fields = "a.id,a.buyer_id,b.buyer_nick,a.user_nick,a.user_phone,a.user_pic,a.other_pic";
$data['data']['AuthToken'] = $this->params['AuthToken']; $result = $this->user->getUserInfoById($params, $fields);
$data = [];
if(count($result) > 0){
$jwt_data['id'] = $result[0]["id"];
$jwt_data['userNick'] = $result[0]["user_nick"];
$jwt_data['phone'] = $result[0]["user_phone"];
$jwt = new JwtUntils();
$AuthToken = $jwt->createToken($jwt_data);
$data["id"] = $result[0]["id"];
$data["buyer_id"] = $result[0]["buyer_id"];
$data["buyer_nick"] = $result[0]["buyer_nick"];
$data["user_nick"] = $result[0]["user_nick"];
$data["user_phone"] = $result[0]["user_phone"];
$data["user_pic"] = !empty($result[0]["user_pic"]) ? HEADERIMGURL . $result[0]["user_pic"] : $result[0]["other_pic"];
$data["AuthToken"] = $AuthToken;
}else{
return $this->response("101", "数据查询失败");
} }
return $this->response("200","请求成功",$data);
$data['msg'] = '';
return $this->response($data['status'], $data['msg'], $data['data']);
} }
/** /**
......
...@@ -106,7 +106,7 @@ class Sublet extends Basic ...@@ -106,7 +106,7 @@ class Sublet extends Basic
return $this->response("101", "称呼不能为空"); return $this->response("101", "称呼不能为空");
} }
if (!isset($params["tel"]) || !preg_match('/1[345678]\d{9}/', $params["tel"])) { if (!isset($params["tel"]) || !preg_match('/1[3456789]\d{9}/', $params["tel"])) {
return $this->response("101", "手机号检验错误"); return $this->response("101", "手机号检验错误");
} }
$params["create_time"] = date("Y-m-d H:i:s", time()); $params["create_time"] = date("Y-m-d H:i:s", time());
......
...@@ -555,10 +555,10 @@ class OReportModel extends Model ...@@ -555,10 +555,10 @@ class OReportModel extends Model
( (
SELECT SELECT
a.id, a.id,
a.user_id,
a.agents_id, a.agents_id,
a.expect_time, a.expect_time,
a.house_id, a.house_id,
a.user_id,
b.external_title AS house_title, b.external_title AS house_title,
b.residue_num AS room_num_left, b.residue_num AS room_num_left,
b.is_show, b.is_show,
...@@ -568,9 +568,10 @@ class OReportModel extends Model ...@@ -568,9 +568,10 @@ class OReportModel extends Model
LEFT JOIN g_houses b ON a.house_id = b.id LEFT JOIN g_houses b ON a.house_id = b.id
WHERE WHERE
a.user_id = $user_id a.user_id = $user_id
and a.agents_id IS NULL
and a.status in (0,1) and a.status in (0,1)
) ) as aaa limit $start_index,$pageSize"; ) ) as aaa limit $start_index,$pageSize";
//echo $sql;
$data = $this->db->query($sql); $data = $this->db->query($sql);
return $data; return $data;
......
...@@ -664,4 +664,21 @@ class Users extends Model ...@@ -664,4 +664,21 @@ class Users extends Model
return $this->where($where_)->setField("buyer_id", 0); return $this->where($where_)->setField("buyer_id", 0);
} }
public function getUserInfoById($param, $fields)
{
$where_ = [];
if (isset($param["user_id"])) {
$where_["a.id"] = $param["user_id"];
}
$data = $this
->field($fields)
->alias("a")
->join("u_wx_info b","a.buyer_id=b.id","left")
->where($where_)
->select();
return $data;
}
} }
...@@ -106,7 +106,7 @@ class Response ...@@ -106,7 +106,7 @@ class Response
$this->header['Cache-Control'] = 'max-age=' . $cache[1] . ',must-revalidate'; $this->header['Cache-Control'] = 'max-age=' . $cache[1] . ',must-revalidate';
$this->header['Last-Modified'] = gmdate('D, d M Y H:i:s') . ' GMT'; $this->header['Last-Modified'] = gmdate('D, d M Y H:i:s') . ' GMT';
$this->header['Expires'] = gmdate('D, d M Y H:i:s', $_SERVER['REQUEST_TIME'] + $cache[1]) . ' GMT'; $this->header['Expires'] = gmdate('D, d M Y H:i:s', $_SERVER['REQUEST_TIME'] + $cache[1]) . ' GMT';
Cache::tag($cache[2])->set($cache[0], [$data, $this->header], $cache[1]); Cache::tag($cache[2])->set($cache[0], [ $data, $this->header ], $cache[1]);
} }
} }
...@@ -206,7 +206,7 @@ class Response ...@@ -206,7 +206,7 @@ class Response
throw new \InvalidArgumentException(sprintf('variable type error: %s', gettype($content))); throw new \InvalidArgumentException(sprintf('variable type error: %s', gettype($content)));
} }
$this->content = (string) $content; $this->content = (string)$content;
return $this; return $this;
} }
...@@ -309,7 +309,7 @@ class Response ...@@ -309,7 +309,7 @@ class Response
{ {
if (null == $this->content) { if (null == $this->content) {
$content = $this->output($this->data); $content = $this->output($this->data);
Log::record("response msg:" . $content);
if (null !== $content && !is_string($content) && !is_numeric($content) && !is_callable([ if (null !== $content && !is_string($content) && !is_numeric($content) && !is_callable([
$content, $content,
'__toString', '__toString',
...@@ -318,7 +318,7 @@ class Response ...@@ -318,7 +318,7 @@ class Response
throw new \InvalidArgumentException(sprintf('variable type error: %s', gettype($content))); throw new \InvalidArgumentException(sprintf('variable type error: %s', gettype($content)));
} }
$this->content = (string) $content; $this->content = (string)$content;
} }
return $this->content; return $this->content;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment