orderList.blade.php 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. @extends('admin.layouts')
  2. @section('css')
  3. <link href="/assets/global/vendor/bootstrap-table/bootstrap-table.min.css" type="text/css" rel="stylesheet">
  4. <link href="/assets/global/vendor/bootstrap-datepicker/bootstrap-datepicker.min.css" type="text/css"
  5. rel="stylesheet">
  6. @endsection
  7. @section('content')
  8. <div class="page-content container-fluid">
  9. <div class="panel">
  10. <div class="panel-heading">
  11. <h2 class="panel-title">订单列表</h2>
  12. </div>
  13. <div class="panel-body">
  14. <div class="form-row">
  15. <div class="form-group col-lg-2 col-sm-6">
  16. <input type="text" class="form-control" name="email" id="email"
  17. value="{{Request::get('email')}}" placeholder="用户名"/>
  18. </div>
  19. <div class="form-group col-lg-2 col-sm-6">
  20. <input type="number" class="form-control" name="order_sn" id="order_sn"
  21. value="{{Request::get('order_sn')}}" placeholder="订单号"/>
  22. </div>
  23. <div class="form-group col-lg-6 col-sm-12">
  24. <div class="input-group input-daterange" data-plugin="datepicker">
  25. <div class="input-group-prepend">
  26. <span class="input-group-text"><i class="icon wb-calendar"
  27. aria-hidden="true"></i></span>
  28. </div>
  29. <input type="text" class="form-control" name="start" id="start"
  30. placeholder="{{date("Y-m-d")}}"/>
  31. <div class="input-group-prepend">
  32. <span class="input-group-text">至</span>
  33. </div>
  34. <input type="text" class="form-control" name="end" id="end"
  35. placeholder="{{date("Y-m-d",strtotime("+1 month"))}}"/>
  36. </div>
  37. </div>
  38. <div class="form-group col-lg-2 col-sm-6">
  39. <select class="form-control" name="is_expire" id="is_expire" onChange="Search()">
  40. <option value="" hidden>是否过期</option>
  41. <option value="0">否</option>
  42. <option value="1">是</option>
  43. </select>
  44. </div>
  45. <div class="form-group col-lg-2 col-sm-6">
  46. <select class="form-control" name="is_coupon" id="is_coupon" onChange="Search()">
  47. <option value="" hidden>是否使用优惠券</option>
  48. <option value="0">否</option>
  49. <option value="1">是</option>
  50. </select>
  51. </div>
  52. <div class="form-group col-lg-2 col-sm-6">
  53. <select class="form-control" name="pay_way" id="pay_way" onChange="Search()">
  54. <option value="" hidden>支付方式</option>
  55. <option value="credit">余额</option>
  56. <option value="youzan">有赞云</option>
  57. <option value="f2fpay">当面付</option>
  58. <option value="codepay">码支付</option>
  59. <option value="payjs">PayJs</option>
  60. <option value="bitpayx">麻瓜宝</option>
  61. <option value="paypal">PayPal</option>
  62. <option value="epay">易支付</option>
  63. </select>
  64. </div>
  65. <div class="form-group col-lg-2 col-sm-6">
  66. <select class="form-control" name="status" id="status" onChange="Search()">
  67. <option value="" hidden>订单状态</option>
  68. <option value="-1">已关闭</option>
  69. <option value="0">待支付</option>
  70. <option value="1">已支付待确认</option>
  71. <option value="2">已完成</option>
  72. </select>
  73. </div>
  74. <div class="form-group col-lg-3 col-sm-6">
  75. <div class="d-flex align-items-center">
  76. <div class="radio-custom radio-primary radio-inline">
  77. <input type="radio" name="sort" value="0" checked/>
  78. <label for="type">降序</label>
  79. </div>
  80. <div class="radio-custom radio-primary radio-inline">
  81. <input type="radio" name="sort" value="1"
  82. @if(Request::get('sort') == '1') checked @endif/>
  83. <label for="type">升序</label>
  84. </div>
  85. </div>
  86. </div>
  87. <div class="form-group col-lg-2 col-sm-6 btn-group">
  88. <button class="btn btn-primary" onclick="Search()">搜 索</button>
  89. <a href="/admin/orderList" class="btn btn-danger">重 置</a>
  90. </div>
  91. </div>
  92. <table class="text-md-center" data-toggle="table" data-mobile-responsive="true">
  93. <thead class="thead-default">
  94. <tr>
  95. <th> #</th>
  96. <th> 用户名</th>
  97. <th> 订单号</th>
  98. <th> 商品</th>
  99. <th> 过期时间</th>
  100. <th> 优惠券</th>
  101. <th> 原价</th>
  102. <th> 实价</th>
  103. <th> 支付方式</th>
  104. <th> 订单状态</th>
  105. <th> 创建时间</th>
  106. </tr>
  107. </thead>
  108. <tbody>
  109. @foreach($orderList as $order)
  110. <tr>
  111. <td> {{$order->oid}} </td>
  112. <td>
  113. @if(empty($order->user) )
  114. 【账号不存在】
  115. @else
  116. <a href="/admin/userList?id={{$order->user->id}}"
  117. target="_blank">{{$order->user->email}} </a>
  118. @endif
  119. </td>
  120. <td> {{$order->order_sn}}</td>
  121. <td> {{empty($order->goods) ? ($order->goods_id == 0 ? '余额充值': trans('home.invoice_table_goods_deleted')) : $order->goods->name}} </td>
  122. <td> {{$order->is_expire ? '已过期' : $order->expired_at}} </td>
  123. <td> {{$order->coupon ? $order->coupon->name . ' - ' . $order->coupon->sn : ''}} </td>
  124. <td> ¥{{$order->origin_amount}} </td>
  125. <td> ¥{{$order->amount}} </td>
  126. <td>
  127. <span class="badge badge-lg badge-info"> {{$order->pay_way_label}} </span>
  128. </td>
  129. <td>
  130. @if($order->status == '-1')
  131. <span class="badge badge-lg badge-danger"> 已关闭 </span>
  132. @elseif ($order->status == '0')
  133. <span class="badge badge-lg badge-default"> 待支付 </span>
  134. @elseif ($order->status == '1')
  135. <span class="badge badge-lg badge-default"> 已支付待确认 </span>
  136. @else
  137. <span class="badge badge-lg badge-success"> 已完成 </span>
  138. @endif
  139. </td>
  140. <td> {{$order->created_at}} </td>
  141. </tr>
  142. @endforeach
  143. </tbody>
  144. </table>
  145. </div>
  146. <div class="panel-footer">
  147. <div class="row">
  148. <div class="col-sm-4">
  149. 共 <code>{{$orderList->total()}}</code> 个订单
  150. </div>
  151. <div class="col-sm-8">
  152. <nav class="Page navigation float-right">
  153. {{$orderList->links()}}
  154. </nav>
  155. </div>
  156. </div>
  157. </div>
  158. </div>
  159. </div>
  160. @endsection
  161. @section('script')
  162. <script src="/assets/global/vendor/bootstrap-table/bootstrap-table.min.js" type="text/javascript"></script>
  163. <script src="/assets/global/vendor/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"
  164. type="text/javascript"></script>
  165. <script src="/assets/global/vendor/bootstrap-datepicker/bootstrap-datepicker.min.js"
  166. type="text/javascript"></script>
  167. <script src="/assets/global/js/Plugin/bootstrap-datepicker.js" type="text/javascript"></script>
  168. <script type="text/javascript">
  169. $(document).ready(function () {
  170. $('#is_expire').val({{Request::get('is_expire')}});
  171. $('#is_coupon').val({{Request::get('is_coupon')}});
  172. $('#pay_way').val({{Request::get('pay_way')}});
  173. $('#status').val({{Request::get('status')}});
  174. });
  175. // 有效期
  176. $('.input-daterange').datepicker({
  177. format: "yyyy-mm-dd",
  178. });
  179. //回车检测
  180. $(document).on("keypress", "input", function (e) {
  181. if (e.which === 13) {
  182. Search();
  183. return false;
  184. }
  185. });
  186. // 搜索
  187. function Search() {
  188. window.location.href = '/admin/orderList?email=' + $("#email").val() + '&order_sn=' + $("#order_sn").val() + '&is_expire=' + $("#is_expire").val() + '&is_coupon=' + $("#is_coupon").val() + '&pay_way=' + $("#pay_way").val() + '&status=' + $("#status").val() + '&sort=' + $("input:radio[name='sort']:checked").val() + '&range_time=' + [$("#start").val(), $("#end").val()];
  189. }
  190. </script>
  191. @endsection