Browse Source

修复提现bug、注册页自定义logo

bingo 7 năm trước cách đây
mục cha
commit
2c669a1622

+ 1 - 1
app/Console/Commands/AutoJob.php

@@ -154,7 +154,7 @@ class AutoJob extends Command
                         User::query()->where('id', $user->id)->update(['enable' => 0, 'ban_time' => strtotime(date('Y-m-d H:i:s', strtotime("+" . self::$config['traffic_ban_time'] . " minutes")))]);
 
                         // 写入日志
-                        $this->addUserBanLog($user->id, self::$config['traffic_ban_time'], '【临时封禁代理】-24小时内流量异常');
+                        $this->addUserBanLog($user->id, self::$config['traffic_ban_time'], '【临时封禁代理】-1小时内流量异常');
                     }
                 }
             }

+ 6 - 6
app/Http/Controllers/AdminController.php

@@ -49,12 +49,12 @@ class AdminController extends Controller
         $view['activeUserCount'] = User::query()->where('t', '>=', $past)->count(); // 活跃用户数
         $view['unActiveUserCount'] = User::query()->where('t', '<=', $past)->where('enable', 1)->where('t', '>', 0)->count(); // 不活跃用户数
         $view['onlineUserCount'] = User::query()->where('t', '>=', time() - 600)->count(); // 10分钟内在线用户数
-        $view['expireWarningUserCount'] = User::query()->where('expire_time', '<=', date('Y-m-d', strtotime("+" . $this->systemConfig['expire_days'] . " days")))->whereIn('status', [0, 1])->where('enable', 1)->count(); // 临近过期用户数
+        $view['expireWarningUserCount'] = User::query()->where('expire_time', '<', date('Y-m-d', strtotime("+" . $this->systemConfig['expire_days'] . " days")))->whereIn('status', [0, 1])->where('enable', 1)->count(); // 临近过期用户数
         $view['largeTrafficUserCount'] = User::query()->whereRaw('(u + d) >= 107374182400')->whereIn('status', [0, 1])->count(); // 流量超过100G的用户
 
-        // 24小时内流量异常用户
+        // 1小时内流量异常用户
         $tempUsers = [];
-        $userTotalTrafficList = UserTrafficHourly::query()->where('node_id', 0)->where('total', '>', 104857600)->where('created_at', '>=', date('Y-m-d H:i:s', time() - 24 * 60 * 60))->groupBy('user_id')->selectRaw("user_id, sum(total) as totalTraffic")->get(); // 只统计100M以上的记录,加快速度
+        $userTotalTrafficList = UserTrafficHourly::query()->where('node_id', 0)->where('total', '>', 104857600)->where('created_at', '>=', date('Y-m-d H:i:s', time() - 3900))->groupBy('user_id')->selectRaw("user_id, sum(total) as totalTraffic")->get(); // 只统计100M以上的记录,加快速度
         if (!$userTotalTrafficList->isEmpty()) {
             foreach ($userTotalTrafficList as $vo) {
                 if ($vo->totalTraffic > ($this->systemConfig['traffic_ban_value'] * 1024 * 1024 * 1024)) {
@@ -145,10 +145,10 @@ class AdminController extends Controller
             $query->where('t', '>', 0)->where('t', '<=', strtotime(date('Y-m-d', strtotime("-" . $this->systemConfig['expire_days'] . " days"))))->where('enable', 1);
         }
 
-        // 24小时内流量异常用户
+        // 1小时内流量异常用户
         if ($flowAbnormal) {
             $tempUsers = [];
-            $userTotalTrafficList = UserTrafficHourly::query()->where('node_id', 0)->where('total', '>', 104857600)->where('created_at', '>=', date('Y-m-d H:i:s', time() - 24 * 60 * 60))->groupBy('user_id')->selectRaw("user_id, sum(total) as totalTraffic")->get(); // 只统计100M以上的记录,加快速度
+            $userTotalTrafficList = UserTrafficHourly::query()->where('node_id', 0)->where('total', '>', 104857600)->where('created_at', '>=', date('Y-m-d H:i:s', time() - 3900))->groupBy('user_id')->selectRaw("user_id, sum(total) as totalTraffic")->get(); // 只统计100M以上的记录,加快速度
             if (!$userTotalTrafficList->isEmpty()) {
                 foreach ($userTotalTrafficList as $vo) {
                     if ($vo->totalTraffic > ($this->systemConfig['traffic_ban_value'] * 1024 * 1024 * 1024)) {
@@ -166,7 +166,7 @@ class AdminController extends Controller
             $user->expireWarning = $user->expire_time <= date('Y-m-d', strtotime("+ 30 days")) ? 1 : 0; // 临近过期提醒
 
             // 流量异常警告
-            $time = date('Y-m-d H:i:s', time() - 24 * 60 * 60);
+            $time = date('Y-m-d H:i:s', time() - 3900);
             $totalTraffic = UserTrafficHourly::query()->where('user_id', $user->id)->where('node_id', 0)->where('created_at', '>=', $time)->sum('total');
             $user->trafficWarning = $totalTraffic > ($this->systemConfig['traffic_ban_value'] * 1024 * 1024 * 1024) ? 1 : 0;
         }

+ 2 - 1
app/Http/Controllers/UserController.php

@@ -1136,7 +1136,8 @@ class UserController extends Controller
 
         // 校验可以提现金额是否超过系统设置的阀值
         $ref_amount = ReferralLog::query()->where('ref_user_id', $user['id'])->where('status', 0)->sum('ref_amount');
-        if ($ref_amount / 100 < $this->systemConfig['referral_money']) {
+        $ref_amount = $ref_amount / 100;
+        if ($ref_amount < $this->systemConfig['referral_money']) {
             return Response::json(['status' => 'fail', 'data' => '', 'message' => '申请失败:满' . $this->systemConfig['referral_money'] . '元才可以提现,继续努力吧']);
         }
 

+ 2 - 2
resources/views/admin/system.blade.php

@@ -740,7 +740,7 @@
                                                                     <img src="/assets/images/noimage.png" alt="" />
                                                                 @endif
                                                             </div>
-                                                            <span class="help-block"> 推荐尺寸:270 X 48,透明背景 </span>
+                                                            <span class="help-block"> 推荐尺寸:300 X 90,透明背景 </span>
                                                             <div class="fileinput-preview fileinput-exists thumbnail" style="max-width: 200px; max-height: 150px;"> </div>
                                                             <div>
                                                                 <span class="btn default btn-file">
@@ -764,7 +764,7 @@
                                                                     <img src="/assets/images/noimage.png" alt="" />
                                                                 @endif
                                                             </div>
-                                                            <span class="help-block"> 推荐尺寸:110 X 20,透明背景 </span>
+                                                            <span class="help-block"> 推荐尺寸:150 X 30,透明背景 </span>
                                                             <div class="fileinput-preview fileinput-exists thumbnail" style="max-width: 200px; max-height: 150px;"> </div>
                                                             <div>
                                                                 <span class="btn default btn-file">

+ 1 - 1
resources/views/login.blade.php

@@ -33,7 +33,7 @@
 <!-- BEGIN LOGO -->
 <div class="logo">
     @if($website_home_logo)
-        <a href="javascript:;"> <img src="{{$website_home_logo}}" alt="" style="width:270px; height:48px;"/> </a>
+        <a href="javascript:;"> <img src="{{$website_home_logo}}" alt="" style="width:300px; height:90px;"/> </a>
     @else
         <a href="javascript:;"> <img src="/assets/images/home_logo.png" alt="" /> </a>
     @endif

+ 5 - 1
resources/views/register.blade.php

@@ -32,7 +32,11 @@
 <body class=" login">
 <!-- BEGIN LOGO -->
 <div class="logo">
-    <a href="javascript:;"> <img src="/assets/images/home_logo.png" alt="" /> </a>
+    @if($website_home_logo)
+        <a href="javascript:;"> <img src="{{$website_home_logo}}" alt="" style="width:300px; height:90px;"/> </a>
+    @else
+        <a href="javascript:;"> <img src="/assets/images/home_logo.png" alt="" /> </a>
+    @endif
 </div>
 <!-- END LOGO -->
 <!-- BEGIN LOGIN -->

+ 1 - 1
resources/views/user/layouts.blade.php

@@ -41,7 +41,7 @@
         <!-- BEGIN LOGO -->
         <div class="page-logo">
             @if($website_logo)
-                <a href="{{url('/')}}"><img src="{{$website_logo}}" alt="logo" class="logo-default" style="width:110px; height:20px;"/> </a>
+                <a href="{{url('/')}}"><img src="{{$website_logo}}" alt="logo" class="logo-default" style="width:150px; height:30px;"/> </a>
             @else
                 <a href="{{url('/')}}"><img src="/assets/images/logo.png" alt="logo" class="logo-default" /> </a>
             @endif

+ 5 - 1
resources/views/user/referral.blade.php

@@ -175,7 +175,11 @@
         // 申请提现
         function extractMoney() {
             $.post("{{url('extractMoney')}}", {_token:'{{csrf_token()}}'}, function (ret) {
-                layer.msg(ret.message, {time:1000});
+                layer.msg(ret.message, {time: 1000}, function () {
+                    if (ret.status == 'success') {
+                        window.location.reload();
+                    }
+                });
             });
         }
     </script>