|
@@ 249-252 (lines=4) @@
|
| 246 |
|
foreach ($properties as $propertyId => $propertyStaticValues) { |
| 247 |
|
$subQuery = self::initSubQuery($category_id, $joinCondition); |
| 248 |
|
$subQuery->andWhere(['property_static_value_id' => $propertyStaticValues,]); |
| 249 |
|
$subQueryOptimisation = Yii::$app->db->cache(function($db) use ($subQuery) { |
| 250 |
|
$ids = implode(', ', $subQuery->createCommand($db)->queryColumn()); |
| 251 |
|
return empty($ids) === true ? '(-1)' : "($ids)"; |
| 252 |
|
}, 86400, new TagDependency([ |
| 253 |
|
'tags' => [ |
| 254 |
|
ActiveRecordHelper::getCommonTag(ObjectStaticValues::className()), |
| 255 |
|
] |
|
@@ 268-271 (lines=4) @@
|
| 265 |
|
->andWhere('p.price <= (:max_price * currency.convert_nominal / currency.convert_rate)', |
| 266 |
|
[':max_price' => $priceMax]) |
| 267 |
|
->leftJoin(Currency::tableName() . ' ON currency.id = p.currency_id'); |
| 268 |
|
$subQueryOptimisation = Yii::$app->db->cache(function($db) use ($subQuery) { |
| 269 |
|
$ids = implode(', ', $subQuery->createCommand($db)->queryColumn()); |
| 270 |
|
return empty($ids) === true ? '(-1)' : "($ids)"; |
| 271 |
|
}, 86400, new TagDependency([ |
| 272 |
|
'tags' => [ |
| 273 |
|
ActiveRecordHelper::getCommonTag(ObjectStaticValues::className()), |
| 274 |
|
] |