TaskProcess.php 776 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace app\model;
  3. use DateTimeInterface;
  4. use support\Model;
  5. class TaskProcess extends Model
  6. {
  7. protected $table = 'task_process';
  8. protected $primaryKey = 'task_process_id';
  9. protected $dateFormat = 'U';
  10. const CREATED_AT = 'task_process_addtimes';
  11. const UPDATED_AT = null;
  12. public function serializeDate(DateTimeInterface $date)
  13. {
  14. return $date->format('Y-m-d H:i:s');
  15. }
  16. /**
  17. * @Desc 管理管理员
  18. * @Author Gorden
  19. * @Date 2024/4/8 11:23
  20. *
  21. * @return \Illuminate\Database\Eloquent\Relations\HasOne
  22. */
  23. public function user()
  24. {
  25. return $this->hasOne(SysUser::class, 'user_id', 'join_task_process_user_id')
  26. ->select('user_id','user_name','user_login_name');
  27. }
  28. }