card action

This commit is contained in:
2025-01-26 14:42:47 +03:00
parent 08cdf44b67
commit 824130df26
27 changed files with 430 additions and 53 deletions

View File

@ -12,11 +12,16 @@ class TgBotRestController extends \kernel\app_modules\tgbot\controllers\TgBotRes
public function actionGetScanBtn(int $id): void
{
$dialog = Tgbot::where("dialog_id", $id)->first();
$html = "";
if ($dialog){
$this->renderApi([
'html' => '<a class="btn btn-primary" href="/miniapp/scanner">Сканировать</a>',
]);
if ($dialog->status === Tgbot::ADMIN_STATUS){
$html = '<a class="btn btn-primary" href="/miniapp/scanner">Сканировать</a>';
}
}
$this->renderApi([
'html' => $html,
]);
}