ShopSupplierLogic.php 661 B

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