fastadmin model关联模型 关联查询问题

一对一关联

public function getGoodName(){
return $this->belongsTo('app\api\model\goods\Good','goods_good_id','id', [], 'LEFT')->setEagerlyType(0);
}

以少查多

public function getGoodName(){
return $this->belongsTo('app\api\model\goods\Good','goods_good_id','id');
}

猜你喜欢

转载自www.cnblogs.com/daochong/p/10076381.html