|
|
|
@ -298,12 +298,12 @@ class Goods extends Controller |
|
|
|
|
{ |
|
|
|
|
$service = new GoodsService; |
|
|
|
|
$cache_key = "goods_recommended".$this->storeId.($this->user ? $this->user->user_type : 0); |
|
|
|
|
if(Cache::has($cache_key)) { |
|
|
|
|
$goodsList = Cache::get($cache_key); |
|
|
|
|
return $this->renderSuccess(compact('goodsList')); |
|
|
|
|
} |
|
|
|
|
// if(Cache::has($cache_key)) { |
|
|
|
|
// $goodsList = Cache::get($cache_key); |
|
|
|
|
// return $this->renderSuccess(compact('goodsList')); |
|
|
|
|
// } |
|
|
|
|
$goodsList = $service->recommended(); |
|
|
|
|
Cache::set($cache_key, $goodsList, 60*60); |
|
|
|
|
//Cache::set($cache_key, $goodsList, 60*60); |
|
|
|
|
return $this->renderSuccess(compact('goodsList')); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|