|
@@ -72,7 +72,7 @@ class User extends Api |
|
@@ -72,7 +72,7 @@ class User extends Api |
72
|
if(empty($data['card'])){
|
72
|
if(empty($data['card'])){
|
73
|
$data['card'] = '';
|
73
|
$data['card'] = '';
|
74
|
}
|
74
|
}
|
75
|
- if(empty($data['phone'])){
|
75
|
+ if(empty($data['mobile'])){
|
76
|
$data['phone'] = '';
|
76
|
$data['phone'] = '';
|
77
|
}
|
77
|
}
|
78
|
if(empty($data['work_address'])){
|
78
|
if(empty($data['work_address'])){
|
|
@@ -115,6 +115,10 @@ class User extends Api |
|
@@ -115,6 +115,10 @@ class User extends Api |
115
|
$code = $this->request->param('code');
|
115
|
$code = $this->request->param('code');
|
116
|
$image = $this->request->param('image');
|
116
|
$image = $this->request->param('image');
|
117
|
if(!empty($phone)){
|
117
|
if(!empty($phone)){
|
|
|
118
|
+ $have_mobile = Db::name('user')->where('mobile', $phone)->where('id', '<>', $user_id)->find();
|
|
|
119
|
+ if($have_mobile){
|
|
|
120
|
+ $this->error('手机号已存在');
|
|
|
121
|
+ }
|
118
|
if(empty($code)){
|
122
|
if(empty($code)){
|
119
|
$this->error('验证码不能为空');
|
123
|
$this->error('验证码不能为空');
|
120
|
}
|
124
|
}
|
|
@@ -129,6 +133,7 @@ class User extends Api |
|
@@ -129,6 +133,7 @@ class User extends Api |
129
|
$params['sex'] = $sex;
|
133
|
$params['sex'] = $sex;
|
130
|
}
|
134
|
}
|
131
|
if($phone){
|
135
|
if($phone){
|
|
|
136
|
+ $params['mobile'] = $phone;
|
132
|
$params['phone'] = $phone;
|
137
|
$params['phone'] = $phone;
|
133
|
}
|
138
|
}
|
134
|
if(empty($data['image']) && $image){
|
139
|
if(empty($data['image']) && $image){
|
|
@@ -253,7 +258,7 @@ class User extends Api |
|
@@ -253,7 +258,7 @@ class User extends Api |
253
|
}
|
258
|
}
|
254
|
|
259
|
|
255
|
$user_info = Db::name('user')->where('id',$user_id)->find();
|
260
|
$user_info = Db::name('user')->where('id',$user_id)->find();
|
256
|
- if(empty($user_info['image']) || empty($user_info['phone'])){
|
261
|
+ if(empty($user_info['image']) || empty($user_info['mobile'])){
|
257
|
$this->error('请先完善个人信息');
|
262
|
$this->error('请先完善个人信息');
|
258
|
}
|
263
|
}
|
259
|
|
264
|
|