Bladeren bron

代码优化

bingo 7 jaren geleden
bovenliggende
commit
e9f494c954

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

@@ -2191,7 +2191,7 @@ EOF;
     {
         $username = trim($request->get('username'));
         $ref_username = trim($request->get('ref_username'));
-		$status = $request->get('status');
+        $status = $request->get('status');
 
         $query = ReferralLog::query()->with(['user', 'order'])->orderBy('id', 'desc')->orderBy('status', 'asc');
 
@@ -2206,8 +2206,8 @@ EOF;
                 $q->where('username', 'like', '%' . $ref_username . '%');
             });
         }
-		
-		if ($status != '') {
+
+        if ($status != '') {
             $query->where('status', intval($status));
         }
 

+ 4 - 2
app/Http/Controllers/Api/PingController.php

@@ -16,6 +16,7 @@ class PingController extends Controller
         $timeout = $request->input('timeout', 0.5);
 
         if (empty($host)) {
+            echo "<pre>";
             echo "使用方法:";
             echo "<br>";
             echo "GET /api/ping?host=www.baidu.com&port=80&transport=tcp&timeout=0.5";
@@ -29,6 +30,7 @@ class PingController extends Controller
             echo "timeout:检测超时,单位秒,可不传,默认0.5秒,建议不超过3秒";
             echo "<br>";
             echo "成功返回:1,失败返回:0";
+            echo "</pre>";
             exit();
         }
 
@@ -55,11 +57,11 @@ class PingController extends Controller
 
             fclose($fp);
 
-            return $ret;
+            return response()->json(['status' => $ret]);
         } catch (\Exception $e) {
             Log::info($e);
 
-            return 0;
+            return response()->json(['status' => 0]);
         }
     }
 }

+ 28 - 0
app/Http/Controllers/Api/YzyController.php

@@ -11,9 +11,11 @@ use App\Http\Models\Payment;
 use App\Http\Models\PaymentCallback;
 use App\Http\Models\User;
 use App\Http\Models\UserLabel;
+use App\Mail\sendUserInfo;
 use Illuminate\Http\Request;
 use Log;
 use DB;
+use Mail;
 
 /**
  * 有赞云支付消息推送接收
@@ -241,6 +243,32 @@ class YzyController extends Controller
             // 取消重复返利
             User::query()->where('id', $order->user_id)->update(['referral_uid' => 0]);
 
+            // 如果order的email值不为空
+            if ($order->email) {
+                $title = '【' . self::$systemConfig['website_name'] . '】您的账号信息';
+                $content = [
+                    'order_sn'      => $order->order_sn,
+                    'goods_name'    => $order->goods->name,
+                    'goods_traffic' => flowAutoShow($order->goods->traffic),
+                    'port'          => $order->user->port,
+                    'passwd'        => $order->user->passwd,
+                    'method'        => $order->user->method,
+                    //'protocol'       => $order->user->protocol,
+                    //'protocol_param' => $order->user->protocol_param,
+                    //'obfs'           => $order->user->obfs,
+                    //'obfs_param'     => $order->user->obfs_param,
+                    'created_at'    => $order->created_at->toDateTimeString(),
+                    'expire_at'     => $order->expire_at
+                ];
+
+                try {
+                    Mail::to($order->email)->send(new sendUserInfo(self::$systemConfig['website_name'], $content));
+                    $this->sendEmailLog($order->user_id, $title, json_encode($content));
+                } catch (\Exception $e) {
+                    $this->sendEmailLog($order->user_id, $title, json_encode($content), 0, $e->getMessage());
+                }
+            }
+
             DB::commit();
         } catch (\Exception $e) {
             DB::rollBack();

+ 5 - 7
app/Http/Controllers/PaymentController.php

@@ -133,13 +133,13 @@ class PaymentController extends Controller
 
             DB::commit();
 
-            return Response::json(['status' => 'success', 'data' => $sn, 'message' => '创建支付单成功,正在转到付款页面,请稍后']);
+            return Response::json(['status' => 'success', 'data' => $sn, 'message' => '创建单成功,正在转到付款页面,请稍后']);
         } catch (\Exception $e) {
             DB::rollBack();
 
             Log::error('创建支付订单失败:' . $e->getMessage());
 
-            return Response::json(['status' => 'fail', 'data' => '', 'message' => '创建支付单失败:' . $e->getMessage()]);
+            return Response::json(['status' => 'fail', 'data' => '', 'message' => '创建单失败:' . $e->getMessage()]);
         }
     }
 
@@ -184,13 +184,11 @@ class PaymentController extends Controller
         $user = Session::get('user');
         $payment = Payment::query()->where('sn', $sn)->where('user_id', $user['id'])->first();
         if (!$payment) {
-            return Response::json(['status' => 'fail', 'data' => '', 'message' => '支付失败']);
-        }
-
-        if ($payment->status) {
+            return Response::json(['status' => 'error', 'data' => '', 'message' => '支付失败']);
+        } elseif ($payment->status > 0) {
             return Response::json(['status' => 'success', 'data' => '', 'message' => '支付成功']);
         } elseif ($payment->status < 0) {
-            return Response::json(['status' => 'fail', 'data' => '', 'message' => '支付失败']);
+            return Response::json(['status' => 'error', 'data' => '', 'message' => '订单超时未支付,已自动关闭']);
         } else {
             return Response::json(['status' => 'fail', 'data' => '', 'message' => '等待支付']);
         }

+ 4 - 3
app/Http/Controllers/RegisterController.php

@@ -108,15 +108,16 @@ class RegisterController extends Controller
                 //必须使用邀请码
                 if (self::$systemConfig['is_invite_register'] == 2 && empty($code)) {
                     Session::flash('errorMsg', '请输入邀请码');
-					
+
                     return Redirect::back()->withInput();
                 }
+
                 // 校验邀请码合法性
-                if(!empty($code)){
+                if (!empty($code)) {
                     $codeEnable = Invite::query()->where('code', $code)->where('status', 0)->first();
                     if (empty($codeEnable)) {
                         Session::flash('errorMsg', '邀请码不可用,请更换邀请码后重试');
-						
+
                         return Redirect::back()->withInput($request->except(['code']));
                     }
                 }

+ 5 - 5
app/Http/Controllers/UserController.php

@@ -70,7 +70,7 @@ class UserController extends Controller
         $view['push_bear_qrcode'] = self::$systemConfig['push_bear_qrcode'];
         $view['articleList'] = Article::query()->where('type', 2)->where('is_del', 0)->orderBy('sort', 'desc')->orderBy('id', 'desc')->limit(10)->paginate(1);
         $view['goodsList'] = Goods::query()->where('type', 3)->where('is_del', 0)->orderBy('price', 'asc')->paginate(20);
-        
+
         // 推广返利是否可见
         if (!Session::has('referral_status')) {
             Session::put('referral_status', self::$systemConfig['referral_status']);
@@ -364,7 +364,7 @@ class UserController extends Controller
     // 商品列表
     public function goodsList(Request $request)
     {
-        $view['goodsList'] = Goods::query()->where('status', 1)->where('is_del', 0)->where('type', '<=', '2' )->orderBy('type', 'desc')->orderBy('sort', 'desc')->paginate(10)->appends($request->except('page'));
+        $view['goodsList'] = Goods::query()->where('status', 1)->where('is_del', 0)->where('type', '<=', '2')->orderBy('type', 'desc')->orderBy('sort', 'desc')->paginate(10)->appends($request->except('page'));
         $view['website_logo'] = self::$systemConfig['website_logo'];
         $view['website_analytics'] = self::$systemConfig['website_analytics'];
         $view['website_customer_service'] = self::$systemConfig['website_customer_service'];
@@ -381,7 +381,7 @@ class UserController extends Controller
         $view['website_analytics'] = self::$systemConfig['website_analytics'];
         $view['website_customer_service'] = self::$systemConfig['website_customer_service'];
 
-        $view['ticketList'] = Ticket::query()->where('user_id', $user['id'])->orderBy('created_at', 'desc')->paginate(10)->appends($request->except('page'));
+        $view['ticketList'] = Ticket::query()->where('user_id', $user['id'])->orderBy('id', 'desc')->paginate(10)->appends($request->except('page'));
 
         return Response::view('user.ticketList', $view);
     }
@@ -1132,8 +1132,8 @@ class UserController extends Controller
         $view['totalAmount'] = ReferralLog::query()->where('ref_user_id', $user['id'])->sum('ref_amount') / 100;
         $view['canAmount'] = ReferralLog::query()->where('ref_user_id', $user['id'])->where('status', 0)->sum('ref_amount') / 100;
         $view['link'] = self::$systemConfig['website_url'] . '/register?aff=' . $user['id'];
-        $view['referralLogList'] = ReferralLog::query()->where('ref_user_id', $user['id'])->with('user')->orderBy('created_at', 'desc')->paginate(10);
-        $view['referralApplyList'] = ReferralApply::query()->where('user_id', $user['id'])->with('user')->orderBy('created_at', 'desc')->paginate(10);
+        $view['referralLogList'] = ReferralLog::query()->where('ref_user_id', $user['id'])->with('user')->orderBy('id', 'desc')->paginate(10);
+        $view['referralApplyList'] = ReferralApply::query()->where('user_id', $user['id'])->with('user')->orderBy('id', 'desc')->paginate(10);
         $view['referralUserList'] = User::query()->select(['username', 'created_at'])->where('referral_uid', $user['id'])->orderBy('id', 'desc')->paginate(10);
 
         return Response::view('user.referral', $view);

+ 21 - 0
app/Http/Models/Order.php

@@ -54,4 +54,25 @@ class Order extends Model
     {
         return $this->attributes['amount'] = $value * 100;
     }
+
+    public function getStatusLabelAttribute()
+    {
+        switch ($this->attributes['status']) {
+            case -1:
+                $status_label = '已关闭';
+                break;
+            case 1:
+                $status_label = '已支付待确认';
+                break;
+            case 2:
+                $status_label = '已完成';
+                break;
+            case 0:
+            default:
+                $status_label = '待支付';
+                break;
+        }
+
+        return $status_label;
+    }
 }

+ 35 - 0
app/Http/Models/Payment.php

@@ -33,4 +33,39 @@ class Payment extends Model
     {
         return $this->attributes['amount'] = $value * 100;
     }
+
+    // 订单状态
+    public function getStatusLabelAttribute()
+    {
+        switch ($this->attributes['status']) {
+            case -1:
+                $status_label = '支付失败';
+                break;
+            case 1:
+                $status_label = '支付成功';
+                break;
+            case 0:
+            default:
+                $status_label = '等待支付';
+                break;
+        }
+
+        return $status_label;
+    }
+
+    // 支付方式
+    public function getPayWayLabelAttribute()
+    {
+        switch ($this->attributes['pay_way']) {
+            case 1:
+                $pay_way_label = '微信';
+                break;
+            case 2:
+            default:
+                $pay_way_label = '支付宝';
+                break;
+        }
+
+        return $pay_way_label;
+    }
 }

+ 1 - 1
app/Mail/activeUser.php

@@ -23,7 +23,7 @@ class activeUser extends Mailable
     public function build()
     {
         return $this->view('emails.activeUser')->subject('激活账号')->with([
-            'websiteName' => $this->websiteName,
+            'websiteName'   => $this->websiteName,
             'activeUserUrl' => $this->activeUserUrl
         ]);
     }

+ 2 - 2
app/Mail/nodeCrashWarning.php

@@ -26,8 +26,8 @@ class nodeCrashWarning extends Mailable
     {
         return $this->view('emails.nodeCrashWarning')->subject('节点宕机警告')->with([
             'websiteName' => $this->websiteName,
-            'nodeName' => $this->nodeName,
-            'nodeServer' => $this->nodeServer
+            'nodeName'    => $this->nodeName,
+            'nodeServer'  => $this->nodeServer
         ]);
     }
 }

+ 30 - 0
app/Mail/sendUserInfo.php

@@ -0,0 +1,30 @@
+<?php
+
+namespace App\Mail;
+
+use Illuminate\Bus\Queueable;
+use Illuminate\Mail\Mailable;
+use Illuminate\Queue\SerializesModels;
+use Illuminate\Contracts\Queue\ShouldQueue;
+
+class sendUserInfo extends Mailable
+{
+    use Queueable, SerializesModels;
+
+    protected $websiteName;
+    protected $content;
+
+    public function __construct($websiteName, $content)
+    {
+        $this->websiteName = $websiteName;
+        $this->content = $content;
+    }
+
+    public function build()
+    {
+        return $this->view('emails.sendUserInfo')->subject('发送账号信息')->with([
+            'websiteName' => $this->websiteName,
+            'content'     => $this->content
+        ]);
+    }
+}

+ 1 - 1
app/Mail/userExpireWarningToday.php

@@ -21,7 +21,7 @@ class userExpireWarningToday extends Mailable
     public function build()
     {
         return $this->view('emails.userExpireWarningToday')->subject('账号过期提醒')->with([
-            'websiteName'    => $this->websiteName,
+            'websiteName' => $this->websiteName,
         ]);
     }
 }

+ 15 - 9
resources/views/admin/addArticle.blade.php

@@ -29,19 +29,25 @@
                         <form action="{{url('admin/addArticle')}}" method="post" enctype="multipart/form-data" class="form-horizontal" onsubmit="return do_submit();">
                             <div class="form-body">
                                 <div class="form-group">
-                                    <label class="control-label col-md-1">标题</label>
+                                    <label for="type" class="control-label col-md-1">类型</label>
                                     <div class="col-md-6">
-                                        <input type="text" class="form-control" name="title" id="title" placeholder="" autofocus required>
-                                        <input type="hidden" name="_token" value="{{csrf_token()}}">
+                                        <div class="mt-radio-inline">
+                                            <label class="mt-radio">
+                                                <input type="radio" name="type" value="1" checked> 文章
+                                                <span></span>
+                                            </label>
+                                            <label class="mt-radio">
+                                                <input type="radio" name="type" value="2"> 公告
+                                                <span></span>
+                                            </label>
+                                        </div>
                                     </div>
                                 </div>
                                 <div class="form-group">
-                                    <label class="control-label col-md-1">类型</label>
+                                    <label class="control-label col-md-1">标题</label>
                                     <div class="col-md-6">
-                                        <select class="form-control" name="type" id="type">
-                                            <option value="1">文章</option>
-                                            <option value="2">公告</option>
-                                        </select>
+                                        <input type="text" class="form-control" name="title" id="title" placeholder="" autofocus required>
+                                        <input type="hidden" name="_token" value="{{csrf_token()}}">
                                     </div>
                                 </div>
                                 <div class="form-group">
@@ -103,7 +109,7 @@
         function do_submit() {
             var _token = '{{csrf_token()}}';
             var title = $('#title').val();
-            var type = $('#type').val();
+            var type = $("input:radio[name='type']:checked").val();
             var author = $('#author').val();
             var sort = $('#sort').val();
             var content = UE.getEditor('editor').getContent();

+ 15 - 9
resources/views/admin/editArticle.blade.php

@@ -29,19 +29,25 @@
                         <form action="{{url('admin/editArticle')}}" method="post" enctype="multipart/form-data" class="form-horizontal" onsubmit="return do_submit();">
                             <div class="form-body">
                                 <div class="form-group">
-                                    <label class="control-label col-md-1">标题</label>
+                                    <label for="type" class="control-label col-md-1">类型</label>
                                     <div class="col-md-6">
-                                        <input type="text" class="form-control" name="title" value="{{$article->title}}" id="title" placeholder="" autofocus required>
-                                        <input type="hidden" name="_token" value="{{csrf_token()}}">
+                                        <div class="mt-radio-inline">
+                                            <label class="mt-radio">
+                                                <input type="radio" name="type" value="1" {{$article->type == '1' ? 'checked' : ''}}> 文章
+                                                <span></span>
+                                            </label>
+                                            <label class="mt-radio">
+                                                <input type="radio" name="type" value="2" {{$article->type == '2' ? 'checked' : ''}}> 公告
+                                                <span></span>
+                                            </label>
+                                        </div>
                                     </div>
                                 </div>
                                 <div class="form-group">
-                                    <label class="control-label col-md-1">类型</label>
+                                    <label class="control-label col-md-1">标题</label>
                                     <div class="col-md-6">
-                                        <select class="form-control" name="type" id="type">
-                                            <option value="1" {{$article->type == '1' ? 'selected' : ''}}>文章</option>
-                                            <option value="2" {{$article->type == '2' ? 'selected' : ''}}>公告</option>
-                                        </select>
+                                        <input type="text" class="form-control" name="title" value="{{$article->title}}" id="title" placeholder="" autofocus required>
+                                        <input type="hidden" name="_token" value="{{csrf_token()}}">
                                     </div>
                                 </div>
                                 <div class="form-group">
@@ -104,7 +110,7 @@
             var _token = '{{csrf_token()}}';
             var id = '{{$article->id}}';
             var title = $('#title').val();
-            var type = $('#type').val();
+            var type = $("input:radio[name='type']:checked").val();
             var author = $('#author').val();
             var sort = $('#sort').val();
             var content = UE.getEditor('editor').getContent();

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

@@ -26,7 +26,7 @@
                             <div class="col-md-2 col-sm-2">
                                 <input type="text" class="col-md-4 form-control input-sm" name="ref_username" value="{{Request::get('ref_username')}}" id="ref_username" placeholder="邀请人" onkeydown="if(event.keyCode==13){do_search();}">
                             </div>
-							<div class="col-md-2 col-sm-2">
+			                <div class="col-md-2 col-sm-2">
                                 <select class="form-control input-sm" name="status" id="status" onChange="doSearch()">
                                     <option value="" @if(Request::get('status') == '')  disabled selected hidden @endif>状态</option>
                                     <option value="0" @if(Request::get('status') == '0') selected @endif>未提现</option>
@@ -110,7 +110,7 @@
         function do_search() {
             var username = $("#username").val();
             var ref_username = $("#ref_username").val();
-			var status = $("#status option:checked").val();
+	    var status = $("#status option:checked").val();
 
             window.location.href = '{{url('admin/userRebateList')}}' + '?username=' + username + '&ref_username=' + ref_username + '&status=' + status;
         }

+ 127 - 0
resources/views/emails/sendUserInfo.blade.php

@@ -0,0 +1,127 @@
+<table class="body" style="Margin:0;background:#FAFAFA;border-collapse:collapse;border-spacing:0;color:#333;font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;line-height:19px;margin:0;padding:0;text-align:left;vertical-align:top;width:100%">
+    <tbody>
+    <tr style="padding:0;text-align:left;vertical-align:top">
+        <td class="center" align="center" valign="top" style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#333;font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:19px;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word">
+            <center data-parsed="" style="min-width:580px;width:100%">
+                <table align="center" class="container no-bg float-center" style="Margin:0 auto;background:0 0;border:0;border-collapse:collapse;border-radius:3px;border-spacing:0;box-shadow:none;float:none;margin:0 auto;margin-top:20px;padding:0;text-align:center;vertical-align:top;width:580px">
+                    <tbody>
+                    <tr style="padding:0;text-align:left;vertical-align:top">
+                        <td style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#333;font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:19px;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word">
+                            <table class="row" style="border-collapse:collapse;border-spacing:0;display:table;padding:0;position:relative;text-align:left;vertical-align:top;width:100%">
+                                <tbody>
+                                <tr style="padding:0;text-align:left;vertical-align:top">
+
+                                    <th class="small-11 large-11 columns last" style="Margin:0 auto;color:#333;font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;line-height:19px;margin:0 auto;padding:0;padding-bottom:0;padding-left:8px;padding-right:16px;text-align:left;width:515.67px">
+                                        <table style="border-collapse:collapse;border-spacing:0;padding:0;text-align:left;vertical-align:top;width:100%">
+                                            <tbody>
+                                            <tr style="padding:0;text-align:left;vertical-align:top">
+                                                <th style="Margin:0;color:#333;font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;line-height:19px;margin:0;padding:0;text-align:left">
+                                                    <h3 style="Margin:0;Margin-bottom:10px;color:inherit;font-family:Helvetica,Arial,sans-serif;font-size:28px;font-weight:400;line-height:1.3;margin:0;margin-bottom:0;padding:0;text-align:left;word-wrap:normal">
+                                                        <a href="#" style="Margin:0;color:#40253b;font-family:Helvetica,Arial,sans-serif;font-weight:400;line-height:1.3;margin:0;padding:0;text-align:left;text-decoration:none" target="_blank">
+                                                            SSRPanel
+                                                        </a>
+                                                    </h3>
+                                                </th>
+                                            </tr>
+                                            </tbody>
+                                        </table>
+                                    </th>
+                                </tr>
+                                </tbody>
+                            </table>
+                        </td>
+                    </tr>
+                    </tbody>
+                </table>
+                <table align="center" class="container float-center" style="Margin:0 auto;background:#fefefe;border:1px solid #cdcdcd;border-collapse:collapse;border-radius:3px;border-spacing:0;float:none;margin:0 auto;margin-top:20px;padding:0;text-align:center;vertical-align:top;width:580px">
+                    <tbody>
+                    <tr style="padding:0;text-align:left;vertical-align:top">
+                        <td style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0;border-collapse:collapse!important;color:#333;font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:19px;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:break-word">
+                            <table class="row container-header-row" style="background-color:#5c97bd;border-collapse:collapse;border-spacing:0;color:#f3f3f3;display:table;padding:0;padding-bottom:8px;padding-top:8px;position:relative;text-align:left;vertical-align:top;width:100%">
+                                <tbody>
+                                <tr style="padding:0;text-align:left;vertical-align:top">
+                                    <th class="small-12 large-12 columns first last" style="Margin:0 auto;color:#333;font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;line-height:19px;margin:0 auto;padding:0;padding-bottom:0;padding-left:16px;padding-right:16px;text-align:left;width:564px">
+                                        <table style="border-collapse:collapse;border-spacing:0;padding:0;text-align:left;vertical-align:top;width:100%">
+                                            <tbody>
+                                            <tr style="padding:0;text-align:left;vertical-align:top">
+                                                <th style="Margin:0;color:#333;font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;line-height:19px;margin:0;padding:0;text-align:left">
+                                                    <h6 style="Margin:0;Margin-bottom:10px;color:#f3f3f3;font-family:Helvetica,Arial,sans-serif;font-size:18px;font-weight:400;line-height:1.3;margin:0;margin-bottom:8px;margin-top:8px;padding:0;text-align:left;word-wrap:normal">
+                                                        <a href="#" style="Margin:0;color:#f3f3f3;font-family:Helvetica,Arial,sans-serif;font-weight:400;line-height:1.3;margin:0;padding:0;text-align:left;text-decoration:none" target="_blank">
+                                                            您的账号信息
+                                                        </a>
+                                                    </h6>
+                                                </th>
+                                                <th class="expander" style="Margin:0;color:#333;font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;line-height:19px;margin:0;padding:0!important;text-align:left;visibility:hidden;width:0"></th>
+                                            </tr>
+                                            </tbody>
+                                        </table>
+                                    </th>
+                                </tr>
+                                </tbody>
+                            </table>
+                            <table class="row" style="border-collapse:collapse;border-spacing:0;display:table;padding:0;position:relative;text-align:left;vertical-align:top;width:100%">
+                                <tbody>
+                                <tr style="padding:0;text-align:left;vertical-align:top">
+                                    <th class="small-12 large-12 columns first last" style="Margin:0 auto;color:#333;font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;line-height:19px;margin:0 auto;padding:0;padding-bottom:0;padding-left:16px;padding-right:16px;text-align:left;width:564px">
+                                        <p style="border-collapse:collapse;border-spacing:0;padding:0;text-align:left;vertical-align:top;width:100%"></p>
+                                <tbody>
+                                <tr style="padding:0;text-align:left;vertical-align:top">
+                                    <th style="Margin:0;color:#333;font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;line-height:19px;margin:0;padding:0;text-align:left">
+                                        <div class="release" style="padding-top:5px;padding-left:20px;padding-bottom:20px;">
+                                            <table>
+                                                <th>
+                                                    <td colspan="2">您的账号信息如下</td>
+                                                </th>
+                                                <tr>
+                                                    <td>订单编号</td>
+                                                    <td>{{$content['order_sn']}}</td>
+                                                </tr>
+                                                <tr>
+                                                    <td>服务</td>
+                                                    <td>{{$content['goods_name']}}</td>
+                                                </tr>
+                                                <tr>
+                                                    <td>流量</td>
+                                                    <td>{{$content['goods_traffic']}}</td>
+                                                </tr>
+                                                <tr>
+                                                    <td>节点列表</td>
+                                                    <td>{{$content['server_list']}}</td>
+                                                </tr>
+                                                <tr>
+                                                    <td>端口</td>
+                                                    <td>{{$content['port']}}</td>
+                                                </tr>
+                                                <tr>
+                                                    <td>密码</td>
+                                                    <td>{{$content['passwd']}}</td>
+                                                </tr>
+                                                <tr>
+                                                    <td>加密方式</td>
+                                                    <td>{{$content['method']}}</td>
+                                                </tr>
+                                                <tr>
+                                                    <td>创建时间</td>
+                                                    <td>{{$content['created_at']}}</td>
+                                                </tr>
+                                                <tr>
+                                                    <td>过期时间</td>
+                                                    <td>{{$content['expire_at']}}</td>
+                                                </tr>
+                                            </table>
+                                        </div>
+                                    </th>
+                                    <th class="expander" style="Margin:0;color:#333;font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;line-height:19px;margin:0;padding:0!important;text-align:left;visibility:hidden;width:0"></th>
+                                </tr>
+                                </tbody>
+                                </th></tr></tbody>
+                            </table>
+                        </td>
+                    </tr>
+                    </tbody>
+                </table>
+            </center>
+        </td>
+    </tr>
+    </tbody>
+</table>

+ 5 - 1
resources/views/payment/detail.blade.php

@@ -58,7 +58,7 @@
     <script type="text/javascript">
         // 每2秒查询一次订单状态
         $(document).ready(function(){
-            setInterval("getStatus()", 1000);
+            setInterval("getStatus()", 800);
         });
 
         // 检查支付单状态
@@ -71,6 +71,10 @@
                     layer.msg(ret.message, {time:1500}, function() {
                         window.location.href = '{{url('invoices')}}';
                     });
+                } else if(ret.status == 'error') {
+                    layer.msg(ret.message, {time:1500}, function () {
+                        window.location.href = '{{url('invoices')}}';
+                    })
                 }
             });
         }

+ 13 - 0
resources/views/user/index.blade.php

@@ -408,11 +408,13 @@
             var _token = '{{csrf_token()}}';
             var charge_type = $("#charge_type").val();
             var charge_coupon = $("#charge_coupon").val();
+
             if (charge_type == '1' && (charge_coupon == '' || charge_coupon == undefined)) {
                 $("#charge_msg").show().html("{{trans('home.coupon_not_empty')}}");
                 $("#charge_coupon").focus();
                 return false;
             }
+
             $.ajax({
                 url:'{{url('charge')}}',
                 type:"POST",
@@ -425,6 +427,7 @@
                         $("#charge_msg").show().html(ret.message);
                         return false;
                     }
+
                     $("#charge_modal").modal("hide");
                     window.location.reload();
                 },
@@ -434,6 +437,7 @@
                 complete:function(){}
             });
         }
+
         // 积分兑换流量
         function exchange() {
             $.ajax({
@@ -450,6 +454,7 @@
                     });
                 }
             });
+
             return false;
         }
     </script>
@@ -462,32 +467,39 @@
                     $("#qrcode_{{$node->id}}").draggable({handle: ".modal-header"});
                 @endforeach
             };
+
             return {
                 init: function () {
                     n()
                 }
             }
         }();
+
         jQuery(document).ready(function () {
             UIModals.init()
         });
+
         // 循环输出节点scheme用于生成二维码
         @foreach ($nodeList as $node)
             $('#qrcode_ssr_img_{{$node->id}}').qrcode("{{$node->ssr_scheme}}");
             $('#qrcode_ss_img_{{$node->id}}').qrcode("{{$node->ss_scheme}}");
         @endforeach
+
         // 节点订阅
         function subscribe() {
             window.location.href = '{{url('subscribe')}}';
         }
+
         // 显示加密、混淆、协议
         function show(txt) {
             layer.msg(txt);
         }
+
         // 生成消息通道订阅二维码
         @if($is_push_bear && $push_bear_qrcode)
             $('#subscribe_qrcode').qrcode({render:"canvas", text:"{{$push_bear_qrcode}}", width:170, height:170});
         @endif
+
         // 更换订阅地址
         function exchangeSubscribe() {
             layer.confirm('更换订阅地址将导致:<br>1.旧地址立即失效;<br>2.连接密码被更改;', {icon: 7, title:'警告'}, function(index) {
@@ -498,6 +510,7 @@
                         }
                     });
                 });
+
                 layer.close(index);
             });
         }

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

@@ -32,7 +32,7 @@
                 </div>
                 <div class="col-xs-3">
                     <h2 class="invoice-title">{{trans('home.coupon')}}</h2>
-                    <p class="invoice-desc">{{$order->coupon ? $order->coupon->name : '...'}}</p>
+                    <p class="invoice-desc">{{$order->coupon ? $order->coupon->name : '未使用'}}</p>
                 </div>
                 <div class="col-xs-3">
                     <h2 class="invoice-title"> {{trans('home.service_total_price')}} </h2>