登入不更新device_number 且字段不为空

master
tping 5 years ago
parent cba6dde69f
commit 14219a4762

@ -402,7 +402,7 @@ class UserModel extends Model{
'sdk_version'=>$sdk_version,
'check_time' => time(),
'device_type'=>$device_type,
'device_number' =>$unique_code
'device_number' =>$unique_code ? $unique_code : ''
);
if($register_type==2){
$map['phone']=$phone;
@ -425,7 +425,7 @@ class UserModel extends Model{
$uid = $this->add();
/* // 找该设备绑定的上级推广员 优先找这个表的
if ($unique_code) {
if ($unique_code && $promote_id >0) {
M('device_promote', 'tab_')->add(array(
'user_id' => $uid,
'promote_id' => $promote_id,
@ -1024,7 +1024,7 @@ class UserModel extends Model{
'openid' =>$userinfo['openid'],
'check_time' => time(),
'device_type' => $userinfo['device_type'],
'device_number' => $userinfo['unique_code']
'device_number' => $userinfo['unique_code'] ? $userinfo['unique_code'] : ''
);
/* 添加用户 */
if($this->create($data)){
@ -1118,9 +1118,9 @@ class UserModel extends Model{
$data["id"] = $uid;
$data["login_time"] = NOW_TIME;
$data["login_ip"] = get_client_ip();
$data["device_number"] = $unique_code;
// $data["device_number"] = $unique_code;
$data["last_login_ip"] = $user['login_ip'];
$data["last_device_number"] = $user['device_number'];
$data["last_device_number"] = $user['device_number'] ? $user['device_number'] : '';
$data["token"] = $this->generateToken($uid,$account,$password);
M('user_token','tab_')->startTrans();
@ -1222,7 +1222,7 @@ class UserModel extends Model{
$model = M('User','tab_');
$uid = $user['id'];
$data["id"] = $uid;
$data["device_number"] = $unique_code;
$data["device_number"] = $unique_code ? $unique_code : '';
$data["last_device_number"] = $user['device_number'];
$data["lock_status"] = 0 ;
$model->save($data);

Loading…
Cancel
Save