From 929f7fc2d1386e256dae1cfbc9ead0aa637415cf Mon Sep 17 00:00:00 2001 From: fomichev Date: Thu, 19 Jun 2025 18:11:24 +0300 Subject: [PATCH] =?utf8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD?= =?utf8?q?=D0=B0=20=D0=BC=D0=B8=D0=B3=D1=80=D0=B0=D1=86=D0=B8=D1=8F=20?= =?utf8?q?=D0=B8=20=D0=BA=D1=80=D0=BE=D0=BD=20=D0=BA=D0=BE=D0=BC=D0=B0?= =?utf8?q?=D0=BD=D0=B4=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/commands/CronController.php | 13 +++++ ...er_columns_to_marketplace_orders_table.php | 49 +++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 erp24/migrations/m250619_150158_add_seller_id_and_number_columns_to_marketplace_orders_table.php diff --git a/erp24/commands/CronController.php b/erp24/commands/CronController.php index 1b09d23b..480b3789 100644 --- a/erp24/commands/CronController.php +++ b/erp24/commands/CronController.php @@ -176,6 +176,19 @@ class CronController extends Controller 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() { diff --git a/erp24/migrations/m250619_150158_add_seller_id_and_number_columns_to_marketplace_orders_table.php b/erp24/migrations/m250619_150158_add_seller_id_and_number_columns_to_marketplace_orders_table.php new file mode 100644 index 00000000..c6137ad6 --- /dev/null +++ b/erp24/migrations/m250619_150158_add_seller_id_and_number_columns_to_marketplace_orders_table.php @@ -0,0 +1,49 @@ +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'); + } + } +} -- 2.39.5