From 14219a4762c345795eb29dbc8f7b95a3e8d7f9fb Mon Sep 17 00:00:00 2001 From: tping Date: Fri, 13 Mar 2020 14:19:14 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=85=A5=E4=B8=8D=E6=9B=B4=E6=96=B0de?= =?UTF-8?q?vice=5Fnumber=20=20=20=E4=B8=94=E5=AD=97=E6=AE=B5=E4=B8=8D?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Model/UserModel.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Application/Admin/Model/UserModel.class.php b/Application/Admin/Model/UserModel.class.php index a3a7bbf6..ba7bc8f1 100644 --- a/Application/Admin/Model/UserModel.class.php +++ b/Application/Admin/Model/UserModel.class.php @@ -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);