|
|
@@ -91,13 +91,14 @@ class WechatUser extends BaseModel
|
|
|
$routineInfo['session_key'] = $routine['session_key'];//会话密匙
|
|
|
$routineInfo['unionid'] = $routine['unionId'];//用户在开放平台的唯一标识符
|
|
|
$routineInfo['user_type'] = 'routine';//用户类型
|
|
|
+ $routineInfo['channel'] = $routine['channel'];
|
|
|
$spid = 0;//绑定关系uid
|
|
|
- $isCOde = false;
|
|
|
+ $isByQRScan = false;
|
|
|
//获取是否有扫码进小程序
|
|
|
if ($routine['code']) {
|
|
|
if ($info = RoutineQrcode::getRoutineQrcodeFindType($routine['code'])) {
|
|
|
$spid = $info['third_id'];
|
|
|
- $isCOde = true;
|
|
|
+ $isByQRScan = true;
|
|
|
} else {
|
|
|
$spid = $routine['spid'];
|
|
|
}
|
|
|
@@ -109,13 +110,15 @@ class WechatUser extends BaseModel
|
|
|
if ($routineInfo['unionid'] != '' && ($uid = self::where(['unionid' => $routineInfo['unionid']])->where('user_type', '<>', 'h5')->value('uid'))) {
|
|
|
self::edit($routineInfo, $uid, 'uid');
|
|
|
$routineInfo['code'] = $spid;
|
|
|
- $routineInfo['isPromoter'] = $isCOde;
|
|
|
- if ($routine['login_type']) $routineInfo['login_type'] = $routine['login_type'];
|
|
|
+ $routineInfo['isPromoter'] = $isByQRScan;
|
|
|
+ if ($routine['login_type']) {
|
|
|
+ $routineInfo['login_type'] = $routine['login_type'];
|
|
|
+ }
|
|
|
User::updateWechatUser($routineInfo, $uid);
|
|
|
} else if ($uid = self::where(['routine_openid' => $routineInfo['routine_openid']])->where('user_type', '<>', 'h5')->value('uid')) { //根据小程序openid判断
|
|
|
self::edit($routineInfo, $uid, 'uid');
|
|
|
$routineInfo['code'] = $spid;
|
|
|
- $routineInfo['isPromoter'] = $isCOde;
|
|
|
+ $routineInfo['isPromoter'] = $isByQRScan;
|
|
|
if ($routine['login_type']) {
|
|
|
$routineInfo['login_type'] = $routine['login_type'];
|
|
|
}
|