浏览代码

'根据包名判断'

zhuchengjie 2 年之前
父节点
当前提交
aee07686d1
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      app/Http/Controllers/QuickApp/Book/BookController.php

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

@@ -381,7 +381,7 @@ class BookController extends BaseController
         }
 
         $page_size = $request->input('page_size', 15);
-        $where['channel_id'] = $this->distribution_channel_id;
+        $where['channel_id'] = ($package === 'com.beidao.kuaiying.zsy') ? 7477 : 0;
         $books     = BookConfigService::getBooks($where, $order, $page_size);
         return response()->pagination(new BookTransformer, $books);
     }
@@ -396,12 +396,13 @@ class BookController extends BaseController
     {
         $category_id = $request->input('category_id');
         $bid         = $request->input('bid');
+        $package     = $request->header('x-package', '');
         if (empty($bid) || (empty($category_id) && $category_id != 0)) {
             return response()->error('PARAM_ERROR');
         }
         $bid   = BookService::decodeBidStatic($bid);
         $where = ['category_id' => $category_id, 'is_on_shelf' => [2]];
-        $where['channel_id'] = $this->distribution_channel_id;
+        $where['channel_id'] = ($package === 'com.beidao.kuaiying.zsy') ? 7477 : 0;
         $books = BookConfigService::getBooks($where, [], 4);
         $data  = [];
         foreach ($books as $v) {