|
|
|
@ -115,12 +115,12 @@ class Order extends ActiveRecord
|
|
|
|
|
->viaTable('order_item', ['order_id' => 'id']); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function getBooksQuerysyntax() |
|
|
|
|
{ |
|
|
|
|
return $this->hasMany(Item::className(), ['id' => 'item_id']) |
|
|
|
|
->onCondition(['{{@item}}.category_id' => 1]) |
|
|
|
|
->viaTable('order_item', ['order_id' => 'id']); |
|
|
|
|
} |
|
|
|
|
// public function getBooksQuerysyntax() |
|
|
|
|
// { |
|
|
|
|
// return $this->hasMany(Item::className(), ['id' => 'item_id']) |
|
|
|
|
// ->onCondition(['{{@item}}.category_id' => 1]) |
|
|
|
|
// ->viaTable('order_item', ['order_id' => 'id']); |
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
public function getBooksExplicitA() |
|
|
|
|
{ |
|
|
|
@ -129,12 +129,12 @@ class Order extends ActiveRecord
|
|
|
|
|
->viaTable('order_item', ['order_id' => 'id']); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function getBooksQuerysyntaxA() |
|
|
|
|
{ |
|
|
|
|
return $this->hasMany(Item::className(), ['id' => 'item_id'])->alias('bo') |
|
|
|
|
->onCondition(['{{@item}}.category_id' => 1]) |
|
|
|
|
->viaTable('order_item', ['order_id' => 'id']); |
|
|
|
|
} |
|
|
|
|
// public function getBooksQuerysyntaxA() |
|
|
|
|
// { |
|
|
|
|
// return $this->hasMany(Item::className(), ['id' => 'item_id'])->alias('bo') |
|
|
|
|
// ->onCondition(['{{@item}}.category_id' => 1]) |
|
|
|
|
// ->viaTable('order_item', ['order_id' => 'id']); |
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
public function getBookItems() |
|
|
|
|
{ |
|
|
|
|