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 integer $user_id
 | ||
|  * @property string $username
 | ||
|  * @property string $first_name
 | ||
|  * @property string $last_name
 | ||
|  * @property integer $status
 | ||
|  */
 | ||
| class Tgbot extends Model
 | ||
| {
 | ||
|     const DISABLE_STATUS = 0;
 | ||
|     const ACTIVE_STATUS = 1;
 | ||
|     const ADMIN_STATUS = 9;
 | ||
| 
 | ||
|     protected $table = 'tgbot';
 | ||
| 
 | ||
|     protected $fillable = ['bot_id', 'dialog_id', 'user_id', 'username', 'first_name', 'last_name', 'status'];
 | ||
| 
 | ||
|     public static function labels(): array
 | ||
|     {
 | ||
|         return [
 | ||
|             'bot_id' => 'Bot ID',
 | ||
|             'dialog_id' => 'Dialog ID',
 | ||
|             'user_id' => 'User ID',
 | ||
|             'username' => 'Username',
 | ||
|             'first_name' => 'First name',
 | ||
|             'last_name' => 'Last name',
 | ||
|             'status' => 'Статус',
 | ||
|         ];
 | ||
|     }
 | ||
| 
 | ||
|     /**
 | ||
|      * @return string[]
 | ||
|      */
 | ||
|     public static function getStatus(): array
 | ||
|     {
 | ||
|         return [
 | ||
|             self::DISABLE_STATUS => "Не активный",
 | ||
|             self::ACTIVE_STATUS => "Активный",
 | ||
|             self::ADMIN_STATUS => "Админ",
 | ||
|         ];
 | ||
|     }
 | ||
| 
 | ||
| 
 | ||
| } |