]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Удаление существующих записей
authorfomichev <vladimir.fomichev@erp-flowers.ru>
Thu, 26 Dec 2024 07:18:13 +0000 (10:18 +0300)
committerfomichev <vladimir.fomichev@erp-flowers.ru>
Thu, 26 Dec 2024 07:18:13 +0000 (10:18 +0300)
erp24/commands/CronController.php
erp24/records/Users.php

index 20831862c36e58c55726151e2755c5998091c0b0..cd174d5fb8d94abf20c38022f142453b8880bb0e 100644 (file)
@@ -265,7 +265,7 @@ class CronController extends Controller
             $dateToProcess = date('Y-m-d', strtotime("-$i days", strtotime($currentDate)));
             $startDate = date('Y-m-d', strtotime("+$step2 days", strtotime($dateToProcess)));
 
-            if (
+           /* if (
                 SentKogort::find()
                     ->where(['kogort_date' => $startDate, 'kogort_number' => SentKogort::KOGORT_NUMBERS['whatsapp']])
                     ->exists()
@@ -275,7 +275,7 @@ class CronController extends Controller
                     BaseConsole::FG_YELLOW
                 );
                 continue;
-            }
+            }*/
 
             $kogortPhones = Users::formKogortByDateAndType($startDate, 'whatsapp');
 
@@ -316,7 +316,7 @@ class CronController extends Controller
             $dateToProcess = date('Y-m-d', strtotime("-$i days", strtotime($currentDate)));
             $startDate = date('Y-m-d', strtotime("+$step3 days", strtotime($dateToProcess)));
 
-            if (
+            /*if (
                 SentKogort::find()
                     ->where(['kogort_date' => $startDate, 'kogort_number' => SentKogort::KOGORT_NUMBERS['call']])
                     ->exists()
@@ -326,7 +326,7 @@ class CronController extends Controller
                     BaseConsole::FG_YELLOW
                 );
                 continue;
-            }
+            }*/
 
             $kogortPhones = Users::formKogortByDateAndType($startDate, 'call');
 
index 9f9860c162cb5e5ede15752464b2a5a8664ade51..b0096fb142b14516364bab8c6d452cad0745c15c 100755 (executable)
@@ -571,6 +571,11 @@ class Users extends \yii\db\ActiveRecord
             ->where(['kogort_date' => $startDate, 'kogort_number' => $kogort_number])
             ->column();
 
+        if ($kogortPhones) {
+            SentKogort::deleteAll(['kogort_date' => $startDate, 'kogort_number' => $kogort_number]);
+            $kogortPhones =[];
+        }
+
         foreach ($phones as $phone) {
             if ($phone && !in_array($phone, $kogortPhones)) {
                 $sentKogort = new SentKogort();