Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 
 

264 lignes
13 KiB

  1. <?php
  2. /**
  3. *
  4. * ============================================================================
  5. * * 版权所有 蜘蛛出行 * *
  6. * 网站地址: http://www.zhizhuchuxing.com
  7. * ----------------------------------------------------------------------------
  8. * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
  9. * 使用;不允许对程序代码以任何形式任何目的的再发布。
  10. * ============================================================================
  11. * Author By: 张帅
  12. * PhpStorm statistical-from.php
  13. * Create By 2017/1/12 11:39 $
  14. */
  15. use backend\modules\zzcs\assets\ZzcsAsset;
  16. use yii\widgets\Pjax;
  17. ZzcsAsset::addScript($this, '/gathering/js/tool.js');
  18. ZzcsAsset::addCss($this, '/finance/css/bus_cost.css');
  19. ZzcsAsset::addCss($this, '/plug/My97DatePicker/skin/WdatePicker.css');
  20. ZzcsAsset::addScript($this, '/finance/js/ticket_cost.js?v=001');
  21. ZzcsAsset::addScript($this, '/plug/date-time/date-manage.js?v=001');
  22. ZzcsAsset::addScript($this, '/plug/My97DatePicker/WdatePicker.js');
  23. ZzcsAsset::addCssHTTP($this,'http://img.zhizhuchuxing.cn/zzframe/dist/css/bootstrap.css');
  24. ZzcsAsset::addCssHTTP($this,'http://img.zhizhuchuxing.cn/zzframe/dists/css/style.css');
  25. ZzcsAsset::addCssHTTP($this,'http://img.zhizhuchuxing.cn/zzframe/dists/css/bootstrap-datetimepicker.css');
  26. ZzcsAsset::addCssHTTP($this,'http://img.zhizhuchuxing.cn/zzframe/docs/assets/css/docs.min.css');
  27. ZzcsAsset::addCssHTTP($this,'http://img.zhizhuchuxing.cn/zzframe/dists/css/home.css');
  28. ZzcsAsset::addCssHTTP($this,'http://img.zhizhuchuxing.cn/zzframe/dists/css/prettify.min.css');
  29. ZzcsAsset::addCssHTTP($this,'http://img.zhizhuchuxing.cn/zzframe/dists/css/module.css');
  30. ZzcsAsset::addCssHTTP($this,'http://img.zhizhuchuxing.cn/zzframe/dists/css/xcConfirm.css');
  31. ZzcsAsset::addScriptHTTP($this,'http://img.zhizhuchuxing.cn/zzframe/dists/js/bootstrap-datetimepicker.min.js');
  32. ZzcsAsset::addScriptHTTP($this,'http://img.zhizhuchuxing.cn/zzframe/dists/js/module.js');
  33. ZzcsAsset::addScriptHTTP($this,'http://img.zhizhuchuxing.cn/zzframe/dists/js/xcConfirm.js');
  34. ?>
  35. <div class="search_station">
  36. <ul id="search_station">
  37. <li class="search1">
  38. <span>查询维度:</span>
  39. <select class="dimensionality" style="width: 93px">
  40. <?php foreach ($dimensionality as $key => $vel) { ?>
  41. <option value="<?php echo $key+1; ?>"><?php echo $vel; ?></option>
  42. <?php } ?>
  43. </select>
  44. </li>
  45. <li class="search2" id="search_date">
  46. <span>出发起止日期:</span>
  47. <!-- <input type="text" id="start_date" onclick="WdatePicker({maxDate: '#F{$dp.$D(\'end_date\')}'})" value="--><?php //echo $start_date; ?><!--"/>-->
  48. <!-- <span>&nbsp;&nbsp;-&nbsp;&nbsp;</span>-->
  49. <!-- <input type="text" id="end_date" onclick="WdatePicker({minDate: '#F{$dp.$D(\'start_date\')}'})" value="--><?php //echo $end_date; ?><!--"/>-->
  50. <input type="text" id="start_date" onclick="WdatePicker({onpicked:changeEndDate})" value="<?php echo $start_date; ?>"/>
  51. <span>&nbsp;&nbsp;-&nbsp;&nbsp;</span>
  52. <input type="text" id="end_date" onclick="WdatePicker({onpicked:changeStartDate})" value="<?php echo $end_date; ?>"/>
  53. </li>
  54. <li class="search6">
  55. <span>票种:</span>
  56. <select id="ticket_type">
  57. <option value="0" selected="selected">请选择</option>
  58. <option value="1">保险</option>
  59. <option value="2">其他</option>
  60. </select>
  61. </li>
  62. <li class="search6" id="search_name">
  63. <span>产品名称:</span>
  64. <input type="text" id="prod_name" size="10" />
  65. </li>
  66. <li class="search6" id="search_supplier">
  67. <span>供应商:</span>
  68. <input type="text" id="supplier_name" size="10" />
  69. </li>
  70. <li class="search3">
  71. <span class="btn-primary" id="search_btn" onclick='searchInfo()'>查询</span>
  72. </li>
  73. <li class="search4">
  74. <a id="export_prod_cost"><span class="btn-primary" id="export_btn" onclick='exportInfo()'>导出</span></a>
  75. </li>
  76. </ul>
  77. </div>
  78. <?php Pjax::begin(['id' => 'main_table', 'timeout' => 30000000]) ?>
  79. <div class="table_list">
  80. <table id="table_list" data-time="<?php echo time();?>">
  81. <thead>
  82. <tr>
  83. <th class="td1">编号</th>
  84. <th class="td2"><?php echo $statistical_type; ?></th>
  85. <th class="td3">订单数</th>
  86. <th class="td4">人次</th>
  87. <th class="td6">GMV</th>
  88. <th class="td11">赔入</th>
  89. <th class="td12">赔出</th>
  90. <th class="td7">成本</th>
  91. <th class="td8">GP</th>
  92. <th class="td9">GP率</th>
  93. <th class="td10">订单明细</th>
  94. <!--<th class="td9">人次月环比</th>
  95. <th class="td10">GMV月环比</th>-->
  96. </tr>
  97. </thead>
  98. <tbody>
  99. <!-- 合计 -->
  100. <tr>
  101. <td class="td1" style="color:#0095d9;font-size:larger;">-</td>
  102. <td class="td2" style="color:#0095d9;font-size:larger;">合计</td>
  103. <td class="td3"
  104. style="color:#0095d9;font-size:larger;text-align:right;padding-right: 10px;"><?php if (!isset($count['order_num'])) {
  105. $count['order_num'] = 0;
  106. }
  107. echo number_format($count['order_num']); ?></td>
  108. <td class="td4"
  109. style="color:#0095d9;font-size:larger;text-align:right;padding-right: 10px;"><?php if (!isset($count['people_num'])) {
  110. $count['people_num'] = 0;
  111. }
  112. echo number_format($count['people_num']); ?></td>
  113. <td class="td6"
  114. style="color:#0095d9;font-size:larger;text-align:right;padding-right: 10px;"><?php echo number_format($count['gmv'], 2); ?></td>
  115. <td class="td11"
  116. style="color:#0095d9;font-size:larger;text-align:right;padding-right: 10px;"><?php echo number_format($count['pay_in'], 2); ?></td>
  117. <td class="td12"
  118. style="color:#0095d9;font-size:larger;text-align:right;padding-right: 10px;"><?php echo number_format($count['pay_out'], 2); ?></td>
  119. <td class="td7"
  120. style="color:#0095d9;font-size:larger;text-align:right;padding-right: 10px;"><?php echo number_format($count['base_price'], 2); ?></td>
  121. <td class="td8"
  122. style="color:#0095d9;font-size:larger;text-align:right;padding-right: 10px;"><?php echo number_format($count['gp'], 2); ?></td>
  123. <td class="td9 <?php
  124. if ($count['gp'] >= 0) {
  125. echo 'red_color';
  126. } else {
  127. echo 'green_color';
  128. } ?>" style="text-align:right;padding-right: 10px;"><?php echo $count['gp_rate']; ?></td>
  129. <td class="td10">-</td>
  130. </tr>
  131. <!-- end 合计 -->
  132. <?php
  133. if (count($list) > 0) {
  134. foreach ($list as $key => $vel) { ?>
  135. <tr>
  136. <td class="td1"><?php echo ($page['current_page']-1)*$page['page_size']+$key+1; ?></td>
  137. <td class="td2"><?php echo $vel['data_type']; ?></td>
  138. <th class="td3"
  139. style="text-align:right;padding-right: 10px;"><?php echo number_format($vel['order_num']); ?></th>
  140. <td class="td4"
  141. style="text-align:right;padding-right: 10px;"><?php echo number_format($vel['people_num']); ?></td>
  142. <td class="td6"
  143. style="text-align:right;padding-right: 10px;"><?php echo number_format($vel['gmv'], 2); ?></td>
  144. <td class="td11"
  145. style="text-align:right;padding-right: 10px;"><?php echo number_format($vel['pay_in'], 2); ?></td>
  146. <td class="td12"
  147. style="text-align:right;padding-right: 10px;"><?php echo number_format($vel['pay_out'], 2); ?></td>
  148. <td class="td7"
  149. style="text-align:right;padding-right: 10px;"><?php echo number_format($vel['base_price'], 2); ?> </td>
  150. <td class="td8 <?php if ($vel['gp'] >= 0) {
  151. echo 'red_color';
  152. } else {
  153. echo 'green_color';
  154. } ?>" style="text-align:right;padding-right: 10px;"><?php echo number_format($vel['gp'], 2); ?></td>
  155. <td class="td9 <?php if ($vel['gp_rate'] == '-') {
  156. } else if ($vel['gp_rate'] >= 0) {
  157. echo 'red_color';
  158. } else {
  159. echo 'green_color';
  160. } ?>" style="text-align:right;padding-right: 10px;"><?php echo $vel['gp_rate']; ?></td>
  161. <td class="td10"><a href="javascript:void(0);" onclick="window.open('<?php echo $vel['url']?>','_blank');" >下载</a></td>
  162. </tr>
  163. <?php }
  164. } ?>
  165. <!-- 合计 -->
  166. <tr>
  167. <td class="td1" style="color:#0095d9;font-size:larger;">-</td>
  168. <td class="td2" style="color:#0095d9;font-size:larger;">合计</td>
  169. <td class="td3"
  170. style="color:#0095d9;font-size:larger;text-align:right;padding-right: 10px;"><?php if (!isset($count['order_num'])) {
  171. $count['order_num'] = 0;
  172. }
  173. echo number_format($count['order_num']); ?></td>
  174. <td class="td4"
  175. style="color:#0095d9;font-size:larger;text-align:right;padding-right: 10px;"><?php if (!isset($count['people_num'])) {
  176. $count['people_num'] = 0;
  177. }
  178. echo number_format($count['people_num']); ?></td>
  179. <td class="td6"
  180. style="color:#0095d9;font-size:larger;text-align:right;padding-right: 10px;"><?php echo number_format($count['gmv'], 2); ?></td>
  181. <td class="td11"
  182. style="color:#0095d9;font-size:larger;text-align:right;padding-right: 10px;"><?php echo number_format($count['pay_in'], 2); ?></td>
  183. <td class="td12"
  184. style="color:#0095d9;font-size:larger;text-align:right;padding-right: 10px;"><?php echo number_format($count['pay_out'], 2); ?></td>
  185. <td class="td7"
  186. style="color:#0095d9;font-size:larger;text-align:right;padding-right: 10px;"><?php echo number_format($count['base_price'], 2); ?></td>
  187. <td class="td8"
  188. style="color:#0095d9;font-size:larger;text-align:right;padding-right: 10px;"><?php echo number_format($count['gp'], 2); ?></td>
  189. <td class="td9 <?php
  190. if ($count['gp'] >= 0) {
  191. echo 'red_color';
  192. } else {
  193. echo 'green_color';
  194. } ?>" style="text-align:right;padding-right: 10px;"><?php echo $count['gp_rate']; ?></td>
  195. <td class="td10">-</td>
  196. </tr>
  197. <!-- end 合计 -->
  198. </tbody>
  199. </table>
  200. </div>
  201. <!--页码信息-->
  202. <div id="page_size_d" total_row="<?php echo $page['total_row']; ?>" total_page="<?php echo $page['total_page']; ?>">
  203. <span class="page_size">每页条数</span>
  204. <select id="page_size" onchange="changePageSize(this)">
  205. <?php foreach ($page_size_arr as $key => $vel) {
  206. if ($vel == $page['page_size']) {
  207. echo '<option value="' . $vel . '" selected=selected>' . $vel . '</option>';
  208. } else {
  209. echo '<option value="' . $vel . '">' . $vel . '</option>';
  210. }
  211. } ?>
  212. </select>
  213. </div>
  214. <div id="page_list">
  215. <?php
  216. if (count($page_arr) > 0) {
  217. foreach ($page_arr as $key => $vel) {
  218. if ($page['current_page'] == 1 && ($vel == '首页' || $vel == '<上一页')) {
  219. $class = 'not_click';
  220. } elseif ($page['current_page'] == $vel) {
  221. $class = 'click';
  222. } elseif ($page['current_page'] == $page['total_page'] && ($vel == '末页' || $vel == '下一页>')) {
  223. $class = 'not_click';
  224. } elseif ($vel == '...') {
  225. $class = 'not_click';
  226. } else {
  227. $class = 'clickable';
  228. }
  229. if ($vel != '首页' && $vel != '<上一页' && $vel != '下一页>' && $vel != '末页') {
  230. $class = 'page_num ' . $class;
  231. }
  232. if ($class == 'clickable' || $class == 'page_num clickable') {
  233. echo '<span class="' . $class . '" onclick="pageSearchInfo(this,' . $page['total_page'] . ')">' . $vel . '</span>';
  234. } else {
  235. echo '<span class="' . $class . '">' . $vel . '</span>';
  236. }
  237. }
  238. }
  239. ?>
  240. <span class="total_row">共<?php echo $page['total_row']; ?>条</span>
  241. </div>
  242. <?php Pjax::end() ?>