From: fomichev Date: Wed, 20 Nov 2024 10:40:17 +0000 (+0300) Subject: Исправления по ревью X-Git-Tag: 1.7~226^2~1 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=bdb7723938a9841767a75a4e25d2cacc59f9c16a;p=erp24_rep%2Fyii-erp24%2F.git Исправления по ревью --- diff --git a/erp24/controllers/crud/Product1cReplacementController.php b/erp24/controllers/crud/Product1cReplacementController.php index 9141d669..727a00be 100644 --- a/erp24/controllers/crud/Product1cReplacementController.php +++ b/erp24/controllers/crud/Product1cReplacementController.php @@ -30,14 +30,14 @@ class Product1cReplacementController extends Controller 'verbs' => [ 'class' => VerbFilter::class, 'actions' => [ - //'delete' => ['POST'], + ], ], [ 'class' => TimestampBehavior::class, 'createdAtAttribute' => 'created_at', 'updatedAtAttribute' => 'updated_at', - //'deletedAtAttribute' => 'deleted_at', + 'value' => new \yii\db\Expression('NOW()'), ], ] @@ -64,7 +64,6 @@ class Product1cReplacementController extends Controller ->select('guid_replacement') ->where(['guid' => $model->guid]) ->andWhere(['deleted_at' => null]) - // ->distinct() ->column(); } @@ -197,7 +196,7 @@ class Product1cReplacementController extends Controller if ($guid) { - if ($guid == "guid"){ + if ($guid == "guid") { $existingGuids = Product1cReplacement::find() ->select(['guid']) ->distinct() @@ -256,7 +255,7 @@ class Product1cReplacementController extends Controller try { $replacementData = $this->request->post('Product1cReplacement')['guid_replacement'] ?? []; $replacementIds = $this->request->post('Product1cReplacement')['replacement_ids'] ?? []; - //var_dump($replacementData); die(); + foreach ($replacementData as $index => $replacementGuid) { if (!empty($replacementIds[$index])) { diff --git a/erp24/records/Product1cReplacementSearch.php b/erp24/records/Product1cReplacementSearch.php index c7fe607a..5f95c943 100644 --- a/erp24/records/Product1cReplacementSearch.php +++ b/erp24/records/Product1cReplacementSearch.php @@ -70,4 +70,5 @@ class Product1cReplacementSearch extends Product1cReplacement return $dataProvider; } -} \ No newline at end of file + +} diff --git a/erp24/views/crud/product1c-replacement/_form.php b/erp24/views/crud/product1c-replacement/_form.php index 27faa68b..d364b6c9 100644 --- a/erp24/views/crud/product1c-replacement/_form.php +++ b/erp24/views/crud/product1c-replacement/_form.php @@ -30,19 +30,21 @@ $this->registerJsFile('/js/crud/product1cReplacement/_form.js', ['position' => \ 'dataType' => 'json', 'data' => new JsExpression('function(params) { return {q:params.term, guid: "guid"}; }'), 'processResults' => new JsExpression('function(data) { - return { - results: $.map(data.items, function(item) { return { - id: item.id, - text: item.text + results: $.map(data.items, function(item) { + return { + id: item.id, + text: item.text + }; + }) }; - }) - }; - }'), + }'), ], ], ]) ?> -

Внимание! Если товар не найден, проверьте общий список - возможно товар уже присутствует в списке замен

+

Внимание! Если товар не найден, + проверьте общий список - возможно товар + уже присутствует в списке замен

@@ -58,29 +60,29 @@ $this->registerJsFile('/js/crud/product1cReplacement/_form.js', ['position' => \ 'url' => \yii\helpers\Url::to(['/crud/product1c-replacement/search']), 'dataType' => 'json', 'data' => new JsExpression('function(params) { - var exclude = []; - exclude.push($("#product1creplacement-guid").val()); - $(".guid-replacement-select").each(function() { - if ($(this).val()) { - exclude.push($(this).val()); - } - }); - return { - q: params.term, - exclude: exclude.join(","), - guid: $("#guid-select").val() - }; - }'), - 'processResults' => new JsExpression('function(data) { - return { - results: $.map(data.items, function(item) { + var exclude = []; + exclude.push($("#product1creplacement-guid").val()); + $(".guid-replacement-select").each(function() { + if ($(this).val()) { + exclude.push($(this).val()); + } + }); return { - id: item.id, - text: item.text + q: params.term, + exclude: exclude.join(","), + guid: $("#guid-select").val() }; - }) - }; - }'), + }'), + 'processResults' => new JsExpression('function(data) { + return { + results: $.map(data.items, function(item) { + return { + id: item.id, + text: item.text + }; + }) + }; + }'), ], ], ]) ?> diff --git a/erp24/views/crud/product1c-replacement/update.php b/erp24/views/crud/product1c-replacement/update.php index e5015049..3f6ff8dd 100644 --- a/erp24/views/crud/product1c-replacement/update.php +++ b/erp24/views/crud/product1c-replacement/update.php @@ -12,7 +12,9 @@ $this->params['breadcrumbs'][] = 'Update'; ?>
'btn btn-danger mb-4']) ?> -

title) ?>
product->name ?> (product->id ?> , product->articule ?>)

+

title) ?>
+ product->name ?> + (product->id ?>, product->articule ?>)

render('multy-form', [ 'model' => $model,