From: Vladimir Fomichev Date: Tue, 26 Aug 2025 14:12:23 +0000 (+0300) Subject: Крон команда X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=4961255733bc849a82704ec371164741b8b99f64;p=erp24_rep%2Fyii-erp24%2F.git Крон команда --- 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();