From: fomichev Date: Thu, 6 Mar 2025 15:09:10 +0000 (+0300) Subject: Merge branch 'refs/heads/develop' into feature_fomichev_erp-324_marketplace_orders X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=6f5dff0cdc29fb385babb8b12b78c8614f52e7ff;p=erp24_rep%2Fyii-erp24%2F.git Merge branch 'refs/heads/develop' into feature_fomichev_erp-324_marketplace_orders # Conflicts: # erp24/.gitignore --- 6f5dff0cdc29fb385babb8b12b78c8614f52e7ff diff --cc erp24/.gitignore index 8943eaed,15e3abb7..85c59d70 --- a/erp24/.gitignore +++ b/erp24/.gitignore @@@ -41,4 -41,6 +41,7 @@@ tests/_support/_generate /runtime/* /api2/runtime/* /api2/json/* + /widgets/app.log + /web/dist-prod -/pgsql_last.sql ++/pgsql_last.sql +/media/notification/* diff --cc erp24/media/controllers/NotificationController.php index e339944a,8720700d..b2e87338 --- a/erp24/media/controllers/NotificationController.php +++ b/erp24/media/controllers/NotificationController.php @@@ -22,17 -23,28 +23,31 @@@ use yii_app\services\MarketplaceService class NotificationController extends Controller { + const OUT_DIR = + //"/www/media/notification"; + "/var/www/erp24/media/notification"; public function actionTest() { + $request = Yii::$app->request; Yii::$app->response->format = \yii\web\Response::FORMAT_JSON; Yii::$app->response->statusCode = 200; + $body = $request->getRawBody(); + if (!empty($body)) { + $content = json_decode($body, false, 512, JSON_THROW_ON_ERROR); + $testCampaignId = $request->get('campaign_id', 109969229); + $testData = ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOrdersResponse', []); + if (!empty($testData) && isset($testData['orders'])) { + $ordersData[$testCampaignId] = $testData['orders']; + $result = MarketplaceService::processOrders($ordersData); + return [ + 'response' => 'OK (test data)', + 'storeCount' => count($ordersData), + 'result' => $result + ]; + } + } return [ - 'version' => '1.0.0', - 'name' => 'БазаЦветов24', - 'time' => gmdate('Y-m-d\TH:i:s\Z'), + 'response' => 'No data', ]; }