53 lines
1.2 KiB
PHP
53 lines
1.2 KiB
PHP
<?php
|
||
|
||
namespace kernel\app_modules\tgbot\models;
|
||
|
||
use Illuminate\Database\Eloquent\Model;
|
||
|
||
/**
|
||
* @property integer $id
|
||
* @property integer $bot_id
|
||
* @property integer $dialog_id
|
||
* @property string $to_group
|
||
* @property string $content
|
||
* @property string $photo
|
||
* @property integer $status
|
||
*/
|
||
class TgbotNotification extends Model
|
||
{
|
||
|
||
const DISABLE_STATUS = 0;
|
||
const NEW_STATUS = 1;
|
||
const TO_SEND_STATUS = 2;
|
||
const SENT_STATUS = 3;
|
||
|
||
protected $table = 'tgbot_notification';
|
||
|
||
protected $fillable = ['bot_id', 'dialog_id', 'to_group', 'content', 'photo', 'status'];
|
||
|
||
public static function labels(): array
|
||
{
|
||
return [
|
||
'bot_id' => 'Bot ID',
|
||
'dialog_id' => 'Dialog ID',
|
||
'to_group' => 'Group',
|
||
'content' => 'Контент',
|
||
'photo' => 'Фото',
|
||
'status' => 'Статус',
|
||
];
|
||
}
|
||
|
||
/**
|
||
* @return string[]
|
||
*/
|
||
public static function getStatus(): array
|
||
{
|
||
return [
|
||
self::DISABLE_STATUS => "Не активный",
|
||
self::NEW_STATUS => "Новое",
|
||
self::TO_SEND_STATUS => "На отправку",
|
||
self::SENT_STATUS => "Отправлено",
|
||
];
|
||
}
|
||
|
||
} |