zz 5 lat temu
rodzic
commit
4ed177017b

+ 5 - 8
app/Http/Controllers/Wap/User/CrmBooklistController.php

@@ -11,14 +11,7 @@ use Hashids;
 class CrmBooklistController extends Controller
 {
     private $channel_id;
-
-    public function __construct()
-    {
-        $user = app()->make('user');
-        $this->channel_id = $user->channel_id;
-    }
-
-
+    
     public function index(Request $request)
     {
         $month = date('n');
@@ -27,6 +20,8 @@ class CrmBooklistController extends Controller
 
     public function bookshow(Request $request)
     {
+        $user = app()->make('user');
+        $this->channel_id = $user->channel_id;
         $booklists = (new CrmBookAutoRecommendService)->getRecommendBooksFromRedis();
         $book_models = collect($booklists)->groupBy('category_id')
             ->map(function ($item, $key) {
@@ -51,6 +46,8 @@ class CrmBooklistController extends Controller
 
     public function booklist(Request $request)
     {
+        $user = app()->make('user');
+        $this->channel_id = $user->channel_id;
         $month = date('n');
         $category_id = $request->get('category_id', 0);
         if ($category_id) {