Browse Source

完成任务

lizhen_gitee 11 months ago
parent
commit
2c9308824f

+ 12 - 0
application/admin/controller/Useraudit.php

@@ -98,6 +98,12 @@ class Useraudit extends Backend
                 'audio_bio' => '语音',
                 'video_bio' => '视频',
             ];
+            $task_arr = [
+                'photo_images' => 2,
+                'avatar' => 1,
+                'audio_bio' => 0,
+                'video_bio' => 3,
+            ];
             $type_text = isset($type_arr[$info['type']]) ? $type_arr[$info['type']] : '资料';
 
             if($status == 1){
@@ -110,6 +116,12 @@ class Useraudit extends Backend
                     }
                 }
 
+                //任务完成
+                $task_num = $task_arr[$info['type']];
+                if($task_num != 0){
+                    $task_rs = \app\common\model\TaskLog::tofinish($info['user_id'],$task_num);
+                }
+
                 //系统消息
                 $msg_id = \app\common\model\Message::addMessage($info['user_id'],$type_text.'审核',$type_text.'审核已经通过');
             }elseif($status == 2){

+ 2 - 2
application/api/controller/Topicdongtai.php

@@ -70,13 +70,13 @@ class Topicdongtai extends Api
 
         //task任务
         //发第一条动态
-        if($data['auditstatus'] == 1){
+        /*if($data['auditstatus'] == 1){
             $task_rs = \app\common\model\TaskLog::tofinish($this->auth->id,10);
             if($task_rs === false){
                 Db::rollback();
                 $this->error('完成任务失败');
             }
-        }
+        }*/
 
         Db::commit();