WorkorderProgress.php 772 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace addons\qingdongams\model;
  3. use think\Model;
  4. use traits\model\SoftDelete;
  5. /**
  6. *工单其他信息表
  7. */
  8. class WorkorderProgress Extends Model {
  9. use SoftDelete;
  10. protected $name = 'qingdongams_workorder_progress';
  11. // 开启自动写入时间戳字段
  12. protected $autoWriteTimestamp = 'int';
  13. // 定义时间戳字段名
  14. protected $createTime = 'createtime';
  15. protected $updateTime = 'updatetime';
  16. protected $deleteTime = 'deletetime';
  17. public function getCreatetimeAttr($value)
  18. {
  19. return date('Y-m-d H:i', $value);
  20. }
  21. //创建人
  22. public function createStaff()
  23. {
  24. return $this->hasOne(Staff::class, 'id', 'create_staff_id')->field('id,name');
  25. }
  26. }