2025-01-03 02:11:09 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace app\modules\tgbot\controllers;
|
|
|
|
|
2025-01-20 00:12:30 +03:00
|
|
|
use app\modules\tgbot\models\Tgbot;
|
2025-01-23 20:02:06 +03:00
|
|
|
use kernel\app_modules\tag\service\TagService;
|
|
|
|
use kernel\modules\post\models\Post;
|
2025-01-20 00:12:30 +03:00
|
|
|
|
2025-01-03 02:11:09 +03:00
|
|
|
class TgBotRestController extends \kernel\app_modules\tgbot\controllers\TgBotRestController
|
|
|
|
{
|
|
|
|
|
2025-01-20 00:12:30 +03:00
|
|
|
public function actionGetScanBtn(int $id): void
|
|
|
|
{
|
|
|
|
$dialog = Tgbot::where("dialog_id", $id)->first();
|
2025-01-26 14:42:47 +03:00
|
|
|
$html = "";
|
2025-01-20 00:12:30 +03:00
|
|
|
if ($dialog){
|
2025-01-26 14:42:47 +03:00
|
|
|
if ($dialog->status === Tgbot::ADMIN_STATUS){
|
|
|
|
$html = '<a class="btn btn-primary" href="/miniapp/scanner">Сканировать</a>';
|
|
|
|
}
|
2025-01-20 00:12:30 +03:00
|
|
|
}
|
2025-01-26 14:42:47 +03:00
|
|
|
|
|
|
|
$this->renderApi([
|
|
|
|
'html' => $html,
|
|
|
|
]);
|
2025-01-20 00:12:30 +03:00
|
|
|
}
|
|
|
|
|
2025-01-23 20:02:06 +03:00
|
|
|
|
|
|
|
public function actionGetNews(): void
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2025-01-03 02:11:09 +03:00
|
|
|
}
|