Forráskód Böngészése

派单用户男频首页配置书籍不足自动补齐

wangzq 2 éve
szülő
commit
977db89d07

+ 1 - 1
app/Http/Controllers/QuickApp/Book/BookController.php

@@ -179,7 +179,7 @@ class BookController extends BaseController
             return response()->success($result);
         }
         if($send_order_id >  0 && $package == "com.beidao.kuaiying.yueai" && $sex == "male"){
-            $result  = BookAuditService::getYueaiHomeBooksData($sex, $package,$isAuth,$channel);
+            $result  = BookAuditService::getYueaiHomeBooksData($sex, $package,$isAuth,1);
             return  response()->success($result);
         }
         if ($sex == 'male') {

+ 6 - 15
app/Modules/Book/Services/BookAuditService.php

@@ -114,7 +114,7 @@ class BookAuditService
         ];
     }
 
-    private function getCheckBooks($bid_list,$channel,$package,$is_author)
+    private static function getCheckBooks($bid_list,$channel,$package,$is_author)
     {
         $hidden_cp = getHiddenCp();
         if($package !== 'com.beidao.kuaiying.zsy'){
@@ -122,27 +122,18 @@ class BookAuditService
         }
         //获取书本数量
         $count = count($bid_list);
-        if (!$is_author){
-            $where = [
-                ['book_configs.charge_type','!=','BOOK'],
-                ['book_configs.cp_source','=','ycsd'],
-            ];
-        }else{
-            $where = [
-                ['book_configs.charge_type','!=','BOOK'],
-            ];
-        }
+        $where = [
+            ['book_configs.charge_type','!=','BOOK'],
+        ];
         //获取当前有效书本数量
         $book_count = BookConfig::join('books', 'book_configs.bid', '=', 'books.id')
             ->leftjoin('book_categories', 'books.category_id', 'book_categories.id')
             ->whereIn('book_configs.bid',$bid_list)
-            ->where('book_configs.is_on_shelf','in',[1,2])
-            ->where('book_configs.charge_type','!=','BOOK')
+            ->whereIn('book_configs.is_on_shelf',[1,2])
             ->whereNotIn('book_configs.cp_source',$hidden_cp)
             ->where($where)
             ->where('book_categories.pid',$channel)
             ->count();
-
         if($count == $book_count){
             return $bid_list;
         }
@@ -155,7 +146,7 @@ class BookAuditService
         $bids = BookConfig::join('books', 'book_configs.bid', '=', 'books.id')
             ->leftjoin('book_categories', 'books.category_id', 'book_categories.id')
             ->whereIn('book_configs.bid',$bid_list)
-            ->where('book_configs.is_on_shelf','in',[1,2])
+            ->whereIn('book_configs.is_on_shelf',[1,2])
             ->where($where)
             ->whereNotIn('book_configs.cp_source',$hidden_cp)
             ->where('book_categories.pid',$channel)