zqwang 2 years ago
parent
commit
0b54e8b242

+ 4 - 0
app/Http/Controllers/QuickApp/Book/ChapterController.php

@@ -285,6 +285,10 @@ class ChapterController extends BaseController
         if ($bid == 58886) {
             $book_info->is_on_shelf = 0;
         }
+        // 华为整改强制下架
+        if ($this->distribution_channel_id == 13131 && in_array($bid,[13762,65327,66643])){
+            $book_info->is_on_shelf = 4;
+        }
 
         if (!in_array($book_info->is_on_shelf, [1, 2])) {
             if ($book_info->is_on_shelf != 4) {

+ 19 - 4
app/Http/Controllers/QuickApp/HuaWeiController.php

@@ -13,6 +13,7 @@ namespace App\Http\Controllers\QuickApp;
 use App\Http\Controllers\Controller;
 
 use App\Modules\Subscribe\Services\ChapterOrderService;
+use App\Modules\User\Services\ReadRecordService;
 use Illuminate\Support\Facades\DB;
 
 class HuaWeiController extends  Controller
@@ -22,18 +23,32 @@ class HuaWeiController extends  Controller
 
         $has =ChapterOrderService::checkBookIsOrdered(341799779,66643);
         echo "<pre><hr>";
-        var_export($has);
+        $res = ReadRecordService::getReadRecord(341799779);
+
+        if ($res){
+            $res = array_column($res,null,'bid');
+            $res = $res[66643] ?? [];
+        }
         echo  "<hr>";
+        var_export($res);
         die();
+        // ReadRecordService::delReadRecordStatic($this->uid, [66643]);
+        echo "<pre><hr>";
+        var_export($has);
+        echo  "<hr>";
         die();
-        $sql = "SELECT id,send_order_id,balance,created_at FROM users WHERE send_order_id in (4007118,4007706,4007708,4007731,4007733,4007793,4007834,4007843,4009806,4012429,4016127,4023097) and LENGTH(openid) > 32 AND created_at >  '2023-02-2' and  balance >  0 and balance <  100;";
+        // die();
+        $sql = "SELECT id,send_order_id,balance,created_at FROM users WHERE send_order_id in (4007118,4007706,4007708,4007731,4007733,4007793,4007834,4007843,4009806,4012429,4016127,4023097) and LENGTH(openid) > 32 AND created_at >  '2023-02-2'  and balance <  100;";
         // $sql = "SELECT id,send_order_id,balance,created_at FROM users WHERE 1 limit 10";
         $uids = DB::select($sql);
         foreach ($uids as $v){
             $res  = ReadRecordService::getReadRecord($v->id);
+            if($res){
+                $res = array
+            }
             // $res  = ReadRecordService::getReadRecord(1234598187);
-            echo "<pre><hr> uid => ".$v->id."\t 书币:{$v->balance} \t 注册时间:{$v->created_at} \t 阅读书籍本数:".count($res)."<br> ";
-            var_export($res);
+            // echo "<pre><hr> uid => ".$v->id."\t 书币:{$v->balance} \t 注册时间:{$v->created_at} \t 阅读书籍本数:".count($res)."<br> ";
+            // var_export($res);
 
         }