]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Добавление модели данных для сообщений
authorfomichev <vladimir.fomichev@erp-flowers.ru>
Fri, 10 Jan 2025 08:47:22 +0000 (11:47 +0300)
committerfomichev <vladimir.fomichev@erp-flowers.ru>
Fri, 10 Jan 2025 08:47:22 +0000 (11:47 +0300)
erp24/records/UsersTelegramMessage.php [new file with mode: 0644]

diff --git a/erp24/records/UsersTelegramMessage.php b/erp24/records/UsersTelegramMessage.php
new file mode 100644 (file)
index 0000000..d000c3b
--- /dev/null
@@ -0,0 +1,62 @@
+<?php
+
+namespace yii_app\records;
+
+use Yii;
+
+/**
+ * This is the model class for table "users_telegram_message".
+ *
+ * @property int $id ID
+ * @property string $chat_id Chat ID
+ * @property string $phone Телефон
+ * @property string $message Текст сообщения в Телеграм
+ * @property string $kogort_date Дата когорты
+ * @property string $target_date Целевая дата
+ * @property int $type Номер рассылки
+ * @property string $created_at Дата создания записи
+ */
+class UsersTelegramMessage extends \yii\db\ActiveRecord
+{
+    public const TYPE_FIRST_MESSAGE = 1;
+    public const TYPE_SECOND_MESSAGE = 2;
+
+    /**
+     * {@inheritdoc}
+     */
+    public static function tableName()
+    {
+        return 'users_telegram_message';
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function rules()
+    {
+        return [
+            [['chat_id', 'phone', 'message', 'kogort_date', 'target_date'], 'required'],
+            [['kogort_date', 'target_date', 'created_at'], 'safe'],
+            [['type'], 'default', 'value' => null],
+            [['type'], 'integer'],
+            [['chat_id', 'phone', 'message'], 'string', 'max' => 255],
+        ];
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function attributeLabels()
+    {
+        return [
+            'id' => 'ID',
+            'chat_id' => 'Chat ID',
+            'phone' => 'Телефон',
+            'message' => 'Текст сообщения в Телеграм',
+            'kogort_date' => 'Дата когорты',
+            'target_date' => 'Целевая дата',
+            'type' => 'Номер рассылки',
+            'created_at' => 'Дата создания записи',
+        ];
+    }
+}