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']);
}
}