Commit 177e4a61 authored by clone's avatar clone

登陆

parent 92e65e81
......@@ -43,13 +43,14 @@ class RegisterService
$fields = "id,user_nick,user_pic,sex,agent_id,referrer_id,referrer_source,user_phone,status";
$user_info = $this->userModel->getUserByWhere($conditions, $fields);
$buyer_id = 0;
$user_nick = "";
$sex = 0;
$id = 0;
$status = 0;
$agent_id = 0;
$other_pic = "";
$buyer_id = 0;
$buyer_nick = "";
$user_nick = "";
$sex = 0;
$id = 0;
$status = 0;
$agent_id = 0;
$other_pic = "";
if (count($user_info) > 0) {
switch ((int)$user_info[0]["status"]) {
......@@ -80,10 +81,11 @@ class RegisterService
$field = "id,wx_union_id,buyer_nick,buyer_img,sex";
$wxInfoArr = $this->wxInfoModel->getWxInfoByOpenId($wx_union_id, $field);
if (count($wxInfoArr) > 0) {
$buyer_id = $wxInfoArr[0]["id"];
$user_nick = !empty($user_nick) ? $user_nick : $wxInfoArr[0]["buyer_nick"];
$sex = !empty($sex) ? $sex : $wxInfoArr[0]["sex"];
$other_pic = $wxInfoArr[0]["buyer_img"];
$buyer_id = $wxInfoArr[0]["id"];
$buyer_nick = $wxInfoArr[0]["buyer_nick"];
$user_nick = !empty($user_nick) ? $user_nick : $wxInfoArr[0]["buyer_nick"];
$sex = !empty($sex) ? $sex : $wxInfoArr[0]["sex"];
$other_pic = $wxInfoArr[0]["buyer_img"];
} else {
return [ "code" => 101, "data" => "没有找到授权信息" ];
}
......@@ -112,6 +114,8 @@ class RegisterService
$AuthToken = $jwt->createToken($jwt_data);
$data["id"] = $id;
$data["buyer_id"] = $buyer_id;
$data["buyer_nick"] = $buyer_nick;
$data["user_nick"] = $user_nick;
$data["user_phone"] = $phone;
$data["user_pic"] = !empty($user_info[0]["user_pic"]) ? HEADERIMGURL . $user_info[0]["user_pic"] : $other_pic;
......@@ -145,9 +149,9 @@ class RegisterService
if ($referrer_id == 0) {
$userParams["first_login_time"] = date("Y-m-d H:i:s", time()); //记录第一次登录时间排除邀请注册
$push = new PushMessageService();
$content = '你邀请的客户'.$user_nick.'-'.$phone.'手机号成功下载登录App';
$push->pushMessageById($referrer_id,'邀请注册', $content);
$push = new PushMessageService();
$content = '你邀请的客户' . $user_nick . '-' . $phone . '手机号成功下载登录App';
$push->pushMessageById($referrer_id, '邀请注册', $content);
}
}
$userParams["buyer_id"] = $buyer_id;
......
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