Pārlūkot izejas kodu

Merge branch 'develop'

duqinya 5 gadi atpakaļ
vecāks
revīzija
ccd9abfefe

+ 9 - 9
app/Repositories/CmsContentTemplateSetRepository.php

@@ -342,14 +342,14 @@ class CmsContentTemplateSetRepository
 
         $field_order = $request['field_order'] ?? '';
         $product_key = config('constants.CMS_PRODUCTS');
-        $product_key = sprintf($product_key,md5($res_id.$field_order));
-//        if (Cache::has($product_key)) {
+        $product_keys = sprintf($product_key,md5($res_id.$field_order));
+//        if (Cache::has($product_keys)) {
 //            return Cache::store('redis')->get($product_key);
 //        }
 
-        Log::info(Redis::exists($product_key));
-        if (Redis::exists($product_key)) {
-            $result = Redis::get($product_key);
+        Log::info(Redis::exists($product_keys));
+        if (Redis::exists($product_keys)) {
+            $result = Redis::get($product_keys);
             $res = json_decode($result, true);
             Log::info($res);
             return $res;
@@ -371,11 +371,11 @@ class CmsContentTemplateSetRepository
 
             $url = config("customer.app_service_url") . '/product/exchange/subject';
             $http = http($url, $array, 'get');
-//            if (!Cache::has($product_key)) {
-//                Cache::store('redis')->put($product_key, $http, 600);//10分钟过期
+//            if (!Cache::has($product_keys)) {
+//                Cache::store('redis')->put($product_keys, $http, 600);//10分钟过期
 //            }
-            if (!Redis::exists($product_key)) {
-                Redis::setex($product_key, 300, json_encode($http));//5分钟过期
+            if (!Redis::exists($product_keys)) {
+                Redis::setex($product_keys, 300, json_encode($http));//5分钟过期
                 Log::debug('专题商品缓存存储成功-' . json_encode($http));
             }
             return $http;