statistics.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <?php $shoname_name = D('Home/Front')->get_config_by_name('shoname'); ?>
  6. <title><?php echo $shoname; ?></title>
  7. <link rel="shortcut icon" href="" />
  8. <meta name="renderer" content="webkit">
  9. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  11. <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
  12. <!-- 让IE8/9支持媒体查询,从而兼容栅格 -->
  13. <!--[if lt IE 9]>
  14. <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
  15. <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
  16. <![endif]-->
  17. <link href="./resource/css/bootstrap.min.css?v=201903260001" rel="stylesheet">
  18. <link href="./resource/css/common.css?v=201903260001" rel="stylesheet">
  19. <script type="text/javascript">
  20. window.sysinfo = {
  21. <?php if (!empty($_W['uniacid']) ){ ?>'uniacid': '{$_W['uniacid']}',<?php } ?>
  22. <?php if( !empty($_W['acid']) ){ ?>'acid': '{$_W['acid']}',<?php } ?>
  23. <?php if (!empty($_W['openid']) ) { ?>'openid': '{$_W['openid']}',<?php } ?>
  24. <?php if( !empty($_W['uid']) ) { ?>'uid': '{$_W['uid']}',<?php } ?>
  25. 'isfounder': <?php if (!empty($_W['isfounder']) ) { ?>1<?php }else{ ?>0<?php } ?>,
  26. 'siteroot': '{$_W['siteroot']}',
  27. 'siteurl': '{$_W['siteurl']}',
  28. 'attachurl': '{$_W['attachurl']}',
  29. 'attachurl_local': '{$_W['attachurl_local']}',
  30. 'attachurl_remote': '{$_W['attachurl_remote']}',
  31. 'module': {'url' : '<?php if( defined('MODULE_URL') ) { ?>{MODULE_URL}<?php } ?>', 'name' : '<?php if (defined('IN_MODULE') ) { ?>{IN_MODULE}<?php } ?>'},
  32. 'cookie': {'pre': ''},
  33. 'account': {:json_encode($_W['account'])},
  34. };
  35. </script>
  36. <script type="text/javascript" src="./resource/js/lib/jquery-1.11.1.min.js"></script>
  37. <script type="text/javascript" src="./resource/js/lib/bootstrap.min.js"></script>
  38. <script type="text/javascript" src="./resource/js/app/util.js?v=201903260001"></script>
  39. <script type="text/javascript" src="./resource/js/app/common.min.js?v=201903260001"></script>
  40. <script type="text/javascript" src="./resource/js/require.js?v=201903260001"></script>
  41. <script type="text/javascript" src="./resource/js/lib/jquery.nice-select.js?v=201903260001"></script>
  42. <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
  43. <link href="/static/css/snailfish.css" rel="stylesheet">
  44. <style type="text/css">
  45. .layui-btn-sm { line-height: 34px;height: 34px; }
  46. .layui-btn-group .layui-btn:first-child {border-radius: 0;}
  47. .text-green { color: #15d2b9 !important; }
  48. .daterangepicker select.ampmselect, .daterangepicker select.hourselect, .daterangepicker select.minuteselect {
  49. width: auto!important;
  50. }
  51. .tipDiv{display:inline;border-radius: 50%; height: 18px;width:18px; display: inline-block; border-style: solid; border-color: #8a8a8a; border-width:1px;font-size:11px}
  52. .tipSpan{padding-left: 5px;font-weight:bold;color:#8a8a8a;}
  53. .showDiv{position: absolute; right: 5px;background-color: #8a8a8a; height:35px;width:320px;display:none;border-radius:20px;text-align:center;color:#fff;}
  54. </style>
  55. </head>
  56. <body layadmin-themealias="default">
  57. <div class="layui-fluid">
  58. <div class="layui-card">
  59. <div class="layui-card-header layui-elem-quote">当前位置:<span class="line-text">预售统计</span></div>
  60. <div class="layui-card-body" style="padding:15px;">
  61. <div class="page-content">
  62. <form action="" method="get" class="form-horizontal form-search layui-form" role="form" id="search">
  63. <input type="hidden" name="c" value="presale" />
  64. <input type="hidden" name="a" value="statistics" />
  65. <div class="page-toolbar">
  66. <div class="layui-form-item">
  67. <span class="layui-input-inline">
  68. <select name='searchtime' class='form-control' style="width:100px;padding:0 5px;" id="searchtime">
  69. <option value=''>不按时间</option>
  70. <option value='create_time' <?php if($gpc['searchtime']=='create_time'){ ?>selected<?php } ?>>需发货时间</option>
  71. </select>
  72. </span>
  73. <span class="layui-input-inline" style="width: 285px;">
  74. {:tpl_form_field_daterange('time', array('starttime'=>date('Y-m-d H:i', $starttime),'endtime'=>date('Y-m-d H:i', $endtime)),true);}
  75. </span>
  76. <div class="layui-input-inline">
  77. <input type="hidden" name="export" id="export" value="0">
  78. </div>
  79. <div class="layui-input-inline" style="width: 400px;margin-right: 0px;">
  80. <input type="text" class="layui-input" name='keyword' id="keyword" value="{$gpc['keyword']}" placeholder="请输入商品名称">
  81. </div>
  82. <div class="layui-btn-group">
  83. <button class="layui-btn btn-submit layui-btn-sm" data-export="0" type="submit"> 搜索</button>
  84. <button data-export="1" type="submit" class="layui-btn layui-btn-sm btn-submit layui-btn-primary">导出</button>
  85. </div>
  86. </div>
  87. </div>
  88. </form>
  89. <div class="row" style="margin: 10px 0;">
  90. <div class="col-md-6">查询时间段待发货的商品数据,可直接点击 “关联订单” 进行订单查看</div>
  91. </div>
  92. <form action="" method="post" class="layui-form" role="form">
  93. <div class="row">
  94. <div class="col-md-12">
  95. <table class="layui-table" lay-skin="line" lay-size="lg">
  96. <thead>
  97. <tr>
  98. <th style="width: 10%;">
  99. 商品名称
  100. <span class="tipDiv" onmouseover="overShow1()" onmouseout="outHide1()"><span class="tipSpan">?</span></span>
  101. <div id="showDiv1" class="showDiv" style="left: 5px;right:0px;padding-top: 5px;"></div>
  102. </th>
  103. <th style="width: 100px;">规格</th>
  104. <th style="width: 100px;">商城售价(元)</th>
  105. <th style="width: 100px;">
  106. 商品销量
  107. <span class="tipDiv" onmouseover="overShow2()" onmouseout="outHide2()"><span class="tipSpan">?</span></span>
  108. <div id="showDiv2" class="showDiv" style="left: 5px;right:0px;padding-top: 5px;width: 150px;"></div>
  109. </th>
  110. <th style="width: 100px;">
  111. 商品销量总价(元)
  112. <span class="tipDiv" onmouseover="overShow3()" onmouseout="outHide3()"><span class="tipSpan">?</span></span>
  113. <div id="showDiv3" class="showDiv" style="left: 5px;right:0px;padding-top: 5px;width: 300px;"></div>
  114. </th>
  115. </tr>
  116. </thead>
  117. <tbody>
  118. <?php if(!empty($list)){ ?>
  119. <?php foreach($list as $item){ ?>
  120. <tr>
  121. <td>
  122. {$item['name']}
  123. </td>
  124. <td>
  125. {$item['option_sku']}
  126. </td>
  127. <td>
  128. <?php echo round($item['price'],2); ?>
  129. </td>
  130. <td>
  131. {$item['quantity']}
  132. </td>
  133. <td>
  134. <?php echo round($item['total_price'],2); ?>
  135. </td>
  136. </tr>
  137. <?php } ?>
  138. <?php }else{ ?>
  139. <tr>
  140. <td colspan="5" style="text-align: center;">暂无数据!</td>
  141. </tr>
  142. <?php } ?>
  143. </tbody>
  144. <tfoot>
  145. <tr>
  146. <td colspan="5" style="text-align: right">
  147. {$pager}
  148. </td>
  149. </tr>
  150. </tfoot>
  151. </table>
  152. </div>
  153. </div>
  154. </form>
  155. </div>
  156. </div>
  157. </div>
  158. <script src="/layuiadmin/layui/layui.js"></script>
  159. <script>
  160. layui.config({
  161. base: '/layuiadmin/' //静态资源所在路径
  162. }).extend({
  163. index: 'lib/index' //主入口模块
  164. }).use('index');
  165. </script>
  166. <script>
  167. var layer = layui.layer;
  168. var $;
  169. layui.use(['jquery', 'layer','form'], function(){
  170. $ = layui.$;
  171. var form = layui.form;
  172. })
  173. function overShow1() {
  174. var showDiv = document.getElementById('showDiv1');
  175. showDiv.style.display = 'block';
  176. showDiv.innerHTML = '<div class="table"><div class="table-tr"><div class="table-td">只统计已完成的订单商品数量。</div></div></div>';
  177. }
  178. function outHide1() {
  179. var showDiv = document.getElementById('showDiv1');
  180. showDiv.style.display = 'none';
  181. showDiv.innerHTML = '';
  182. }
  183. function overShow2() {
  184. var showDiv = document.getElementById('showDiv2');
  185. showDiv.style.display = 'block';
  186. showDiv.innerHTML = '<div class="table"><div class="table-tr"><div class="table-td">不包含虚拟销量。</div></div></div>';
  187. }
  188. function outHide2() {
  189. var showDiv = document.getElementById('showDiv2');
  190. showDiv.style.display = 'none';
  191. showDiv.innerHTML = '';
  192. }
  193. function overShow3() {
  194. var showDiv = document.getElementById('showDiv3');
  195. showDiv.style.display = 'block';
  196. showDiv.innerHTML = '<div class="table"><div class="table-tr"><div class="table-td">商品销量总价 = 商城售价 * 商品销量</div></div></div>';
  197. }
  198. function outHide3() {
  199. var showDiv = document.getElementById('showDiv3');
  200. showDiv.style.display = 'none';
  201. showDiv.innerHTML = '';
  202. }
  203. function overShow4() {
  204. var showDiv = document.getElementById('showDiv4');
  205. showDiv.style.display = 'block';
  206. showDiv.innerHTML = '<div class="table"><div class="table-tr"><div class="table-td">商品销量成本总价 = 成本价 * 商品销量</div></div></div>';
  207. }
  208. function outHide4() {
  209. var showDiv = document.getElementById('showDiv4');
  210. showDiv.style.display = 'none';
  211. showDiv.innerHTML = '';
  212. }
  213. function overShow5() {
  214. var showDiv = document.getElementById('showDiv5');
  215. showDiv.style.display = 'block';
  216. showDiv.innerHTML = '<div class="table"><div class="table-tr"><div class="table-td">毛利额 = 商品销量总价 - 商品销量成本总价</div></div></div>';
  217. }
  218. function outHide5() {
  219. var showDiv = document.getElementById('showDiv5');
  220. showDiv.style.display = 'none';
  221. showDiv.innerHTML = '';
  222. }
  223. function overShow6() {
  224. var showDiv = document.getElementById('showDiv6');
  225. showDiv.style.display = 'block';
  226. showDiv.innerHTML = '<div class="table"><div class="table-tr"><div class="table-td">毛利率 = 毛利额 / 商品销量总价</div></div></div>';
  227. }
  228. function outHide6() {
  229. var showDiv = document.getElementById('showDiv6');
  230. showDiv.style.display = 'none';
  231. showDiv.innerHTML = '';
  232. }
  233. </script>
  234. <script>
  235. $(function () {
  236. $('.btn-submit').click(function () {
  237. var e = $(this).data('export');
  238. if(e>0 ){
  239. if($('#keyword').val() !='' ){
  240. $('#export').val(e);
  241. $('#search').submit();
  242. }else if($('#searchtime').val()!=''){
  243. $('#export').val(e);
  244. $('#search').submit();
  245. }else{
  246. $('#export').val(e);
  247. $('#search').submit();
  248. }
  249. }else{
  250. $('#export').val(0);
  251. $('#search').submit();
  252. }
  253. })
  254. })
  255. </script>
  256. </body>
  257. </html>