Commit a5378e41 by Alexander Makarov

Merge pull request #1877 from plusodinminus/patch-2

Type fix
parents 77dda5e6 c2c47a99
...@@ -376,8 +376,8 @@ $customer = Customer::find(1); ...@@ -376,8 +376,8 @@ $customer = Customer::find(1);
// lazy loading: SELECT * FROM tbl_order WHERE customer_id=1 AND subtotal>100 // lazy loading: SELECT * FROM tbl_order WHERE customer_id=1 AND subtotal>100
$orders = $customer->getOrders()->where('subtotal>100')->all(); $orders = $customer->getOrders()->where('subtotal>100')->all();
// eager loading: SELECT * FROM tbl_customer LIMIT 10 // eager loading: SELECT * FROM tbl_customer LIMIT 100
SELECT * FROM tbl_order WHERE customer_id IN (1,2,...) AND subtotal>100 // SELECT * FROM tbl_order WHERE customer_id IN (1,2,...) AND subtotal>100
$customers = Customer::find()->limit(100)->with([ $customers = Customer::find()->limit(100)->with([
'orders' => function($query) { 'orders' => function($query) {
$query->andWhere('subtotal>100'); $query->andWhere('subtotal>100');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment