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

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

@ -46,7 +46,7 @@ class Category extends Controller
public function childrenList(): Json
{
$model = new CategoryModel;
$list = $model->getChildrenList($this->request->param());
return $this->renderSuccess(compact('list'));

@ -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'));
}

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

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

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

Loading…
Cancel
Save