HEX
Server: Apache
System: Linux server3230.server-vps.com 5.15.0-46-generic #49-Ubuntu SMP Thu Aug 4 18:03:25 UTC 2022 x86_64
User: lzgqnjwu (1002)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: //proc/1122/cwd/common/models/BotPushLog.php
<?php

namespace common\models;

use Yii;
use yii\db\ActiveRecord;

/**
 * @property int $id
 * @property int $bot_id
 * @property string|null $chat_id
 * @property string|null $phone
 * @property string|null $payload_json
 * @property string $status delivered|not_delivered
 * @property string|null $fail_reason
 * @property string|null $fail_detail
 * @property int|null $telegram_message_id
 * @property string $created_at
 *
 * @property Bot $bot
 */
class BotPushLog extends ActiveRecord
{
    public const STATUS_DELIVERED = 'delivered';
    public const STATUS_NOT_DELIVERED = 'not_delivered';

    public static function tableName()
    {
        return '{{%bot_push_logs}}';
    }

    public function rules()
    {
        return [
            [['bot_id', 'status', 'created_at'], 'required'],
            [['bot_id', 'telegram_message_id'], 'integer'],
            [['payload_json'], 'string'],
            [['created_at'], 'safe'],
            [['chat_id'], 'string', 'max' => 64],
            [['phone'], 'string', 'max' => 32],
            [['status'], 'string', 'max' => 20],
            [['fail_reason'], 'string', 'max' => 64],
            [['fail_detail'], 'string', 'max' => 255],
        ];
    }

    public function getBot()
    {
        return $this->hasOne(Bot::class, ['id' => 'bot_id']);
    }
}