no message
This commit is contained in:
parent
cf9f9113b4
commit
11b2bdb036
@ -35,7 +35,7 @@ $oHttp->aData = [
|
|||||||
'type' => 'private'
|
'type' => 'private'
|
||||||
],
|
],
|
||||||
'date' => 1610000000,
|
'date' => 1610000000,
|
||||||
'text' => '222'
|
'text' => 'reply 2'
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@ -60,6 +60,9 @@ EOL;
|
|||||||
$jobs->bandwidthMerge();
|
$jobs->bandwidthMerge();
|
||||||
$jobs->resetFreeUserBandwidth();
|
$jobs->resetFreeUserBandwidth();
|
||||||
$jobs->sendDailyTrafficReport();
|
$jobs->sendDailyTrafficReport();
|
||||||
|
|
||||||
|
// 每日清除前一天残留TgStep
|
||||||
|
$jobs->clearTgStep();
|
||||||
|
|
||||||
if (Config::obtain('enable_detect_inactive_user')) {
|
if (Config::obtain('enable_detect_inactive_user')) {
|
||||||
$jobs->detectInactiveUser();
|
$jobs->detectInactiveUser();
|
||||||
|
|||||||
@ -24,6 +24,15 @@ session_start();
|
|||||||
final class TestController extends BaseController
|
final class TestController extends BaseController
|
||||||
{
|
{
|
||||||
|
|
||||||
|
public function test5 ()
|
||||||
|
{
|
||||||
|
$jobs = new CronService();
|
||||||
|
|
||||||
|
$jobs->clearTgStep();
|
||||||
|
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
public function test4 ()
|
public function test4 ()
|
||||||
{
|
{
|
||||||
// session_start();
|
// session_start();
|
||||||
|
|||||||
@ -65,6 +65,8 @@ final class HookController
|
|||||||
|
|
||||||
if ($sText === "/break") {
|
if ($sText === "/break") {
|
||||||
|
|
||||||
|
$oTgStep->clearByFromId($aData["fromId"]);
|
||||||
|
|
||||||
$this->sendMessage("ok");
|
$this->sendMessage("ok");
|
||||||
|
|
||||||
http_response_code(200);exit;
|
http_response_code(200);exit;
|
||||||
@ -72,6 +74,7 @@ final class HookController
|
|||||||
|
|
||||||
if (strpos($sText, '/reply') === 0) {
|
if (strpos($sText, '/reply') === 0) {
|
||||||
|
|
||||||
|
// 先清除一遍,只进行一个进程
|
||||||
$oTgStep->clearByFromId($aData["fromId"]);
|
$oTgStep->clearByFromId($aData["fromId"]);
|
||||||
|
|
||||||
$iTicketId = str_replace('/reply', '', $sText);
|
$iTicketId = str_replace('/reply', '', $sText);
|
||||||
@ -105,6 +108,9 @@ final class HookController
|
|||||||
|
|
||||||
$r = @json_decode($oHttp->send(), true);
|
$r = @json_decode($oHttp->send(), true);
|
||||||
|
|
||||||
|
// 不论失败成功都清除step
|
||||||
|
$oTgStep->clearByFromId($aUpdate["message"]["from"]["id"]);
|
||||||
|
|
||||||
if ($r["ret"] == 1) {
|
if ($r["ret"] == 1) {
|
||||||
$sMessage = "成功";
|
$sMessage = "成功";
|
||||||
} else {
|
} else {
|
||||||
@ -121,7 +127,7 @@ final class HookController
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Http::response(200, 'ok');
|
Http::response(200, '无');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -20,6 +20,7 @@ final class TgStep extends Model
|
|||||||
$oTgStep->cmd = $sCmd;
|
$oTgStep->cmd = $sCmd;
|
||||||
$oTgStep->step = $iStep;
|
$oTgStep->step = $iStep;
|
||||||
$oTgStep->cache = json_encode($sCache);
|
$oTgStep->cache = json_encode($sCache);
|
||||||
|
$oTgStep->date = date("Y-m-d");
|
||||||
|
|
||||||
$oTgStep->save();
|
$oTgStep->save();
|
||||||
|
|
||||||
|
|||||||
@ -16,6 +16,7 @@ use App\Models\Order;
|
|||||||
use App\Models\Paylist;
|
use App\Models\Paylist;
|
||||||
use App\Models\SubscribeLog;
|
use App\Models\SubscribeLog;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
|
use App\Models\TgStep;
|
||||||
use App\Models\Zhuanfas;
|
use App\Models\Zhuanfas;
|
||||||
use App\Models\Ducks;
|
use App\Models\Ducks;
|
||||||
use App\Services\TomTool\TgSendFormat;
|
use App\Services\TomTool\TgSendFormat;
|
||||||
@ -55,6 +56,11 @@ final class Cron
|
|||||||
|
|
||||||
echo Tools::toDateTime(time()) . ' 数据库清理完成' . PHP_EOL;
|
echo Tools::toDateTime(time()) . ' 数据库清理完成' . PHP_EOL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function clearTgStep(): void
|
||||||
|
{
|
||||||
|
TgStep::where("date", "<=", date('Y-m-d', strtotime('-1 day')))->delete();
|
||||||
|
}
|
||||||
|
|
||||||
public static function detectInactiveUser(): void
|
public static function detectInactiveUser(): void
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user