use app\records\OrdersUnion;
+use OpenAPI\Client\ObjectSerializer;
use Yii;
use yii\base\Exception;
use yii\data\ArrayDataProvider;
return $this->redirect(['index']);
}
+
+ public function actionCheckOrders($id)
+ {
+ $model = $this->findModel($id);
+ $content = json_decode($model->raw_data, false, 512, JSON_THROW_ON_ERROR);
+ $testCampaignId = 109969229;
+ $testData = ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\GetOrdersResponse', []);
+ if (!empty($testData) && isset($testData['orders'])) {
+ $ordersData[$testCampaignId] = $testData['orders'];
+ $result = MarketplaceService::processOrders($ordersData);
+ if (!empty($result)) {
+ Yii::$app->session->setFlash('success', 'Заказ обновлен.');
+ }
+ }
+ return $this->redirect(['index']);
+ }
/**
* Deletes an existing MarketplaceOrders model.
* If deletion is successful, the browser will be redirected to the 'index' page.