belongsTo(GoodsCategory::class); } //关联商品尺寸 public function goodsItem() { return $this->hasMany('goods_item', 'goods_id', 'id'); } //关联品牌 public function goodsBrand() { return $this->hasOne('goods_brand','id','brand_id')->field('id,name'); } }