From 4961255733bc849a82704ec371164741b8b99f64 Mon Sep 17 00:00:00 2001 From: Vladimir Fomichev Date: Tue, 26 Aug 2025 17:12:23 +0300 Subject: [PATCH] =?utf8?q?=D0=9A=D1=80=D0=BE=D0=BD=20=D0=BA=D0=BE=D0=BC?= =?utf8?q?=D0=B0=D0=BD=D0=B4=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/api2/controllers/DataController.php | 8 ++++---- erp24/commands/CronController.php | 13 +++++++++++++ 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/erp24/api2/controllers/DataController.php b/erp24/api2/controllers/DataController.php index 309d09e6..658fa6f8 100644 --- a/erp24/api2/controllers/DataController.php +++ b/erp24/api2/controllers/DataController.php @@ -2563,9 +2563,9 @@ class DataController extends BaseController ->asArray() ->all(); foreach ($result["analysts_business_operations"] as $operation) { - if (!in_array($operation['guid'], array_keys($existingOperations))) { + if (!in_array($operation['id'], array_keys($existingOperations))) { $newOperation = new AnalystsBusinessOperations(); - $newOperation->id = $operation['guid']; + $newOperation->id = $operation['id']; $newOperation->name = $operation['name']; $newOperation->type = (int)$operation['type']; if (!in_array((int)$operation['type'], array_column($existingTypes, 'code'))) { @@ -2599,8 +2599,8 @@ class DataController extends BaseController } } else { - if ($existingOperations[$operation['guid']]['type'] !== (int)$operation['type']) { - $oldOperation = AnalystsBusinessOperations::findOne($operation['guid']); + if ($existingOperations[$operation['id']]['type'] !== (int)$operation['type']) { + $oldOperation = AnalystsBusinessOperations::findOne($operation['id']); if (!in_array((int)$operation['type'], array_column($existingTypes, 'code'))) { $newType = new AnalystsBusinessOperationsTypes(); $newType->code = (int)$operation['type']; diff --git a/erp24/commands/CronController.php b/erp24/commands/CronController.php index 5a9678f7..b16c0df4 100644 --- a/erp24/commands/CronController.php +++ b/erp24/commands/CronController.php @@ -225,6 +225,19 @@ class CronController extends Controller return 'ok'; } + //cron/one-c-cron-analysts + public function actionOneCCronAnalysts() + { + $req_id = time(); + + //Аналитика хозяйственных операций + $json_post = '{"request_id": "' . $req_id . '", "analysts_business_operations": true}'; + + $this->setApiCron($req_id, $json_post); + + return 'ok'; + } + // public function actionCreateResortings() { //пересортица // $req_id=time(); -- 2.39.5