StoreFacility.php 523 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace app\admin\model;
  3. use think\Model;
  4. /**
  5. * StoreFacility
  6. */
  7. class StoreFacility extends Model
  8. {
  9. // 表名
  10. protected $name = 'store_facility';
  11. // 自动写入时间戳字段
  12. protected $autoWriteTimestamp = true;
  13. public function supplierStore()
  14. {
  15. return $this->belongsTo(\app\admin\model\SupplierStore::class, 'store_id', 'id');
  16. }
  17. public function facilityType()
  18. {
  19. return $this->belongsTo(\app\admin\model\FacilityType::class, 'type_id', 'id');
  20. }
  21. }