no message

This commit is contained in:
hellcat 2025-03-24 22:25:19 +08:00
parent 9956f1f09f
commit 4f42c4a025

View File

@ -11,6 +11,7 @@ namespace App\Controllers\TomApi\Tg;
use App\Models\Config;
use App\Models\TgStep;
use App\Models\Ticket;
//use GuzzleHttp\Psr7\ServerRequest;
//use GuzzleHttp\Psr7\Utils;
//use Psr\Http\Message\ResponseInterface;
@ -133,11 +134,37 @@ final class HookController
}
if (strpos($sText, '/ticket_find') === 0) {
$iTicketId = $this->trimText($sText, '/ticket_find');
$aTicket = Ticket::where("id", $iTicketId)->first()->toArray();
$sMsg = "title$aTicket['title']\n";
foreach ($aTicket as $row) {
$sMsg .= "\n";
$sMsg .= "name$row['commenter_name']\n";
$sMsg .= "comment$row['comment']\n";
}
$this->sendMessage($sMsg);
Http::response(200, 'ok');
}
Http::response(200, '无');
}
public function sendMessage($sText) {
private function trimText($sText, $sTrim)
{
$sText = ltrim($sText, $sTrim);
$sText = trim($sText);
}
private function sendMessage($sText) {
if ($_ENV['is_loc'] === true) {
var_dump($sText);