FarmPlotRunning.php 1012 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. namespace app\model;
  3. use support\Model;
  4. class FarmPlotRunning extends Model
  5. {
  6. protected $table = 'farm_plot_running';
  7. protected $primaryKey = 'farm_plot_running_id';
  8. protected $dateFormat = 'U';
  9. public const CREATED_AT = 'farm_plot_running_addtimes';
  10. public const UPDATED_AT = null;
  11. public function serializeDate(\DateTimeInterface $date)
  12. {
  13. return $date->format('Y-m-d H:i:s');
  14. }
  15. public function plot()
  16. {
  17. return $this->hasOne(FarmPlot::class, 'farm_plot_id', 'join_running_farm_plot_id');
  18. }
  19. public function member()
  20. {
  21. return $this->hasOne(Member::class, 'member_id', 'join_farm_plot_running_member_id');
  22. }
  23. public function memberInfo()
  24. {
  25. return $this->hasOne(MemberInfo::class, 'join_info_member_id', 'join_farm_plot_running_member_id');
  26. }
  27. public function memberCert()
  28. {
  29. return $this->hasOne(MemberCert::class, 'join_cert_member_id', 'join_farm_plot_running_member_id');
  30. }
  31. }