Users.php 753 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace app\admin\model;
  3. use app\common\model\BaseModel;
  4. class Users extends BaseModel
  5. {
  6. /**
  7. * @var string
  8. */
  9. protected $name = 'system_users';
  10. /**
  11. * @var array
  12. */
  13. protected $auto = [];
  14. /**
  15. * @var array
  16. */
  17. protected $insert = ['created_at','updated_at'];
  18. /**
  19. * @var array
  20. */
  21. protected $update = ['updated_at'];
  22. /**
  23. * 密码修改器
  24. *
  25. * @author 许祖兴 < zuxing.xu@lettered.cn>
  26. * @date 2020/3/16 17:19
  27. *
  28. * @param string $value 原始值
  29. * @return string 加密后
  30. */
  31. public function setPasswordAttr($value)
  32. {
  33. return password_hash($value, PASSWORD_BCRYPT);
  34. }
  35. }