zhuchengjie 2 anos atrás
pai
commit
6f4fbc226a

+ 11 - 10
app/Http/Controllers/QuickApp/Book/BookController.php

@@ -208,11 +208,11 @@ class BookController extends BaseController
         if(isset($user->uid) && !empty($user->uid)){
             if(!$this->send_order_id || $this->send_order_id == 0 ){
                 \Log::info('un_send_order_book:uid:'.$this->uid.' $package:'.$package);
-                $result = $this->getCheckBids($channel,$books,$package_id);
+                $result = $this->getCheckBids($channel,$books,$package_id,$package);
                 if(isset($result[1]['books']) && count((array)$result[1]['books']) > 1){
                     return response()->success($result);
                 }
-                $result = $this->getCheckBids($channel,$books,0);
+                $result = $this->getCheckBids($channel,$books,0,$package);
                 return response()->success($result);
             }else{
                 $package_id = 0;
@@ -222,7 +222,7 @@ class BookController extends BaseController
             $package_id = 0;
         }
         \Log::info('un_send_order_book:package_id3:'.$package_id.' $package:'.$package);
-        $result = $this->getCheckBids($channel,$books,$package_id);
+        $result = $this->getCheckBids($channel,$books,$package_id,$package);
         return response()->success($result);
 
     }
@@ -234,12 +234,12 @@ class BookController extends BaseController
      * @param $package_id
      * @return array
      */
-    private function getCheckBids($channel,$books,$package_id)
+    private function getCheckBids($channel,$books,$package_id,$package)
     {
-        $hotBids   = $this->getCheckBooks(QappRecommendService::getRecommendByPacketId($channel, 'hot',$package_id),$channel);
-        $liveBids  = $this->getCheckBooks(QappRecommendService::getRecommendByPacketId($channel, 'live',$package_id),$channel);
-        $recomBids = $this->getCheckBooks(QappRecommendService::getRecommendByPacketId($channel, 'recom',$package_id),$channel);
-        $newBids   = $this->getCheckBooks(QappRecommendService::getRecommendByPacketId($channel, 'new_recom',$package_id),$channel);
+        $hotBids   = $this->getCheckBooks(QappRecommendService::getRecommendByPacketId($channel, 'hot',$package_id),$channel,$package);
+        $liveBids  = $this->getCheckBooks(QappRecommendService::getRecommendByPacketId($channel, 'live',$package_id),$channel,$package);
+        $recomBids = $this->getCheckBooks(QappRecommendService::getRecommendByPacketId($channel, 'recom',$package_id),$channel,$package);
+        $newBids   = $this->getCheckBooks(QappRecommendService::getRecommendByPacketId($channel, 'new_recom',$package_id),$channel,$package);
 
         return array_filter([
             ['type' => 'reco_banner', 'lable' => '首页banner', 'books' => $books],
@@ -255,12 +255,13 @@ class BookController extends BaseController
      * 检测并补充不满足条件的书籍id
      * @param $bid_list
      * @param $channel : 频道
+     * @param $package : 频道
      * @return array
      */
-    private function getCheckBooks($bid_list,$channel)
+    private function getCheckBooks($bid_list,$channel,$package)
     {
         $hidden_cp = getHiddenCp();
-        if($this->distribution_channel_id != 7477){
+        if($package !== 'com.beidao.kuaiying.zsy'){
             $hidden_cp = array_merge($hidden_cp,['lianshang']);
         }
         //获取书本数量

+ 2 - 6
app/Http/Controllers/QuickApp/User/ReadRecordController.php

@@ -66,19 +66,15 @@ class ReadRecordController extends BaseController
      */
     public function index(Request $request)
     {
-        $user = $this->user_info;
         $res  = ReadRecordService::getReadRecord($this->uid);
+        $package = $request->header('x-package', '');
         //补充操作:如果该用户未订阅该下架的书籍则删除其阅读记录(书架不予显示)
         //判断是否属于包年用户
         $year_account = YearOrderService::getRecord($this->uid);
 
         if ($res) {
-//            $id_arr = [];
-//            foreach ($res as $key => $value) {
-//                $id_arr[] = $value['bid'];
-//            }
             $bids = array_column($res,'bid');
-            $channel_id = $this->distribution_channel_id;
+            $channel_id = ($package === 'com.beidao.kuaiying.zsy') ? 7477 : 0;
             $book = BookConfigService::getBookLists(compact($bids,$channel_id), [], false);//下架图书最近阅读可看到
             foreach ($res as $key => &$value) {
                 $value['cover']        = '';