ClientContent.php 837 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace app\model;
  3. use DateTimeInterface;
  4. use support\Model;
  5. class ClientContent extends Model
  6. {
  7. protected $table = 'client_content';
  8. protected $primaryKey = 'client_content_id';
  9. protected $dateFormat = 'U';
  10. const CREATED_AT = 'client_content_addtimes';
  11. const UPDATED_AT = null;
  12. protected function serializeDate(DateTimeInterface $date)
  13. {
  14. return $date->format('Y-m-d H:i:s');
  15. }
  16. public function member(){
  17. return $this->hasOne(Member::class,'member_id','join_client_content_member_id');
  18. }
  19. public function info(){
  20. return $this->hasOne(MemberInfo::class,'join_info_member_id','join_client_content_member_id');
  21. }
  22. public function cert(){
  23. return $this->hasOne(MemberCert::class,'join_cert_member_id','join_client_content_member_id');
  24. }
  25. }