Pārlūkot izejas kodu

Merge branch 'wzq_hupo' into kuaiyingyong

wangzq 2 gadi atpakaļ
vecāks
revīzija
d1fe80f44e

+ 34 - 0
app/Http/Controllers/QuickApp/User/UserController.php

@@ -387,6 +387,17 @@ class UserController extends BaseController
         $service        = new UserTaskService($this->uid);
         $new_user_tasks = $service->findNewUserTaskList();
         $date_tasks     = $service->findDateUserTaskList();
+
+        // 琥珀阅读去除加桌任务
+        if ($this->distribution_channel_id == 14903 && $new_user_tasks){
+            foreach ($new_user_tasks as $key =>  $val){
+                if ($val['code'] == "add_desk"){
+                    unset($new_user_tasks[$key]);
+                }
+            }
+            unset($val);
+        }
+        $new_user_tasks = array_values($new_user_tasks->toArray());
         return response()->success(compact('new_user_tasks', 'date_tasks'));
     }
 
@@ -411,6 +422,8 @@ class UserController extends BaseController
     public function findSignInfo()
     {
         $service = new SignService($this->uid);
+        $reward_list = $this->get_sign_reward_list($this->distribution_channel_id);
+        $service->setRewardList($reward_list);
         return response()->success($service->getSignInfo());
     }
 
@@ -420,7 +433,28 @@ class UserController extends BaseController
     public function newSign()
     {
         $service = new SignService($this->uid);
+        $reward_list = $this->get_sign_reward_list($this->distribution_channel_id);
+        $service->setRewardList($reward_list);
         $service->sign();
         return response()->success();
     }
+
+    /**
+     *  奖励
+     * name: get_sign_reward_list
+     * @param $distribution_channel_id
+     * @return int[]
+     * date 2022/10/11 11:56
+     */
+    private function get_sign_reward_list($distribution_channel_id)
+    {
+        $list =   [30, 35, 40, 45, 50, 55, 60];
+
+        // 琥珀阅读签到奖励独立
+        if ($distribution_channel_id == 14903){
+            $list = [30,88,188,30,88,188,188];
+        }
+
+        return $list;
+    }
 }

+ 1 - 1
app/Modules/User/Services/SignService.php

@@ -21,7 +21,7 @@ class SignService
         $this->uid = $uid;
     }
 
-    protected function setRewardList(array $data)
+    public function setRewardList(array $data)
     {
         $this->reward_list = $data;
     }