Skip to content

Commit f638200

Browse files
committed
0.4.6
Исправление ошибок
1 parent a04a361 commit f638200

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

common/models/extend/DocumentExtend.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public function getDataItemList($url = null)
146146
/*
147147
* @return string
148148
* */
149-
private function genereteView($templateData, $view, $type) {
149+
private function genereteView($templateData, $view, $type) {
150150
// Указан используется ли карусель
151151
if (strpos($view, '{^[') !== false) {
152152
$parsed = $this->getStringBetween($view, '{^[', ']^}');
@@ -189,7 +189,7 @@ private function genereteView($templateData, $view, $type) {
189189
}
190190
// цена без скидки
191191
if (strpos($view, '{$=' . $field['title'] . '=$}') !== false) {
192-
if (isset($field['value']['price'])) {
192+
if (isset($field['value']['price']) && $field['value']['price'] != $field['value']['discount_price']) {
193193
$view = str_replace('{$=' . $field['title'] . '=$}', $field['value']['price'], $view);
194194
} else {
195195
$view = str_replace('{$=' . $field['title'] . '=$}', Yii::t('app', ''), $view);
@@ -198,7 +198,7 @@ private function genereteView($templateData, $view, $type) {
198198
// процент скидки
199199
if (strpos($view, '{$%' . $field['title'] . '%$}') !== false) {
200200
if (isset($field['value']['percent'])) {
201-
$view = str_replace('{$%' . $field['title'] . '%$}', $field['value']['percent'], $view);
201+
$view = str_replace('{$%' . $field['title'] . '%$}', $field['value']['percent'] . '%', $view);
202202
} else {
203203
$view = str_replace('{$%' . $field['title'] . '%$}', Yii::t('app', ''), $view);
204204
}

common/models/search/DocumentSearch.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ public function setSearchFieldsQuery($query) {
182182
$query->leftJoin('value_int AS checkbox' . $key, 'document.id = checkbox' . $key . '.document_id');
183183
$query->andWhere(['and',
184184
['checkbox' . $key . '.type' => Constants::FIELD_TYPE_CHECKBOX],
185+
['checkbox' . $key . '.title' => $field['name']],
185186
['checkbox' . $key . '.value' => $this->elements_fields[$key][0]]
186187
]);
187188
}
@@ -191,6 +192,7 @@ public function setSearchFieldsQuery($query) {
191192
$query->leftJoin('value_int AS list_multy' . $key, 'document.id = list_multy' . $key . '.document_id');
192193
$query->andWhere(['and',
193194
['list_multy' . $key . '.type' => Constants::FIELD_TYPE_LIST_MULTY],
195+
['list_multy' . $key . '.title' => $field['name']],
194196
['list_multy' . $key . '.value' => $this->elements_fields[$key][0]]
195197
]);
196198
}
@@ -200,6 +202,7 @@ public function setSearchFieldsQuery($query) {
200202
$query->leftJoin('value_int AS radio' . $key, 'document.id = radio' . $key . '.document_id');
201203
$query->andWhere(['and',
202204
['radio' . $key . '.type' => Constants::FIELD_TYPE_RADIO],
205+
['radio' . $key . '.title' => $field['name']],
203206
['radio' . $key . '.value' => $this->elements_fields[$key][0]]
204207
]);
205208
}
@@ -209,6 +212,7 @@ public function setSearchFieldsQuery($query) {
209212
$query->leftJoin('value_int AS list' . $key, 'document.id = list' . $key . '.document_id');
210213
$query->andWhere(['and',
211214
['list' . $key . '.type' => Constants::FIELD_TYPE_LIST],
215+
['list' . $key . '.title' => $field['name']],
212216
['list' . $key . '.value' => $this->elements_fields[$key][0]]
213217
]);
214218
}

common/widgets/TemplateOfElement/components/FieldsManage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@ public function getIntRange($field_id, $document_id)
899899
$result = [];
900900
foreach ($values as $value) {
901901
/* @var $modelValueIntForm ValueIntForm */
902-
$result[] = $values['value'];
902+
$result[] = $value['value'];
903903
}
904904
return $result;
905905
}

0 commit comments

Comments
 (0)