PlatformYouzan.php 855 B

123456789101112131415161718192021222324252627
  1. <?php
  2. declare (strict_types = 1);
  3. namespace app\txx\model;
  4. use app\model\GoodBasic;use app\model\Platform;use think\model;
  5. /**
  6. * @mixin \think\Model
  7. */
  8. class PlatformYouzan extends Model
  9. {
  10. protected $createTime='addtime';
  11. protected $updateTime='updatetime';
  12. public function good(){
  13. return $this->belongsTo(GoodBasic::class,'spuCode','spuCode')
  14. ->bind(['good_name','cat_id','is_exclusive','brand_id','good_img',"good_info_img","good_thumb_img",'good_unit','unit_name','brand_name','cat_name','cat_search']);
  15. }
  16. public function platform(){
  17. return $this->belongsTo(Platform::class,'platform_id','id')->bind(['platform_name']);
  18. }
  19. public function yzGood(){
  20. return $this->belongsTo(YzGood::class,'skuCode','item_no')->bind(['origin_price'=>'origin','deatil_url','yz_status'=>'status']);
  21. }
  22. }