no message
This commit is contained in:
parent
2a49473b15
commit
8e513695c5
@ -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';
|
||||
|
||||
|
||||
|
||||
62
src/Services/Tg/Hook/Mod/Buchang.php
Normal file
62
src/Services/Tg/Hook/Mod/Buchang.php
Normal file
@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
//declare(strict_types=1);
|
||||
|
||||
namespace App\Services\Tg\Hook\Mod;
|
||||
|
||||
use App\Models\User;
|
||||
use App\Utils\Tools;
|
||||
|
||||
final class Buchang
|
||||
{
|
||||
|
||||
public function buchang($aParam)
|
||||
{
|
||||
$sType = $aParam["aOption"][1] ?? 1;
|
||||
$sValue = $aParam["aArg"][1] ?? false;
|
||||
|
||||
if (!$sValue) {
|
||||
return "需要value";
|
||||
}
|
||||
|
||||
$sValue = Tools::toGB($sValue);
|
||||
|
||||
// $oUser = User::where("class", ">=", $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;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user