SystemAdmin.php 662 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace app\admin\model;
  3. use app\common\model\TimeModel;
  4. class SystemAdmin extends TimeModel
  5. {
  6. protected function getOptions(): array
  7. {
  8. return [
  9. 'deleteTime' => 'delete_time',
  10. ];
  11. }
  12. public array $notes = [
  13. 'login_type' => [
  14. 1 => '密码登录',
  15. 2 => '密码 + 谷歌验证码登录'
  16. ],
  17. ];
  18. public static function getAuthIdsAttr($value): array
  19. {
  20. if (!$value) return [];
  21. return explode(',', $value);
  22. }
  23. public static function getAuthList(): array
  24. {
  25. return SystemAuth::where('status', 1)->column('title', 'id');
  26. }
  27. }