Browse Source

聊天送礼物算在搭讪范围

lizhen_gitee 3 years ago
parent
commit
074b067091
1 changed files with 9 additions and 1 deletions
  1. 9 1
      application/api/controller/Gift.php

+ 9 - 1
application/api/controller/Gift.php

@@ -85,7 +85,7 @@ class Gift extends Api
         $this->success("获取成功!", $list);
     }
 
-    public function giveGiftToYou() {
+    public function givefift_typing() {
         // 接口防并发
         /*if (!$this->apiLimit(1, 1000)) {
             $this->error(__('Operation frequently'));
@@ -170,6 +170,14 @@ class Gift extends Api
             }
         }
 
+        //tag任务赠送金币
+        //搭讪奖励
+        $task_rs = \app\common\model\TaskLog::tofinish($this->auth->id,15);
+        if($task_rs === false){
+            Db::rollback();
+            $this->error('完成任务赠送奖励失败');
+        }
+
         Db::commit();
         $this->success('赠送成功');