diff --git a/src/Services/Gateway/Epay.php b/src/Services/Gateway/Epay.php index 834b5fe7..8a131d04 100755 --- a/src/Services/Gateway/Epay.php +++ b/src/Services/Gateway/Epay.php @@ -27,6 +27,9 @@ use voku\helper\AntiXSS; use function json_decode; use function trim; +use Telegram\Bot\Exceptions\TelegramSDKException; +use App\Services\IM\Telegram; + final class Epay extends Base { protected array $epay = []; @@ -126,17 +129,19 @@ final class Epay extends Base 'msg' => '订单发起成功,正在跳转到支付页面...', ]); } catch (Exception|GuzzleException $e) { - if ($user["is_admin"] == 1) { +// if ($user["is_admin"] == 1) { +// return $response->withJson([ +// 'ret' => 0, +// 'msg' => json_encode($e->getMessage()), +// ]); +// } else { return $response->withJson([ 'ret' => 0, - 'msg' => json_encode($e->getMessage()), + 'msg' => '请求支付失败,请联系管理员', ]); - } else { - return $response->withJson([ - 'ret' => 0, - 'msg' => '请求支付失败', - ]); - } + + (new Telegram())->send(0, $e->getMessage()); +// } } } diff --git a/src/Services/Tg/Hook/Mod/Node.php b/src/Services/Tg/Hook/Mod/Node.php index f7c9e1e0..41047142 100644 --- a/src/Services/Tg/Hook/Mod/Node.php +++ b/src/Services/Tg/Hook/Mod/Node.php @@ -199,4 +199,16 @@ class Node extends Base } + public function SetRateAll($aParam) + { + + $iRate = $aParam['aArg'][1]; + + $r = ModelNode::query()->update(['traffic_rate' => $iRate]); + + return $r; + + } + + } diff --git a/src/Services/Tg/Hook/Mod/User.php b/src/Services/Tg/Hook/Mod/User.php index 83bc7f13..d025448b 100644 --- a/src/Services/Tg/Hook/Mod/User.php +++ b/src/Services/Tg/Hook/Mod/User.php @@ -91,7 +91,7 @@ final class User $r = (new ServiceCountUser())->RegByDate($sOption2, $sOption3); } - $sTop = "\n\n---------------------------"; + $sTop = "\n\n--注册统计--------------------"; $sMsg = ''; $iTotalCount = 0; foreach ($r as $row) { diff --git a/src/Services/Tg/Hook/Mod/Visitor.php b/src/Services/Tg/Hook/Mod/Visitor.php index 746edfc7..e16b4c85 100644 --- a/src/Services/Tg/Hook/Mod/Visitor.php +++ b/src/Services/Tg/Hook/Mod/Visitor.php @@ -18,7 +18,7 @@ final class Visitor ->get() ->toArray(); - $sPre = "\n\n---------------------------"; + $sPre = "\n\n--访客统计--------------------"; $sMsg = ''; $iTotalCount = 0;