Browse Source

'搜索过滤'

zhuchengjie 2 years ago
parent
commit
9e4aedaff8

+ 2 - 0
app/Http/Controllers/QuickApp/Book/BookController.php

@@ -381,6 +381,7 @@ class BookController extends BaseController
         }
 
         $page_size = $request->input('page_size', 15);
+        $where['channel_id'] = $this->distribution_channel_id;
         $books     = BookConfigService::getBooks($where, $order, $page_size);
         return response()->pagination(new BookTransformer, $books);
     }
@@ -400,6 +401,7 @@ class BookController extends BaseController
         }
         $bid   = BookService::decodeBidStatic($bid);
         $where = ['category_id' => $category_id, 'is_on_shelf' => [2]];
+        $where['channel_id'] = $this->distribution_channel_id;
         $books = BookConfigService::getBooks($where, [], 4);
         $data  = [];
         foreach ($books as $v) {

+ 6 - 1
app/Modules/Book/Models/BookConfig.php

@@ -162,7 +162,12 @@ class BookConfig extends Model
                 }
             }
         }
-        $res->whereNotIn('book_configs.cp_source',getHiddenCp());
+        if(isset($where['channel_id']) && $where['channel_id'] == 7477){
+            $res->whereNotIn('book_configs.cp_source',getHiddenCp());
+        }else{
+            $res->whereNotIn('book_configs.cp_source',array_merge(getHiddenCp(),['lianshang']));
+        }
+
         return $res->orderBy($order[0], $order[1])->orderBy('book_configs.updated_at', 'desc')->paginate($page_size);
     }