33 lines
		
	
	
		
			745 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
		
			745 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| namespace app\modules\tgbot\controllers;
 | |
| 
 | |
| use app\modules\tgbot\models\Tgbot;
 | |
| use kernel\app_modules\tag\service\TagService;
 | |
| use kernel\modules\post\models\Post;
 | |
| 
 | |
| class TgBotRestController extends \kernel\app_modules\tgbot\controllers\TgBotRestController
 | |
| {
 | |
| 
 | |
|     public function actionGetScanBtn(int $id): void
 | |
|     {
 | |
|         $dialog = Tgbot::where("dialog_id", $id)->first();
 | |
|         $html = "";
 | |
|         if ($dialog){
 | |
|             if ($dialog->status === Tgbot::ADMIN_STATUS){
 | |
|                 $html = '<a class="btn btn-primary" href="/miniapp/scanner">Сканировать</a>';
 | |
|             }
 | |
|         }
 | |
| 
 | |
|         $this->renderApi([
 | |
|             'html' => $html,
 | |
|         ]);
 | |
|     }
 | |
| 
 | |
| 
 | |
|     public function actionGetNews(): void
 | |
|     {
 | |
| 
 | |
|     }
 | |
| 
 | |
| } |