Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/cvetdv.ru/bitrix/modules/wbs24.ozonapinew/lib/Orders/Statuses/Push/ |
Upload File : |
<?php namespace Wbs24\Ozonapinew\Orders\Statuses\Push; /** * Конвертация статусов с push уведолмений */ class Convert { protected $sellerStatusesToPushModel = [ [ 'sellerStatus' => 'acceptance_in_progress', 'pushStatuses' => [ 'posting_acceptance_in_progress' ] ], /* [ 'sellerStatus' => 'awaiting_approve', 'pushStatuses' => [ 'posting_created' ] ], */ [ 'sellerStatus' => 'awaiting_packaging', 'pushStatuses' => [ 'posting_created' ] ], [ 'sellerStatus' => 'awaiting_registration', 'pushStatuses' => [ 'posting_awaiting_registration' ] ], [ 'sellerStatus' => 'awaiting_deliver', 'pushStatuses' => [ 'posting_transferring_to_delivery', 'posting_in_carriage', 'posting_not_in_carriage' ] ], [ 'sellerStatus' => 'arbitration', 'pushStatuses' => [ 'posting_in_arbitration', ] ], [ 'sellerStatus' => 'client_arbitration', 'pushStatuses' => [ 'posting_in_client_arbitration', ] ], [ 'sellerStatus' => 'delivering', 'pushStatuses' => [ 'posting_on_way_to_city', 'posting_transferred_to_courier_service', 'posting_in_courier_service', 'posting_on_way_to_pickup_point', 'posting_in_pickup_point', 'posting_conditionally_delivered', ] ], [ 'sellerStatus' => 'driver_pickup', 'pushStatuses' => [ 'posting_driver_pick_up', ] ], [ 'sellerStatus' => 'delivered', 'pushStatuses' => [ 'posting_delivered', 'posting_received', ] ], [ 'sellerStatus' => 'cancelled', 'pushStatuses' => [ 'posting_canceled', ] ], [ 'sellerStatus' => 'not_accepted', 'pushStatuses' => [ 'posting_not_in_sort_center', ] ] ]; public function convertStatus(string $pushStatus): string { $needSellerStatus = ''; foreach ($this->sellerStatusesToPushModel as $statuses) { $sellerStatus = $statuses['sellerStatus']; $pushStatuses = $statuses['pushStatuses']; if (in_array($pushStatus, $pushStatuses)) { $needSellerStatus = $sellerStatus; break; } } return $needSellerStatus; } }