MarketCustomerLogs.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. namespace app\model;
  3. use DateTimeInterface;
  4. use support\Model;
  5. class MarketCustomerLogs extends Model
  6. {
  7. protected $table = 'market_customer_logs';
  8. protected $dateFormat = 'U';
  9. public function serializeDate(DateTimeInterface $date)
  10. {
  11. return $date->format('Y-m-d H:i:s');
  12. }
  13. public function custom()
  14. {
  15. return $this->belongsTo(MarketCustomer::class, 'market_customer_id');
  16. }
  17. public function beforeMan()
  18. {
  19. return $this->belongsTo(Consultant::class, 'before_consultant_id');
  20. }
  21. public function currentMan()
  22. {
  23. return $this->belongsTo(Consultant::class, 'consultant_id');
  24. }
  25. public function opBackPerson()
  26. {
  27. return $this->belongsTo(SysUser::class, 'change_user_id');
  28. }
  29. public function opFrontPerson()
  30. {
  31. return $this->belongsTo(Consultant::class, 'change_consultant_id');
  32. }
  33. public function beforeDept(){
  34. return $this->belongsTo(SysDept::class, 'before_dept_id');
  35. }
  36. public function currentDept(){
  37. return $this->belongsTo(SysDept::class, 'dept_id');
  38. }
  39. }