作者 何书鹏

购物车列表联查优化

... ... @@ -15,11 +15,11 @@ class Cart extends Model
public function goods()
{
return $this->belongsTo('Goods','goods_id','goods_id');
return $this->belongsTo('Goods', 'goods_id', 'goods_id', [], 'INNER')->setEagerlyType(0);
}
public function sku()
{
return $this->belongsTo('GoodsSpec','sku_id','goods_spec_id');
return $this->belongsTo('GoodsSpec', 'sku_id', 'goods_spec_id', [], 'INNER')->setEagerlyType(0);
}
}
\ No newline at end of file
... ...