mirror of
https://github.com/v2board/v2board.git
synced 2024-11-10 09:39:10 +08:00
update: package limit
This commit is contained in:
parent
b0687b9dfd
commit
1c644e8c5f
@ -85,7 +85,7 @@ class OrderController extends Controller
|
||||
abort(500, __('Subscription plan does not exist'));
|
||||
}
|
||||
|
||||
if (!$planService->haveCapacity()) {
|
||||
if (!$planService->haveCapacity() && $request->input('period') !== 'reset_price') {
|
||||
abort(500, __('Current product is sold out'));
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,8 @@ class PlanService
|
||||
public function haveCapacity(): bool
|
||||
{
|
||||
if ($this->plan->capacity_limit === NULL) return true;
|
||||
$count = User::where('plan_id', $this->plan->plan_id)->count();
|
||||
$count = self::countActiveUsers();
|
||||
$count = $count[$this->plan->plan_id];
|
||||
return ($this->plan->capacity_limit - $count) > 0;
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,6 @@ class UserService
|
||||
{
|
||||
if ($user->expired_at <= time() || $user->expired_at === NULL) return null;
|
||||
// if reset method is not reset
|
||||
if (!isset($user->plan->reset_traffic_method)) return null;
|
||||
if ($user->plan->reset_traffic_method === 2) return null;
|
||||
switch (true) {
|
||||
case ($user->plan->reset_traffic_method === NULL): {
|
||||
|
12
public/theme/v2board/assets/i18n/en-US.js
vendored
12
public/theme/v2board/assets/i18n/en-US.js
vendored
@ -147,7 +147,7 @@ window.settings.i18n['en-US'] = {
|
||||
'重置订阅信息': 'Reset Subscription',
|
||||
'没有可用节点,如果您未订阅或已过期请': 'No access points are available. If you have not subscribed or the subscription has expired, please',
|
||||
'订阅': 'Subscribe',
|
||||
'确定重置当前已用流量?': '确定重置当前已用流量?',
|
||||
'确定重置当前已用流量?': 'Are you sure to reset your current data usage?',
|
||||
'点击「确定」将会跳转到收银台,支付订单后系统将会清空您当月已使用流量。': 'Click "Confirm" and you will be redirected to the payment page. The system will empty your current month\'s usage after your purchase.',
|
||||
'确定': 'Confirm',
|
||||
'确定要重置订阅信息?': 'Are you sure to reset your subscription?',
|
||||
@ -231,11 +231,11 @@ window.settings.i18n['en-US'] = {
|
||||
'余额支付': 'Balance payment',
|
||||
'我的工单': 'My Tickets',
|
||||
'工单历史': 'Ticket History',
|
||||
'已用流量将在 {reset_day} 日后重置': '已用流量将在 {reset_day} 日后重置',
|
||||
'已用流量已在今日重置': '已用流量已在今日重置',
|
||||
'重置当前已用流量': '重置当前已用流量',
|
||||
'查看节点状态': '查看节点状态',
|
||||
'当前已使用流量达{rate}%': '当前已使用流量达{rate}%',
|
||||
'已用流量将在 {reset_day} 日后重置': 'Used data will reset after {reset_day} days',
|
||||
'已用流量已在今日重置': 'Data usage has been reset today',
|
||||
'重置当前已用流量': 'Reset current usage',
|
||||
'查看节点状态': 'View Access Point status',
|
||||
'当前已使用流量达{rate}%': 'Currently used data up to {rate}%',
|
||||
'节点名称': 'Access Point Name',
|
||||
'于 {date} 到期,距离到期还有 {day} 天。': 'Will expire on {date}, {day} days before expiration, ',
|
||||
'Telegram 讨论组': 'Telegram Discussion Group',
|
||||
|
2
public/theme/v2board/assets/i18n/zh-CN.js
vendored
2
public/theme/v2board/assets/i18n/zh-CN.js
vendored
@ -235,7 +235,7 @@ window.settings.i18n['zh-CN'] = {
|
||||
'已用流量已在今日重置': '已用流量已在今日重置',
|
||||
'重置当前已用流量': '重置当前已用流量',
|
||||
'查看节点状态': '查看节点状态',
|
||||
'当前已使用流量达{rate}%': '当前已使用流量达{rate}%',
|
||||
'当前已使用流量达{rate}%': '当前已使用流量达 {rate}%',
|
||||
'节点名称': '节点名称',
|
||||
'于 {date} 到期,距离到期还有 {day} 天。': '于 {date} 到期,距离到期还有 {day} 天。',
|
||||
'Telegram 讨论组': 'Telegram 讨论组',
|
||||
|
10
public/theme/v2board/assets/i18n/zh-TW.js
vendored
10
public/theme/v2board/assets/i18n/zh-TW.js
vendored
@ -147,7 +147,7 @@ window.settings.i18n['zh-TW'] = {
|
||||
'重置订阅信息': '重置訂閲資訊',
|
||||
'没有可用节点,如果您未订阅或已过期请': '沒有可用節點,如果您未訂閱或已過期請',
|
||||
'订阅': '訂閱',
|
||||
'确定重置当前已用流量?': '确定重置当前已用流量?',
|
||||
'确定重置当前已用流量?': '確定重置當前已用流量?',
|
||||
'点击「确定」将会跳转到收银台,支付订单后系统将会清空您当月已使用流量。': '點擊「確定」將會跳轉到收銀台,支付訂單後系統將會清空您當月已使用流量。',
|
||||
'确定': '確定',
|
||||
'确定要重置订阅信息?': '確定要重置訂閱資訊?',
|
||||
@ -231,11 +231,11 @@ window.settings.i18n['zh-TW'] = {
|
||||
'余额支付': '餘額支付',
|
||||
'我的工单': '我的工單',
|
||||
'工单历史': '工單歷史',
|
||||
'已用流量将在 {reset_day} 日后重置': '已用流量将在 {reset_day} 日后重置',
|
||||
'已用流量将在 {reset_day} 日后重置': '已用流量將在 {reset_day} 日后重置',
|
||||
'已用流量已在今日重置': '已用流量已在今日重置',
|
||||
'重置当前已用流量': '重置当前已用流量',
|
||||
'查看节点状态': '查看节点状态',
|
||||
'当前已使用流量达{rate}%': '当前已使用流量达{rate}%',
|
||||
'重置当前已用流量': '重置當前已用流量',
|
||||
'查看节点状态': '查看節點狀態',
|
||||
'当前已使用流量达{rate}%': '當前已用流量達 {rate}%',
|
||||
'节点名称': '節點名稱',
|
||||
'于 {date} 到期,距离到期还有 {day} 天。': '於 {date} 到期,距離到期還有 {day} 天。',
|
||||
'Telegram 讨论组': 'Telegram 討論組',
|
||||
|
2
public/theme/v2board/assets/umi.js
vendored
2
public/theme/v2board/assets/umi.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user