lushuncheng 4 年之前
父節點
當前提交
721c0f5801
共有 1 個文件被更改,包括 9 次插入9 次删除
  1. 9 9
      app/index/controller/Index.php

+ 9 - 9
app/index/controller/Index.php

@@ -205,7 +205,7 @@ class Index extends Controller
             $finishState = 1;
         }
         // 更新任务状态
-        $nums = Db::table('user_task')->where('uid', Safe::$user['uid'])->where('date', $date)->update([
+        $nums = Db::table('awards_user_task')->where('uid', Safe::$user['uid'])->where('date', $date)->update([
             'follow_state' => 1,
             'finish_state' => $finishState,
         ]);
@@ -258,7 +258,7 @@ class Index extends Controller
             $finishState = 1;
         }
         // 更新任务状态
-        $nums = Db::table('user_task')->where('uid', Safe::$user['uid'])->where('date', $date)->update([
+        $nums = Db::table('awards_user_task')->where('uid', Safe::$user['uid'])->where('date', $date)->update([
             'forward_state' => 1,
             'finish_state' => $finishState,
         ]);
@@ -313,7 +313,7 @@ class Index extends Controller
         // 标记加票成功
         $date = date('Y-m-d');
         $redisKey = $this->getTaskStateRedisKey(intval(Safe::$user['uid']));
-        $nums = Db::table('user_task')->where('uid', Safe::$user['uid'])->where('date', $date)->update([
+        $nums = Db::table('awards_user_task')->where('uid', Safe::$user['uid'])->where('date', $date)->update([
             'finish_add_votes' => 1,
         ]);
         if ($nums) {
@@ -358,7 +358,7 @@ class Index extends Controller
         // 标记状态
         $date = date('Y-m-d');
         $redisKey = $this->getTaskStateRedisKey(intval(Safe::$user['uid']));
-        $nums = Db::table('user_task')->where('uid', Safe::$user['uid'])->where('date', $date)->update([
+        $nums = Db::table('awards_user_task')->where('uid', Safe::$user['uid'])->where('date', $date)->update([
             'share_add_votes' => 1,
         ]);
         if ($nums) {
@@ -402,7 +402,7 @@ class Index extends Controller
         if ($conf['state']['forward_state'] == 1 && $conf['state']['follow_state'] == 1) {
             $finishState = 1;
         }
-        $nums = Db::table('user_task')->where('uid', Safe::$user['uid'])->where('date', $date)->update([
+        $nums = Db::table('awards_user_task')->where('uid', Safe::$user['uid'])->where('date', $date)->update([
             'view_state' => 1,
             'finish_state' => $finishState,
         ]);
@@ -448,7 +448,7 @@ class Index extends Controller
         $state = Cache::get($redisKey);
         if (empty($state)) {
             // 缓存失败 查数据库
-            $state = Db::table('user_task')->where('uid', Safe::$user['uid'])->where('date', $date)->find();
+            $state = Db::table('awards_user_task')->where('uid', Safe::$user['uid'])->where('date', $date)->find();
             if (empty($state)) {
                 // 当天第一次,初始化数据
                 $state = [
@@ -467,7 +467,7 @@ class Index extends Controller
                     'uid' => Safe::$user['uid'],
                     'date' => $date,
                 ];
-                if (0 == Db::table('user_task')->insert($state)) {
+                if (0 == Db::table('awards_user_task')->insert($state)) {
                     return $this->response(5001, '系统错误,请稍后再试~');
                 }
             }
@@ -479,7 +479,7 @@ class Index extends Controller
         if ($state['follow_state'] == 0) {
             $weiboRes = (new WeiboService(Safe::$user['uid']))->friends($config['follow']['id']);
             if (isset($weiboRes['data'][$config['follow']['id']]) && $weiboRes['data'][$config['follow']['id']] == 1) {
-                $nums = Db::table('user_task')->where('uid', Safe::$user['uid'])->where('date', $date)->update(['follow_state' => 1,]);
+                $nums = Db::table('awards_user_task')->where('uid', Safe::$user['uid'])->where('date', $date)->update(['follow_state' => 1,]);
                 if ($nums) {
                     $state['follow_state'] = 1;
                     Cache::set($redisKey, json_encode($state), 86400);
@@ -488,7 +488,7 @@ class Index extends Controller
         }
         // 校准状态,可能存在异常情况关注,转发,浏览都完成了,但是总的品牌任务状态没标记成已完成
         if ($state['follow_state'] == 1 && $state['forward_state'] == 1 && $state['view_state'] == 1 && $state['finish_state'] != 1) {
-            $nums = Db::table('user_task')->where('uid', Safe::$user['uid'])->where('date', $date)->update(['finish_state' => 1,]);
+            $nums = Db::table('awards_user_task')->where('uid', Safe::$user['uid'])->where('date', $date)->update(['finish_state' => 1,]);
             if ($nums) {
                 $state['finish_state'] = 1;
                 Cache::set($redisKey, json_encode($state), 86400);