Family.php 563 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace app\model;
  3. use support\Model;
  4. class Family extends Model
  5. {
  6. protected $table = 'family';
  7. protected $primaryKey = 'family_id';
  8. protected $dateFormat = 'U';
  9. const CREATED_AT = 'family_addtimes';
  10. const UPDATED_AT = null;
  11. /**
  12. * @Desc 家庭-成员 一对多
  13. * @Author Gorden
  14. * @Date 2024/3/6 10:26
  15. *
  16. * @return \Illuminate\Database\Eloquent\Relations\HasMany
  17. */
  18. public function familyMember()
  19. {
  20. return $this->hasMany(FamilyMember::class,'join_family_id','family_id');
  21. }
  22. }