Tag.php 610 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace app\youzan\logic;
  3. use app\youzan\model\YzTag;
  4. use think\facade\Cache;
  5. //有赞标签 处理层
  6. class Tag
  7. {
  8. private static $cache_key = 'yz_tag_list';
  9. //获取分类列表
  10. public static function getYzTagList()
  11. {
  12. $rs = Cache::get(self::$cache_key);
  13. if (empty($rs)) {
  14. $rs = YzTag::field('id tag_id,name,type')
  15. ->where('is_del', YzTag::$is_del_normal)
  16. ->order('id')
  17. ->select()
  18. ->toArray();
  19. Cache::set(self::$cache_key, $rs, 3600);
  20. }
  21. return $rs;
  22. }
  23. }