]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Merge branch 'refs/heads/develop' into feature_fomichev_erp-324_marketplace_orders
authorfomichev <vladimir.fomichev@erp-flowers.ru>
Thu, 6 Mar 2025 15:09:10 +0000 (18:09 +0300)
committerfomichev <vladimir.fomichev@erp-flowers.ru>
Thu, 6 Mar 2025 15:09:10 +0000 (18:09 +0300)
# Conflicts:
# erp24/.gitignore

1  2 
erp24/.gitignore
erp24/media/controllers/NotificationController.php
erp24/services/MarketplaceService.php

index 8943eaeda17a127c56f37b2db685fc72b89d871b,15e3abb7274759523c1c378dd9919988b94e4b05..85c59d7006c424d42d40c758ab3370a9f88c1142
@@@ -41,4 -41,6 +41,7 @@@ tests/_support/_generate
  /runtime/*
  /api2/runtime/*
  /api2/json/*
 -/pgsql_last.sql
+ /widgets/app.log
+ /web/dist-prod
++/pgsql_last.sql
 +/media/notification/*
index e339944a920a0b411772a093264b30e08b6ed83c,8720700d533b2e218f70c66d76f561d076bf79fd..b2e873387c692770d76ed5a3d1a306ea27d0af73
@@@ -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',
          ];
      }
  
Simple merge