mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-16 15:21:13 +08:00
Type fix
This commit is contained in:
@ -376,8 +376,8 @@ $customer = Customer::find(1);
|
||||
// lazy loading: SELECT * FROM tbl_order WHERE customer_id=1 AND subtotal>100
|
||||
$orders = $customer->getOrders()->where('subtotal>100')->all();
|
||||
|
||||
// eager loading: SELECT * FROM tbl_customer LIMIT 10
|
||||
SELECT * FROM tbl_order WHERE customer_id IN (1,2,...) AND subtotal>100
|
||||
// eager loading: SELECT * FROM tbl_customer LIMIT 100
|
||||
// SELECT * FROM tbl_order WHERE customer_id IN (1,2,...) AND subtotal>100
|
||||
$customers = Customer::find()->limit(100)->with([
|
||||
'orders' => function($query) {
|
||||
$query->andWhere('subtotal>100');
|
||||
|
Reference in New Issue
Block a user