ContractRatio.php 706 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace addons\qingdongams\model;
  3. use addons\qingdongams\model\Product;
  4. use addons\qingdongams\model\ProductPart;
  5. use think\Model;
  6. /**
  7. *合同业绩分成
  8. */
  9. class ContractRatio extends Model
  10. {
  11. // 表名,不含前缀
  12. protected $name = 'qingdongams_contract_ratio';
  13. // 开启自动写入时间戳字段
  14. protected $autoWriteTimestamp = false;
  15. /**
  16. * 合同
  17. */
  18. public function contract(){
  19. return $this->belongsTo(Contract::class,'contract_id','id')->setEagerlyType(0);
  20. }
  21. //
  22. public function staff() {
  23. return $this->hasOne(Staff::class, 'id', 'staff_id')->field('id,name,img,department_id,post');
  24. }
  25. }