coupon.blade.php 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. @extends('layouts.base')
  2. @section('content')
  3. <div class="w1200 m0a">
  4. <div class="rightlist">
  5. <div class="right-titpos">
  6. <ul class="add-snav">
  7. <li class="active"><a href="#">优惠券二维码</a></li>
  8. <a class="btn btn-primary" href="{!! yzWebUrl('plugin.coupon-qr.admin.coupon.edit') !!}"><i
  9. class="fa fa-plus"></i>生成二维码</a>
  10. </ul>
  11. </div>
  12. <div class="panel panel-info">
  13. <div class="panel-body">
  14. <form action="" method="post" class="form-horizontal" role="form" id="form">
  15. <div class="form-group col-xs-12 col-sm-3">
  16. <div>
  17. <input class="form-control" name="search[name]" id="" type="text"
  18. value="{{ $search['name'] }}" placeholder="优惠券名称">
  19. </div>
  20. </div>
  21. <div class="form-group col-xs-12 col-sm-6">
  22. <div class="col-sm-4">
  23. <select name='search[is_time]' class='form-control'>
  24. <option value='0'
  25. @if($search['is_time'] ==0 || empty($search['is_time'])) selected @endif>
  26. 不搜索时间
  27. </option>
  28. <option value='1' @if($search['is_time'] ==1) selected @endif>搜索时间</option>
  29. </select>
  30. </div>
  31. {!! app\common\helpers\DateRange::tplFormFieldDateRange('search[time]', [
  32. 'starttime'=>date('Y-m-d H:i', strtotime($search['time']['start']) ?: strtotime('-1 month')),
  33. 'endtime'=>date('Y-m-d H:i',strtotime($search['time']['end']) ?: time()),
  34. 'start'=>0,
  35. 'end'=>0
  36. ], true) !!}
  37. </div>
  38. <div class="form-group col-xs-12 col-sm-6">
  39. <button type="button" name="export" value="1" id="export"
  40. class="btn btn-default excel back ">导出 Excel
  41. </button>
  42. <input type="hidden" name="token" value="{{$var['token']}}"/>
  43. <button class="btn btn-success" onclick="$('#form').onsubmit();"><i
  44. class="fa fa-search"></i> 搜索
  45. </button>
  46. </div>
  47. </form>
  48. </div>
  49. </div>
  50. </div>
  51. <div class="panel panel-default">
  52. <div class="panel-heading">总数: {{$list['total']}}</div>
  53. <div class="panel-body">
  54. <table class="table" style="">
  55. <thead>
  56. <tr>
  57. <th style="width:5%; text-align:center;">ID</th>
  58. <th style="width:15%; text-align: center;">时间</th>
  59. <th style="width:7%; text-align: center;">会员</th>
  60. <th style="width:10%; text-align: center;">优惠券名称</th>
  61. <th style="width:20%; text-align: center;">商品名称</th>
  62. <th style="width:12%; text-align: center;">生成数量/已领取/已使用</th>
  63. <th style="width:10%; text-align: center;">领取记录</th>
  64. <th style="width:7%; text-align: center;">H5二维码</th>
  65. <th style="width:7%; text-align: center;">小程序二维码</th>
  66. <th style="width:10%; text-align: center;">操作</th>
  67. </tr>
  68. </thead>
  69. <tbody>
  70. @foreach ($list as $row)
  71. <tr style="text-align:center;">
  72. <td>{{ $row->id }}</td>
  73. <td>{{ $row->created_at }}</td>
  74. <td>
  75. <a href="{{ yzWebUrl('member.member.detail', ['id' => $row->hasOneMember->uid]) }}">
  76. @if($row->hasOneMember->avatar || $shopSet['headimg'])
  77. <img src='{{ $row->hasOneMember->avatar ? tomedia($row->hasOneMember->avatar) : tomedia($shopSet['headimg']) }}' style='width:30px;height:30px;padding:1px;border:1px solid #ccc'/>
  78. <br/>
  79. @endif
  80. {{ $row->hasOneMember->nickname ?: '未更新'}}
  81. </a>
  82. </td>
  83. <td>{{ $row->hasOneCoupon->name }}</td>
  84. <td>
  85. <img src="{{ yz_tomedia($row->hasOneGoods->thumb) }}"
  86. style="width: 30px; height: 30px;border:1px solid #ccc;padding:1px;">
  87. 【{{ $row->goods_id }}】{{ $row->hasOneGoods->title }}
  88. </td>
  89. <td>{{ $row->grant_num }}/{{ $row->received }}/{{ $row->used }}</td>
  90. <td>
  91. <a class="btn btn-default"
  92. href="{!! yzWebUrl('plugin.coupon-qr.admin.record.index', ['search[id]'=>$row['coupon_type_id']]) !!}">领取记录</a>
  93. </td>
  94. <td>
  95. <a class='btn btn-default'
  96. href="{!!yzWebUrl('plugin.coupon-qr.admin.coupon.code', ['id'=>$row['id']])!!}"
  97. title='H5二维码'><i class='fa fa-qrcode'></i></a>
  98. </td>
  99. <td>
  100. <a class='btn btn-default'
  101. href="{!!yzWebUrl('plugin.coupon-qr.admin.coupon.small', ['id'=>$row['id']])!!}"
  102. title='小程序二维码'><i class='fa fa-qrcode'></i></a>
  103. </td>
  104. <td>
  105. {{--<a class="btn btn-default" href="{!! yzWebUrl('plugin.coupon-qr.admin.coupon.edit', ['id'=>$row['id']]) !!}" >编辑</a>--}}
  106. <a class="btn btn-default"
  107. href="{!! yzWebUrl('plugin.coupon-qr.admin.coupon.deleted', ['id'=>$row['id']]) !!}"
  108. onclick="return confirm('确定要删除吗');return false;">删除</a>
  109. </td>
  110. </tr>
  111. @endforeach
  112. </tbody>
  113. </table>
  114. {!! $page !!}
  115. </div>
  116. </div>
  117. </div>
  118. <script language='javascript'>
  119. $(function () {
  120. $('#export').click(function () {
  121. $('#form').get(0).action = "{!! yzWebUrl('plugin.coupon-qr.admin.coupon.export') !!}";
  122. $('#form').submit();
  123. $('#form').get(0).action = "{!! yzWebUrl('plugin.coupon-qr.admin.coupon.index') !!}";
  124. });
  125. });
  126. </script>
  127. @endsection