return 'ok';
}
+ //cron/marketplace-orders-one-c-cron
+ public function actionMarketplaceOrdersOneCCron()
+ {
+ $req_id = time();
+
+ //заказы за 2 дня назад прогружаем
+ $json_post = '{"request_id": "' . $req_id . '", "marketplace_orders":{"start_time":"' . date("Y-m-d", time() - 86400 * 2) . ' 00:00:00","end_time":"' . date("Y-m-d", time()) . ' 23:59:59"}}';
+
+ $this->setApiCron($req_id, $json_post);
+
+ return 'ok';
+ }
+
//cron/one-c-cron-self-cost-day
public function actionOneCCronSelfCostDay()
{
--- /dev/null
+<?php
+
+use yii\db\Migration;
+
+/**
+ * Handles adding columns to table `{{%marketplace_orders}}`.
+ */
+class m250619_150158_add_seller_id_and_number_columns_to_marketplace_orders_table extends Migration
+{
+ const TABLE_NAME = 'erp24.marketplace_orders';
+ /**
+ * {@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('seller_id')) {
+ $this->addColumn(
+ self::TABLE_NAME,
+ 'seller_id',
+ $this->string()->null()->comment('ID продавца'),
+ );
+ }
+ if (!$this->db->schema->getTableSchema(self::TABLE_NAME, true)->getColumn('number_1c')) {
+ $this->addColumn(
+ self::TABLE_NAME,
+ 'number_1c',
+ $this->string()->null()->comment('Номер заказа в 1С'),
+ );
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function safeDown()
+ {
+ if ($this->db->schema->getTableSchema(self::TABLE_NAME, true)->getColumn('seller_id')) {
+ $this->dropColumn(self::TABLE_NAME, 'seller_id');
+ }
+ if ($this->db->schema->getTableSchema(self::TABLE_NAME, true)->getColumn('number_1c')) {
+ $this->dropColumn(self::TABLE_NAME, 'number_1c');
+ }
+ }
+}