lqmac 10 months ago
parent fb6be5b1f4
commit 699f0298de
  1. 3
      app/admin/service/admin/User.php
  2. 10
      app/api/controller/Goods.php
  3. 1
      app/api/model/Goods.php
  4. 2
      app/command/SyncStoreBasicData.php
  5. 3
      app/common/service/store/User.php

@ -108,7 +108,8 @@ class User extends BaseService
// 获取请求中的token // 获取请求中的token
$token = request()->header('Access-Token'); $token = request()->header('Access-Token');
// 调试模式下可通过param // 调试模式下可通过param
if (empty($token) && is_debug()) { //if (empty($token) && is_debug()) {
if (empty($token)) {
$token = request()->param('Access-Token'); $token = request()->param('Access-Token');
} }
// 不存在token报错 // 不存在token报错

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

@ -465,6 +465,7 @@ class Goods extends GoodsModel
} }
$goodsInfo['merchant'] = null; $goodsInfo['merchant'] = null;
//商户信息 //商户信息
//if ($goodsInfo['merchant_id'] && !in_array($goodsInfo['channel'], ['jd','jd1','jd2','sn','sn2','xqtx'])) {
if ($goodsInfo['merchant_id']) { if ($goodsInfo['merchant_id']) {
$merchant = \app\common\model\Merchant::detail($goodsInfo['merchant_id'], $goodsInfo->store_id); $merchant = \app\common\model\Merchant::detail($goodsInfo['merchant_id'], $goodsInfo->store_id);
if ($merchant) { if ($merchant) {

@ -483,7 +483,7 @@ class SyncStoreBasicData extends Command
} }
} }
/** /**
* 同步服务数据 * 同步轮播图数据
* [syncHelpData description] * [syncHelpData description]
* @param [type] $store [description] * @param [type] $store [description]
* @return [type] [description] * @return [type] [description]

@ -130,7 +130,8 @@ class User extends BaseService
// 获取请求中的token // 获取请求中的token
$token = request()->header('Access-Token'); $token = request()->header('Access-Token');
// 调试模式下可通过param // 调试模式下可通过param
if (empty($token) && is_debug()) { //if (empty($token) && is_debug()) {
if (empty($token)) {
$token = request()->param('Access-Token'); $token = request()->param('Access-Token');
} }
// 不存在token报错 // 不存在token报错

Loading…
Cancel
Save