Commit b0d054eb authored by clone's avatar clone

bug

parent 6dced9df
...@@ -483,16 +483,25 @@ class Member extends Basic ...@@ -483,16 +483,25 @@ 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){
$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"];
}else{
return $this->response("101", "数据查询失败");
} }
return $this->response("200","请求成功",$data);
$data['msg'] = '';
return $this->response($data['status'], $data['msg'], $data['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;
}
} }
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