GoodBasic.php 531 B

123456789101112131415161718192021222324
  1. <?php
  2. declare (strict_types = 1);
  3. namespace app\model;
  4. use think\Model;
  5. /**
  6. * @mixin \think\Model
  7. */
  8. class GoodBasic extends Model
  9. {
  10. public function brand(){
  11. return $this->belongsTo(Brand::class,'brand_id','id')->bind(['brand_name']);
  12. }
  13. public function category(){
  14. return $this->belongsTo(Cat::class,'cat_id','id')->bind(['cat_name','cat_search'=>'search']);
  15. }
  16. public function Unit(){
  17. return $this->belongsTo(Unit::class,'good_unit','id')->bind(['unit_name'=>'unit']);
  18. }
  19. }