Person.php 800 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. namespace addons\qingdongams\model;
  3. use app\common\library\StaffAuth;
  4. use think\Model;
  5. use traits\model\SoftDelete;
  6. /**
  7. *
  8. */
  9. class Person extends Model
  10. {
  11. use SoftDelete;
  12. protected $name = 'qingdongams_person';
  13. // 开启自动写入时间戳字段
  14. protected $autoWriteTimestamp = 'int';
  15. // 定义时间戳字段名
  16. protected $createTime = 'createtime';
  17. protected $updateTime = 'updatetime';
  18. protected $deleteTime = 'deletetime';
  19. public function getAvatarAttr($value)
  20. {
  21. if ($value) {
  22. return cdnurl($value, true);
  23. } else {
  24. return $value;
  25. }
  26. }
  27. public function getCreatetimeAttr($value)
  28. {
  29. return date('Y-m-d H:i:s', $value);
  30. }
  31. }