point.blade.php 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. @extends('layouts.base')
  2. <script src="{{static_url('js/echarts.js')}}" type="text/javascript"></script>
  3. @section('title', trans('积分数据统计'))
  4. @section('content')
  5. <link href="{{static_url('yunshop/css/order.css')}}" media="all" rel="stylesheet" type="text/css"/>
  6. <style>
  7. .point-count{ margin-bottom:20px !important;line-height: 40px;height: 40px;}
  8. .status-content{ margin: 20px 0;}
  9. .panel-heading{ border: 0 !important; font-size: 1.2em !important;}
  10. .panel-body-change{ font-size: 1.5em !important;}
  11. /*.daterangepicker .right .calendar-date, .daterangepicker ul, .daterangepicker label, .daterangepicker_end_input{display:none;}*/
  12. /*[name=daterangepicker_start]{width:164px !important;}*/
  13. </style>
  14. <div class="w1200 m0a">
  15. <div class="rightlist">
  16. @include('layouts.tabs')
  17. <!-- 新增加右侧顶部三级菜单 -->
  18. <div class="panel panel-info">
  19. <div class="panel-body">
  20. <div class="card">
  21. <div class="card-content">
  22. <form action="" method="post" class="form-horizontal" role="form" id="form1">
  23. <div class='form-group col-xs-12 col-sm-6'>
  24. <div class="input-group">
  25. <span class="input-group-addon">
  26. <input type="checkbox" name="search[is_time]" value="1"
  27. @if($search['is_time'] == '1')checked="checked"@endif>
  28. </span>
  29. {!!app\common\helpers\DateRange::tplFormFieldDateRange('search[time]', [
  30. 'starttime'=>$search['time']['start'] ?: date('Y-m-d H:i:s'),
  31. 'endtime'=>$search['time']['end'] ?: date('Y-m-d H:i:s'),
  32. 'start'=>0,
  33. 'end'=>0
  34. ])!!}
  35. </div>
  36. </div>
  37. <div class="form-group col-xs-12 col-sm-4">
  38. <button class="btn btn-success" id="search"><i class="fa fa-search"></i> 搜索</button>
  39. <button type="submit" name="export" value="1" id="export" class="btn btn-default">导出 Excel</button>
  40. </div>
  41. </form>
  42. </div>
  43. </div>
  44. </div>
  45. </div>
  46. <div class="panel panel-default">
  47. <table class='table point-count'>
  48. <tr class='trhead'>
  49. <td colspan='8' style="text-align: left;">
  50. 积分统计:可使用积分(当前积分剩余总积分),已消耗积分汇总(只统计已抵扣部分),获赠积分汇总(只统计签到、购买、买单及活动营销插件获得的部分),后台积分汇总
  51. </td>
  52. </tr>
  53. </table>
  54. </div>
  55. <div class="panel panel-default">
  56. <table class='table point-count'>
  57. <tr class='trhead'style="text-align: center;">
  58. <td>
  59. <h4>可使用积分</h4>
  60. <p style="font-size: 1.2em">{{ $pointUseCount }}</p>
  61. </td>
  62. <td>
  63. <h4>已消耗积分</h4>
  64. <p style="font-size: 1.2em">{{ $pointUsedCount * -1 }}</p>
  65. </td>
  66. <td>
  67. <h4>已赠送积分</h4>
  68. <p style="font-size: 1.2em">{{ $pointGivenCount }}</p>
  69. </td>
  70. <td>
  71. <h4>充值积分</h4>
  72. <p style="font-size: 1.2em">{{ $pointRechargeCount }}</p>
  73. </td>
  74. </tr>
  75. </table>
  76. </div>
  77. <div class="panel panel-default">
  78. <table class='table' style='float:left;margin-bottom:0;table-layout: fixed;line-height: 40px;height: 40px'>
  79. <tr class='trhead'>
  80. <td colspan='8' style="text-align: left;">
  81. 积分趋势图
  82. </td>
  83. </tr>
  84. </table>
  85. </div>
  86. <div class='panel panel-default form-horizontal form'>
  87. <div class='panel-body'style="border: 1px solid #e6e6e6">
  88. <div id="pointChart" style="width: 100%;height:400px;float: left;"></div>
  89. </div>
  90. </div>
  91. <div class="panel panel-default" style="border: 1px solid #e6e6e6; margin-top: 10px;">
  92. <div class="panel-heading">详细数据</div>
  93. <div class='panel-body'>
  94. <table class="table table-hover table-responsive table-striped">
  95. <thead>
  96. <tr>
  97. <th >时间</th>
  98. <th >可使用积分</th>
  99. <th >已消耗积分</th>
  100. <th >已赠送积分</th>
  101. <th >充值积分</th>
  102. </tr>
  103. </thead>
  104. <tbody>
  105. @foreach($allPointData as $key => $item)
  106. <tr>
  107. <td>
  108. {{ $item['date'] }}
  109. </td>
  110. <td>
  111. {{ $item['usePoint'] }}
  112. </td>
  113. <td>
  114. {{ $item['usedPoint'] }}
  115. </td>
  116. <td>
  117. {{ $item['givenPoint'] }}
  118. </td>
  119. <td>
  120. {{ $item['recharge'] }}
  121. </td>
  122. </tr>
  123. @endforeach
  124. </table>
  125. {!! $page !!}
  126. </div>
  127. </div>
  128. </div>
  129. </div>
  130. <script type="text/javascript">
  131. //积分统计
  132. var pointChart = echarts.init(document.getElementById('pointChart'));
  133. option = {
  134. tooltip: {
  135. trigger: 'axis'
  136. },
  137. legend: {
  138. data:['可使用积分','已消耗积分','已赠送积分','充值积分']
  139. },
  140. grid: {
  141. left: '3%',
  142. right: '4%',
  143. bottom: '3%',
  144. containLabel: true
  145. },
  146. toolbox: {
  147. feature: {
  148. saveAsImage: {}
  149. }
  150. },
  151. xAxis: {
  152. type: 'category',
  153. boundaryGap: false,
  154. data: {!! $pointTime !!}
  155. },
  156. yAxis: {
  157. type: 'value'
  158. },
  159. series: [
  160. {
  161. name:'可使用积分',
  162. type:'line',
  163. stack: '总量2',
  164. data:{!! $pointUseData !!}
  165. },
  166. {
  167. name:'已消耗积分',
  168. type:'line',
  169. stack: '总量1',
  170. data:{!! $pointUsedData !!},
  171. yAxisIndex:0
  172. },
  173. {
  174. name:'已赠送积分',
  175. type:'line',
  176. stack: '总量3',
  177. data:{!! $pointGivenData !!}
  178. },
  179. {
  180. name:'充值积分',
  181. type:'line',
  182. stack: '总量4',
  183. data:{!! $pointRechargeData !!}
  184. },
  185. ]
  186. };
  187. pointChart.setOption(option, true);
  188. </script>
  189. <script>
  190. $(function () {
  191. $('#export').click(function () {
  192. $('#form1').attr('action', '{!! yzWebUrl('charts.finance.point.export') !!}');
  193. $('#form1').submit();
  194. setTimeout(() =>{
  195. $('#form1').attr('action', " ");
  196. },0)
  197. });
  198. });
  199. </script>
  200. @endsection