GameBelong.php 900 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /**
  3. * 游戏归属绑定设置
  4. *
  5. */
  6. namespace app\common\model;
  7. use think\Cache;
  8. class GameBelong extends \think\Model
  9. {
  10. protected $pk = 'id';
  11. protected $table = 'nw_game_belong';
  12. protected $autoWriteTimestamp = true;
  13. protected $createTime = 'create_time';
  14. protected $updateTime = 'update_time';
  15. protected static function init()
  16. {
  17. self::afterInsert(function () {
  18. Cache::clear('game_belong_info');
  19. });
  20. self::afterUpdate(function () {
  21. Cache::clear('game_belong_info');
  22. });
  23. self::afterDelete(function () {
  24. Cache::clear('game_belong_info');
  25. });
  26. }
  27. public function getCacheInfo ($where = [], $field = '*')
  28. {
  29. return $this->cache(true, 180, "game_belong_info")->where($where)->field($field)->find();
  30. }
  31. }