la_bot_back/app/modules/tgbot/controllers/TgBotRestController.php
2025-01-26 14:42:47 +03:00

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
{
}
}