no message
This commit is contained in:
parent
e26aeb80ad
commit
eeb0874787
@ -554,6 +554,7 @@
|
|||||||
<button type="button" class="btn btn-sub btn-pill btn-trojan copy-text round {if $user->class < 1}disabled{/if}" data-clipboard-text="{$UniversalSub}/trojan"><i class="cool-ssr text-white"></i> 复制 Trojan 订阅 </button>
|
<button type="button" class="btn btn-sub btn-pill btn-trojan copy-text round {if $user->class < 1}disabled{/if}" data-clipboard-text="{$UniversalSub}/trojan"><i class="cool-ssr text-white"></i> 复制 Trojan 订阅 </button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- btn-surge btn-kitsunebi 这两个颜色很好看 -->
|
||||||
|
|
||||||
<!-- surge -->
|
<!-- surge -->
|
||||||
<!-- 与clash和singbox都不通用,先放着
|
<!-- 与clash和singbox都不通用,先放着
|
||||||
|
|||||||
@ -72,6 +72,43 @@ class User extends Base {
|
|||||||
return $this->_moneyUpDown($aParam);
|
return $this->_moneyUpDown($aParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function toFree($aParam)
|
||||||
|
{
|
||||||
|
// $iId = $aParam["aArg"][1] ?? false;
|
||||||
|
$sEmail = $aParam["aArg"][1] ?? false;
|
||||||
|
$sConfirm = $aParam["aOption"][1] ?? 'n';
|
||||||
|
$iFreeClass = $_ENV['user_freeClass'];
|
||||||
|
$iFreeDay = 2;
|
||||||
|
$iFreeWidth = 2;
|
||||||
|
|
||||||
|
if ($aParam["aArg"][1] == "?") {
|
||||||
|
return "#toFree__[yn] [email]";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$sEmail) {
|
||||||
|
return "需要email";
|
||||||
|
}
|
||||||
|
|
||||||
|
$oUser = ModelUser::where("email", $sEmail)->first();
|
||||||
|
|
||||||
|
if ($sConfirm == "n") {
|
||||||
|
$sMsg = "给这个用户".$iFreeDay."天的".$iFreeClass."等级,和".$iFreeWidth."g流量,确认y。\n\n";
|
||||||
|
$sMsg .= $this->toJson($oUser);
|
||||||
|
return $sMsg;
|
||||||
|
} else if ($sConfirm == "y") {
|
||||||
|
$oUser->class = $iFreeClass;
|
||||||
|
$oUser->transfer_enable = $iFreeWidth * 1073741824;
|
||||||
|
$oUser->class_expire = date('Y-m-d H:i:s', strtotime("+$iFreeDay days"));
|
||||||
|
$oUser->save();
|
||||||
|
|
||||||
|
$aParam = [];
|
||||||
|
$aParam["aArg"][1] = $oUser->id;
|
||||||
|
|
||||||
|
return $this->find($aParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private function _moneyUpDown($aParam)
|
private function _moneyUpDown($aParam)
|
||||||
{
|
{
|
||||||
$sKey = $aParam["aOption"][1] ?? false;
|
$sKey = $aParam["aOption"][1] ?? false;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user