From e091aca374be89c34ffcb1213c9fdb1cf28da70d Mon Sep 17 00:00:00 2001 From: JoySystem_v Date: Wed, 28 Aug 2024 14:19:18 +0300 Subject: [PATCH] clear code --- erp24/api2/controllers/DataController.php | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/erp24/api2/controllers/DataController.php b/erp24/api2/controllers/DataController.php index 1e392acb..462d88c7 100644 --- a/erp24/api2/controllers/DataController.php +++ b/erp24/api2/controllers/DataController.php @@ -478,8 +478,7 @@ class DataController extends BaseController { $values = []; - file_put_contents(self::OUT_DIR . '/error_upload.txt', - PHP_EOL . 'self_cost', FILE_APPEND); + foreach ($result['self_cost'] as $selfCost) { @@ -487,8 +486,7 @@ class DataController extends BaseController { if (!$storeId) { continue; } - file_put_contents(self::OUT_DIR . '/error_upload.txt', - PHP_EOL . $storeId, FILE_APPEND); + // Удаляем старые данные SelfCostProduct::deleteAll(['date' => $selfCost['date'], 'store_id' => $storeId]); @@ -506,10 +504,7 @@ class DataController extends BaseController { if (!empty($values)) { - file_put_contents(self::OUT_DIR . '/error_upload.txt', - PHP_EOL . 'values', FILE_APPEND); - file_put_contents(self::OUT_DIR . '/error_upload.txt', - PHP_EOL . count($values), FILE_APPEND); + $this->setSelfCostUpdate($values); } @@ -1666,8 +1661,7 @@ class DataController extends BaseController { 'updated_at' ]; - file_put_contents(self::OUT_DIR . '/error_upload.txt', - PHP_EOL . 'self', FILE_APPEND); + $this->insertDataSales($values, 'self_cost_product', $columns, 4000); } -- 2.39.5