]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Тестирование апи
authorfomichev <vladimir.fomichev@erp-flowers.ru>
Tue, 4 Mar 2025 15:05:28 +0000 (18:05 +0300)
committerfomichev <vladimir.fomichev@erp-flowers.ru>
Tue, 4 Mar 2025 15:05:28 +0000 (18:05 +0300)
erp24/commands/CronController.php
erp24/views/users-whatsapp-message/test.php

index 1d81070361f07e052a43854f088fe4a98d21b121..09f52b9d403b5203891432b8d97c1e35f1d50bae 100644 (file)
@@ -766,7 +766,7 @@ class CronController extends Controller
             );
 
             $channel = self::getChannelByName('WABA');
-            $limit = $channel['limit'] ?? 250;
+            $limit = $channel['messagingLimit'] ?? 250;
 
             if (!empty($phonesArray)) {
                 $messageText = $messagesSettings
index 8d6de0fe085bbdb1d70c70551382e0bbda624656..a651fa9bf25589ee0169e04222e47368b5e295c2 100644 (file)
@@ -5,25 +5,28 @@ use yii\helpers\Url;
 use yii\widgets\ActiveForm;
 use yii\base\DynamicModel;
 
-$model = new DynamicModel([
-    'phones', 'channelName', 'cascadeName', 'subjectId', 'templateName'
-]);
+$model = new class(['phones', 'channelName', 'cascadeName', 'subjectId', 'templateName']) extends DynamicModel {
+    public function formName()
+    {
+        return '';
+    }
+};
 
 $model->addRule(['phones', 'channelName', 'cascadeName', 'subjectId', 'templateName'], 'safe');
 
 ?>
 <div class="test-whatsapp col-6 p-4">
-<p>
-    <?= Html::a('Назад', ['index'], ['class' => 'btn btn-primary']) ?>
-</p>
+    <p>
+        <?= Html::a('Назад', ['index'], ['class' => 'btn btn-primary']) ?>
+    </p>
 
-<?php $form = ActiveForm::begin(); ?>
+    <?php $form = ActiveForm::begin(['method' => 'post']); ?>
 
     <h3>Отправка сообщений</h3>
-<?= $form->field($model, 'phones')->textInput([
-    'maxlength' => true,
-    'placeholder' => 'Введите телефоны через запятую'
-]) ?>
+    <?= $form->field($model, 'phones')->textInput([
+        'maxlength' => true,
+        'placeholder' => 'Введите телефоны через запятую'
+    ]) ?>
 
     <div class="form-group">
         <?= Html::submitButton('Отправить сообщения', [
@@ -35,10 +38,10 @@ $model->addRule(['phones', 'channelName', 'cascadeName', 'subjectId', 'templateN
     <hr>
 
     <h3>Получить канал по имени</h3>
-<?= $form->field($model, 'channelName')->textInput([
-    'maxlength' => true,
-    'placeholder' => 'Введите имя канала'
-]) ?>
+    <?= $form->field($model, 'channelName')->textInput([
+        'maxlength' => true,
+        'placeholder' => 'Введите имя канала'
+    ]) ?>
 
     <div class="form-group">
         <?= Html::submitButton('Получить канал', [
@@ -50,10 +53,10 @@ $model->addRule(['phones', 'channelName', 'cascadeName', 'subjectId', 'templateN
     <hr>
 
     <h3>Получить каскад по имени</h3>
-<?= $form->field($model, 'cascadeName')->textInput([
-    'maxlength' => true,
-    'placeholder' => 'Введите имя каскада'
-]) ?>
+    <?= $form->field($model, 'cascadeName')->textInput([
+        'maxlength' => true,
+        'placeholder' => 'Введите имя каскада'
+    ]) ?>
 
     <div class="form-group">
         <?= Html::submitButton('Получить каскад', [
@@ -65,14 +68,14 @@ $model->addRule(['phones', 'channelName', 'cascadeName', 'subjectId', 'templateN
     <hr>
 
     <h3>Получить шаблон по subjectId и имени шаблона</h3>
-<?= $form->field($model, 'subjectId')->textInput([
-    'maxlength' => true,
-    'placeholder' => 'Введите subjectId'
-]) ?>
-<?= $form->field($model, 'templateName')->textInput([
-    'maxlength' => true,
-    'placeholder' => 'Введите имя шаблона'
-]) ?>
+    <?= $form->field($model, 'subjectId')->textInput([
+        'maxlength' => true,
+        'placeholder' => 'Введите subjectId'
+    ]) ?>
+    <?= $form->field($model, 'templateName')->textInput([
+        'maxlength' => true,
+        'placeholder' => 'Введите имя шаблона'
+    ]) ?>
 
     <div class="form-group">
         <?= Html::submitButton('Получить шаблон', [
@@ -81,6 +84,5 @@ $model->addRule(['phones', 'channelName', 'cascadeName', 'subjectId', 'templateN
         ]) ?>
     </div>
 
-<?php ActiveForm::end(); ?>
-
-</div>
+    <?php ActiveForm::end(); ?>
+</div>
\ No newline at end of file