问题:
解决办法:
crmeb/services/CacheService.php这个文件下加上这个方法
public static function getCacheTag(){ return self::$globalCacheName;}
app/api/controller/store/CategoryController.php 修改为
<?phpnamespace app\api\controller\store;use app\models\store\StoreCategory;use app\Request;use crmeb\services\CacheService;use think\facade\Cache;class CategoryController{ public function category(Request $request) { $cateogry = Cache::tag(CacheService::getCacheTag())->remember('CATEGORY', function () { $cateogry = StoreCategory::with('children')->where('is_show', 1)->order('sort desc,id desc')->where('pid', 0)->select(); return $cateogry->hidden(['add_time', 'is_show', 'sort', 'children.sort', 'children.add_time', 'children.pid', 'children.is_show'])->toArray(); }); return app('json')->success($cateogry); }}
{{item.user_info.nickname ? item.user_info.nickname : item.user_name}}
作者 管理员 企业
{{itemf.name}}
{{itemc.user_info.nickname}}
{{itemc.user_name}}
回复 {{itemc.comment_user_info.nickname}}
{{itemf.name}}