SysUser.php 676 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace app\model;
  3. use support\Model;
  4. class SysUser extends Model
  5. {
  6. protected $table = 'sys_user';
  7. protected $primaryKey = 'user_id';
  8. public const UPDATED_AT = null;
  9. protected $keyType = 'string';
  10. /* 按登录名查找用户 */
  11. public static function findByLoginName($name)
  12. {
  13. return self::where('user_login_name', $name)->first();
  14. }
  15. /**
  16. * @Desc 修改用户状态
  17. * @Author Gorden
  18. * @Date 2024/3/12 13:20
  19. *
  20. * @param $id
  21. * @param $data
  22. * @return int
  23. */
  24. public static function updateStatus($id, $data)
  25. {
  26. return self::where('user_id', $id)->update($data);
  27. }
  28. }