return $this->asJson([
'success' => true,
'message' => sprintf(
- 'Ð\9fоÑ\81Ñ\82авÑ\89ик "%s" деакÑ\82ивиÑ\80ован. СвÑ\8fзаннÑ\8bÑ\85 запиÑ\81ей: маÑ\80киÑ\80овки â\80\94 %d, маппинги â\80\94 %d.',
+ 'Ð\9fоÑ\81Ñ\82авÑ\89ик "%s" деакÑ\82ивиÑ\80ован. Ð\9cаÑ\80киÑ\80овки: %d, маппинги: %d.',
$model->name,
$result['markings'],
$result['product_mappings']
* @property string|null $article
* @property string|null $barcode
* @property int $quant Кратность заказа (>=1)
+ * @property bool $is_active
* @property int $created_by
* @property int|null $updated_by
* @property string $created_at
],
['supplier_id', 'validatePartialUnique'],
[['article', 'barcode', 'plantation_id'], 'default', 'value' => null],
+ ['is_active', 'boolean'],
+ ['is_active', 'default', 'value' => true],
['marking_ids', 'each', 'rule' => ['integer']],
['marking_ids', 'default', 'value' => []],
];
'article' => 'Артикул',
'barcode' => 'Штрихкод',
'quant' => 'Квант',
+ 'is_active' => 'Статус',
'marking_ids' => 'Маркировки',
];
}
->execute();
$mappingsCount = (int)Yii::$app->db->createCommand()
- ->update('{{%erp24.product_mappings}}', ['deleted_at' => new Expression('NOW()')], ['supplier_id' => $this->id, 'deleted_at' => null])
+ ->update('{{%erp24.product_mappings}}', ['is_active' => false], ['supplier_id' => $this->id, 'is_active' => true])
->execute();
$transaction->commit();
return [
- 'markings' => $markingsCount,
+ 'markings' => $markingsCount,
'product_mappings' => $mappingsCount,
];
} catch (\Exception $e) {