diff --git a/public/tests/hook.php b/public/tests/hook.php index c408fbe7..d49842b6 100644 --- a/public/tests/hook.php +++ b/public/tests/hook.php @@ -91,6 +91,8 @@ $oHttp->aData['message']['text'] = '\/user#limit 10'; $oHttp->aData['message']['text'] = '/mail#tmp'; +$oHttp->aData['message']['text'] = '/buchang#buchang 2'; + //$oHttp->aData['message']['text'] = '\/coupon#findById 3'; diff --git a/src/Services/Tg/Hook/Mod/Buchang.php b/src/Services/Tg/Hook/Mod/Buchang.php new file mode 100644 index 00000000..32fb2a74 --- /dev/null +++ b/src/Services/Tg/Hook/Mod/Buchang.php @@ -0,0 +1,62 @@ +=", $sType)->get(); + $oUser = User::where("email", "yuejiqi@tuta.io")->get(); + + $i = 0; + foreach ($oUser as $oUserRow) { + $oUserRow->transfer_enable = $oUserRow->transfer_enable + $sValue; + $oUserRow->save(); + $i++; + } + + return "影响".$i."个用户"; + + } + + + + + + public function Find($aParam) + { + +// list($sCmd, $sCode) = explode(" ", $sText, 2); + + $sCode = $aParam['aArg'][1]; + + $aData = ModelDuck::where('code', $sCode)->first()->toArray(); + + $aData['use_width'] = Tools::flowToGB($aData['use_width']).'GB'; + $aData['max_width'] = Tools::flowToGB($aData['max_width']).'GB'; + $aData['today_width'] = Tools::flowToGB($aData['today_width']).'GB'; + + $sMsg = json_encode($aData, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT); + + return $sMsg; + + } + + +}