From: JoySystem_v Date: Wed, 28 Aug 2024 11:19:18 +0000 (+0300) Subject: clear code X-Git-Tag: 1.4~24^2~1 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=e091aca374be89c34ffcb1213c9fdb1cf28da70d;p=erp24_rep%2Fyii-erp24%2F.git clear code --- 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); }