...
|
...
|
@@ -119,6 +119,21 @@ class Userinfo extends Api |
|
|
if(empty($mobile)){
|
|
|
$this->error('缺少必要参数');
|
|
|
}
|
|
|
$phone = Db::name('user')->where('id',$user_id)->find();
|
|
|
$score = $phone['score'] + 2;
|
|
|
if(empty($phone['mobile'])){
|
|
|
$data = Db::name('user')
|
|
|
->where('id',$user_id)
|
|
|
->update(['mobile'=>$mobile]);
|
|
|
Db::name('user')
|
|
|
->where('id',$user_id)
|
|
|
->update(['score'=>$score]);
|
|
|
if(empty($data)){
|
|
|
$this->error('sql运行失败');
|
|
|
}else{
|
|
|
$this->success('修改成功');
|
|
|
}
|
|
|
}
|
|
|
$data = Db::name('user')
|
|
|
->where('id',$user_id)
|
|
|
->update(['mobile'=>$mobile]);
|
...
|
...
|
|