zz 6 年之前
父节点
当前提交
04970a90df

+ 15 - 1
app/Http/Controllers/Wap/Book/ChapterController.php

@@ -806,6 +806,8 @@ class ChapterController extends BaseController
         $this->chapter->sign_days = 1;
         $this->chapter->sign_status = 0;
         $this->chapter->sign_reard = 0;
+        $this->chapter->sign_version = 'v1';
+        $this->chapter->sign_items = [];//只有v2签到才会用到的字段
         //#短篇推送长篇需求#
         $this->chapter->next_jump = 0;
         $this->chapter->next_jump_url = '';
@@ -819,6 +821,7 @@ class ChapterController extends BaseController
         //广告
         $this->chapter->is_show_ad = 0;//可不可点击
         $this->chapter->is_visiable_ad = 0;//可不可显示
+
     }
 
     private function sign()
@@ -831,6 +834,11 @@ class ChapterController extends BaseController
                 $this->chapter->sign_status = $sign_status ? 1 : 0;
                 $this->chapter->sign_reard = $sign_status;
                 $this->chapter->sign_days = ReadRecordService::getSignCount($this->uid);
+                if($this->chapter->sign_days && $this->chapter->sign_days>=8){
+                    $this->chapter->sign_items = $fee_pool = [50,50,120,50,50,50,150];
+                }else{
+                    $this->chapter->sign_items = $fee_pool = [30,50,120,50,50,50,150];
+                }
             }
         } else {
             $sign_status = $this->userSign($this->uid);
@@ -838,6 +846,11 @@ class ChapterController extends BaseController
             $this->chapter->sign_status = $sign_status ? 1 : 0;
             $this->chapter->sign_reard = $sign_status;
             $this->chapter->sign_days = ReadRecordService::getSignCount($this->uid);
+            if($this->chapter->sign_days && $this->chapter->sign_days>=8){
+                $this->chapter->sign_items = $fee_pool = [50,50,120,50,50,50,150];
+            }else{
+                $this->chapter->sign_items = $fee_pool = [30,50,120,50,50,50,150];
+            }
         }
     }
 
@@ -1016,7 +1029,8 @@ class ChapterController extends BaseController
             //签过到了
             return 0;
         }
-        if ($res = UserSignService::signToday($uid)) {
+        $this->chapter->sign_version = UserSignService::getUserSignVersion($uid);
+        if ($res = UserSignService::signToday($uid,$this->chapter->sign_version)) {
             //$sign_key = 'leyuee:wap:usersigni';
             //Redis::hset($sign_key, $uid, $res);
             return $res;

+ 1 - 1
app/Http/Controllers/Wap/User/UserController.php

@@ -219,7 +219,7 @@ class UserController extends BaseController
             if($version == 'v1'){
                 $fee = $sign_count>=3 ? 50:30;
             }else{
-                if ($sign_count % 7 == 1) {
+                if ($sign_count % 7 == 1 && $sign_count<=7) {
                     $fee = 30;
                 } elseif ($sign_count % 7 == 3) {
                     $fee = 120;

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

@@ -162,7 +162,7 @@ class UserSignService
         }
 
         $fee = 30;
-        if ($count % 7 == 1) {
+        if ($count % 7 == 1 && $count<=7) {
             $fee = 30;
         } elseif ($count % 7 == 3) {
             $fee = 120;