public function actionFlowwowFeedFile() {
$marketplaceStoreIds = MarketplaceStore::find()
->select('warehouse_guid')
- ->where(['warehouse_id' => MarketplaceStore::FLOWWOW_WAREHOUSE_ID])
+ ->where(['warehouse_id' => MarketplaceStore::FLOWWOW_WAREHOUSE_ID, 'is_feed_active' => 1])
->column();
foreach ($marketplaceStoreIds as $key => $id) {
$balanceInfo = MarketplaceService::infoForMarketplace(1);
--- /dev/null
+<?php
+
+use yii\db\Migration;
+
+class m250923_153148_add_is_feed_active_to_marketplace_store_table extends Migration
+{
+ const TABLE_NAME = 'erp24.marketplace_store';
+ /**
+ * {@inheritdoc}
+ */
+ public function safeUp()
+ {
+ $table = $this->db->schema->getTableSchema(self::TABLE_NAME);
+ if ($table === null) {
+ return;
+ }
+
+ if (!$this->db->schema->getTableSchema(self::TABLE_NAME, true)->getColumn('is_feed_active')) {
+ $this->addColumn(
+ self::TABLE_NAME,
+ 'is_feed_active',
+ $this->tinyInteger()->notNull()->defaultValue(1)->comment('активность фида')
+ );
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function safeDown()
+ {
+ if ($this->db->schema->getTableSchema(self::TABLE_NAME, true)->getColumn('is_feed_active')) {
+ $this->dropColumn(self::TABLE_NAME, 'is_feed_active');
+ }
+ }
+
+
+
+}
* @property int $updated_at
* @property int $updated_by
* @property string $account_email Почта привязанная к магазину
+ * @property int $is_feed_active
*/
class MarketplaceStore extends \yii\db\ActiveRecord
{
const FLOWWOW_WAREHOUSE_ID = 1;
const YANDEX_WAREHOUSE_ID = 2;
+
/**
* {@inheritdoc}
*/
[['store_id'], 'exist', 'targetClass' => CityStore::class, 'targetAttribute' => 'id'],
[['name', 'guid', 'firm', 'warehouse_guid', 'account_email'], 'string'],
[['created_at', 'updated_at'], 'datetime', 'format' => 'php:Y-m-d H:i:s'],
- [['store_id', 'created_by', 'updated_by', 'warehouse_id',], 'integer'],
+ [['store_id', 'created_by', 'is_feed_active', 'updated_by', 'warehouse_id',], 'integer'],
['account_email', 'unique', 'message' => 'Этот email уже используется.'],
+
];
}
'created_by' => 'Автор создания записи',
'updated_at' => 'Дата изменения записи',
'updated_by' => 'Автор изменения записи',
- 'account_email' => 'Почта привязанная к магазину'
+ 'account_email' => 'Почта привязанная к магазину',
+ 'is_feed_active' => 'Активность фида'
];
}
</div>
<?= $form->field($model, 'warehouse_guid')->textInput(['type' => 'integer']) ?>
<?= $form->field($model, 'account_email')->textInput() ?>
+ <?= $form->field($model, 'is_feed_active')->checkbox() ?>
<?= $form->field($model, 'firm')->dropDownList($firms, ['prompt' => 'Выберите юр лицо']) ?>
<div class="form-group">