You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

30 lines
533 B

  1. <?php
  2. namespace app\admin\model;
  3. use think\Cache;
  4. use think\Model;
  5. class AuthRule extends Model
  6. {
  7. // 开启自动写入时间戳字段
  8. protected $autoWriteTimestamp = 'int';
  9. // 定义时间戳字段名
  10. protected $createTime = 'createtime';
  11. protected $updateTime = 'updatetime';
  12. protected static function init()
  13. {
  14. self::afterWrite(function ($row) {
  15. Cache::rm('__menu__');
  16. });
  17. }
  18. public function getTitleAttr($value, $data)
  19. {
  20. return __($value);
  21. }
  22. }