123456789101112131415161718192021222324252627282930313233 |
- <?php
- namespace app\youzan\logic;
- use app\youzan\model\YzTag;
- use think\facade\Cache;
- //有赞标签 处理层
- class Tag
- {
- private static $cache_key = 'yz_tag_list';
- //获取分类列表
- public static function getYzTagList()
- {
- $rs = Cache::get(self::$cache_key);
- if (empty($rs)) {
- $rs = YzTag::field('id tag_id,name,type')
- ->where('is_del', YzTag::$is_del_normal)
- ->order('id')
- ->select()
- ->toArray();
- Cache::set(self::$cache_key, $rs, 3600);
- }
- return $rs;
- }
- }
|