duqinya 5 年 前
コミット
276ef2ed85
共有2 個のファイルを変更した3 個の追加3 個の削除を含む
  1. 1 1
      app/Http/Controllers/CmsContentTemplateSetController.php
  2. 2 2
      app/Repositories/CmsContentTemplateSetRepository.php

+ 1 - 1
app/Http/Controllers/CmsContentTemplateSetController.php

@@ -88,7 +88,7 @@ class CmsContentTemplateSetController extends BaseController
             return $this->jsonError('专题ID不正确');
         }
         $product_list = $this->cmsContentSetTemplate->getProducts($request->all());
-        if ($product_list) {
+        if (count($product_list) > 0) {
             $data = [];
             $data['subject_title'] = $get_subject->title ?? '';
             $data['subject_img'] = $get_subject->subject_img ?? '';

+ 2 - 2
app/Repositories/CmsContentTemplateSetRepository.php

@@ -373,8 +373,8 @@ class CmsContentTemplateSetRepository
 //                Cache::store('redis')->put($product_key, $http, 600);//10分钟过期
 //            }
             if (!Redis::exists($product_key)) {
-                Redis::setex($product_key, 600, json_encode($product_key));//10分钟过期
-                Log::debug('专题商品缓存存储成功-' . json_encode($product_key));
+                Redis::setex($product_key, 600, json_encode($http));//10分钟过期
+                Log::debug('专题商品缓存存储成功-' . json_encode($http));
             }
             return $http;