|
@@ -2,6 +2,7 @@
|
|
|
|
|
|
namespace app\api\controller;
|
|
|
|
|
|
+use app\common\model\UserApply;
|
|
|
use liuniu\IdentityCard;
|
|
|
use app\admin\model\user\{UserExt};
|
|
|
use app\admin\model\{User as UserModel};
|
|
@@ -400,14 +401,25 @@ class User extends Api
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if(sizeof($user)>0)
|
|
|
+ if(sizeof($user)>0 )
|
|
|
{
|
|
|
UserModel::where('id',$this->auth->getUserinfo()['id'])->update($user);
|
|
|
}
|
|
|
if(sizeof($user_ext)>0)
|
|
|
{
|
|
|
- UserExt::where('id',$this->auth->getUserinfo()['id'])->update($user_ext);
|
|
|
+ if(UserExt::where('user_id',$this->auth->getUserinfo()['id'])->find()) {
|
|
|
+ UserExt::where('user_id', $this->auth->getUserinfo()['id'])->update($user_ext);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ $user_ext['cid'] = $this->cid;
|
|
|
+ $user_ext['user_id'] = $this->auth->getUserinfo()['id'];
|
|
|
+ UserExt::create($user_ext);
|
|
|
+ }
|
|
|
}
|
|
|
+ $where['cid'] = $this->cid;
|
|
|
+ $where['user_id'] = $this->auth->getUserinfo()['id'];
|
|
|
+ UserApply::create($where);
|
|
|
$this->success('修改成功');
|
|
|
}
|
|
|
}
|