11
This commit is contained in:
parent
11b2bdb036
commit
ea9717c009
@ -54,44 +54,11 @@ final class HookController
|
|||||||
|
|
||||||
$sText = $aUpdate["message"]["text"];
|
$sText = $aUpdate["message"]["text"];
|
||||||
|
|
||||||
if ($sText === "/test") {
|
// 先检查step
|
||||||
|
|
||||||
$serverTime = date("Y-m-d H:i:s");
|
|
||||||
|
|
||||||
$this->sendMessage("服务器时间: " . $serverTime);
|
|
||||||
|
|
||||||
http_response_code(200);exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($sText === "/break") {
|
|
||||||
|
|
||||||
$oTgStep->clearByFromId($aData["fromId"]);
|
|
||||||
|
|
||||||
$this->sendMessage("ok");
|
|
||||||
|
|
||||||
http_response_code(200);exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (strpos($sText, '/reply') === 0) {
|
|
||||||
|
|
||||||
// 先清除一遍,只进行一个进程
|
|
||||||
$oTgStep->clearByFromId($aData["fromId"]);
|
|
||||||
|
|
||||||
$iTicketId = str_replace('/reply', '', $sText);
|
|
||||||
$iTicketId = (int) trim($iTicketId);
|
|
||||||
|
|
||||||
$oTgStep->add($aData['fromId'], 'reply', 1, ["ticketId" => $iTicketId]);
|
|
||||||
|
|
||||||
$sMessage = "将回复工单【".$iTicketId."】,请输入回复内容。";
|
|
||||||
|
|
||||||
$this->sendMessage($sMessage);
|
|
||||||
|
|
||||||
Http::response(200, 'ok');
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($oTgStep->fromIdHit($aData['fromId'])) {
|
if ($oTgStep->fromIdHit($aData['fromId'])) {
|
||||||
|
|
||||||
|
$sText = ltrim($sText, '/');
|
||||||
|
|
||||||
$aTgStepFirst = $oTgStep->find($aData["fromId"]);
|
$aTgStepFirst = $oTgStep->find($aData["fromId"]);
|
||||||
|
|
||||||
if ($aTgStepFirst["cmd"] == "reply") {
|
if ($aTgStepFirst["cmd"] == "reply") {
|
||||||
@ -127,6 +94,43 @@ final class HookController
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 命令
|
||||||
|
if ($sText === "/test") {
|
||||||
|
|
||||||
|
$serverTime = date("Y-m-d H:i:s");
|
||||||
|
|
||||||
|
$this->sendMessage("服务器时间: " . $serverTime);
|
||||||
|
|
||||||
|
http_response_code(200);exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($sText === "/break") {
|
||||||
|
|
||||||
|
$oTgStep->clearByFromId($aData["fromId"]);
|
||||||
|
|
||||||
|
$this->sendMessage("ok");
|
||||||
|
|
||||||
|
http_response_code(200);exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strpos($sText, '/reply') === 0) {
|
||||||
|
|
||||||
|
// 先清除一遍,只进行一个进程
|
||||||
|
$oTgStep->clearByFromId($aData["fromId"]);
|
||||||
|
|
||||||
|
$iTicketId = str_replace('/reply', '', $sText);
|
||||||
|
$iTicketId = (int) trim($iTicketId);
|
||||||
|
|
||||||
|
$oTgStep->add($aData['fromId'], 'reply', 1, ["ticketId" => $iTicketId]);
|
||||||
|
|
||||||
|
$sMessage = "将回复工单【".$iTicketId."】,请输入回复内容。";
|
||||||
|
|
||||||
|
$this->sendMessage($sMessage);
|
||||||
|
|
||||||
|
Http::response(200, 'ok');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
Http::response(200, '无');
|
Http::response(200, '无');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user