|
@@ -183,32 +183,35 @@ class User extends Api
|
|
|
'real_status' => 1,
|
|
|
];
|
|
|
$rs = Db::name('user')->where('id',$this->auth->id)->update($data);
|
|
|
-
|
|
|
+ if($rs === false){
|
|
|
+ Db::rollback();
|
|
|
+ $this->error('认证失败');
|
|
|
+ }
|
|
|
//tag任务赠送金币
|
|
|
- if($rs){
|
|
|
- //完成本人基本资料 +15金币《所有资料完善,包括真人认证和实名认证》
|
|
|
- $task_rs = \app\common\model\TaskLog::tofinish($this->auth->id,5);
|
|
|
- if($task_rs === false){
|
|
|
- Db::rollback();
|
|
|
- $this->error('完成任务赠送奖励失败');
|
|
|
- }
|
|
|
- //完成真人头像 +5金币
|
|
|
- $task_rs = \app\common\model\TaskLog::tofinish($this->auth->id,7);
|
|
|
- if($task_rs === false){
|
|
|
+ //完成本人基本资料 +15金币《所有资料完善,包括真人认证和实名认证》
|
|
|
+ $task_rs = \app\common\model\TaskLog::tofinish($this->auth->id,5);
|
|
|
+ if($task_rs === false){
|
|
|
+ Db::rollback();
|
|
|
+ $this->error('完成任务赠送奖励失败');
|
|
|
+ }
|
|
|
+ //完成真人头像 +5金币
|
|
|
+ $task_rs = \app\common\model\TaskLog::tofinish($this->auth->id,7);
|
|
|
+ if($task_rs === false){
|
|
|
+ Db::rollback();
|
|
|
+ $this->error('完成任务赠送奖励失败');
|
|
|
+ }
|
|
|
+ //邀请人拿奖励,男性3元
|
|
|
+ $intro_money = $this->auth->gender == 1 ? config('site.intro_man_money') : config('site.intro_woman_money');
|
|
|
+ if($this->auth->idcard_status == 1 && !empty($this->auth->intro_uid) && $intro_money > 0){
|
|
|
+ $task_rs = model('wallet')->lockChangeAccountRemain($this->auth->intro_uid,'money',$intro_money,63,$remark='');
|
|
|
+ if($task_rs['status'] === false){
|
|
|
Db::rollback();
|
|
|
- $this->error('完成任务赠送奖励失败');
|
|
|
- }
|
|
|
- //邀请人拿奖励,男性3元
|
|
|
- $intro_money = $this->auth->gender == 1 ? config('site.intro_man_money') : config('site.intro_woman_money');
|
|
|
- if($this->auth->idcard_status == 1 && !empty($this->auth->intro_uid) && $intro_money > 0){
|
|
|
- $task_rs = model('wallet')->lockChangeAccountRemain($this->auth->intro_uid,'money',$intro_money,63,$remark='');
|
|
|
- if($task_rs['status'] === false){
|
|
|
- Db::rollback();
|
|
|
- $this->error($task_rs['msg']);
|
|
|
- }
|
|
|
+ $this->error($task_rs['msg']);
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
+ //系统消息
|
|
|
+ $msg_id = \app\common\model\Message::addMessage($this->auth->id,'真人认证','真人认证已经审核通过');
|
|
|
+
|
|
|
Db::commit();
|
|
|
$this->success();
|
|
|
}
|