MarketCustomerLogs.php 910 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. }