]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Крон команда
authorVladimir Fomichev <vladimir.fomichev@erp-flowers.ru>
Tue, 26 Aug 2025 14:12:23 +0000 (17:12 +0300)
committerVladimir Fomichev <vladimir.fomichev@erp-flowers.ru>
Tue, 26 Aug 2025 14:12:23 +0000 (17:12 +0300)
erp24/api2/controllers/DataController.php
erp24/commands/CronController.php

index 309d09e679962aae8f720b026a68bb701ea99846..658fa6f8a1714bc8b6d2a84991359236de3ce92f 100644 (file)
@@ -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'];
index 5a9678f7f28b006d762e33e37414f2c4194e3a95..b16c0df4a162d4434f3e89a8d4815bc605c67d27 100644 (file)
@@ -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();