Cache.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\model\other;
  12. use crmeb\traits\ModelTrait;
  13. use crmeb\basic\BaseModel;
  14. use think\Model;
  15. /**
  16. * 缓存Model
  17. * Class Cache
  18. * @package app\model\other
  19. */
  20. class Cache extends BaseModel
  21. {
  22. use ModelTrait;
  23. const EXPIRE = 0;
  24. /**
  25. * 模型名称
  26. * @var string
  27. */
  28. protected $name = 'cache';
  29. /**
  30. * 缓存KEY搜索器
  31. * @param Model $query
  32. * @param $value
  33. * @param $data
  34. */
  35. public function searchKeyAttr($query, $value, $data)
  36. {
  37. $query->where('key', $value);
  38. }
  39. }