ShopHotKeywordsLogic.php 746 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace app\admin\logic;
  3. use app\admin\model\dao\ShopGoodsType;
  4. use app\admin\model\dao\ShopHotKeywords;
  5. use app\common\model\ShopGoods;
  6. use think\facade\Cache;
  7. /**
  8. * 商城商品
  9. * Class ShopGoodsLogic
  10. * @package app\admin\logic
  11. */
  12. class ShopHotKeywordsLogic
  13. {
  14. private static $CACHE_LIST_KEY = "cache:shop_host_keywords:list";
  15. public static function getCacheList()
  16. {
  17. $key = self::$CACHE_LIST_KEY;
  18. if (Cache::has($key)) {
  19. return Cache::get($key);
  20. }
  21. $name = ShopHotKeywords::getList();
  22. Cache::set($key, $name, 10 * 60);
  23. return $name;
  24. }
  25. public static function delCache()
  26. {
  27. $key = self::$CACHE_LIST_KEY;
  28. Cache::delete($key);
  29. }
  30. }