goodstatics.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  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="reports" />
  64. <input type="hidden" name="a" value="goodstatics" />
  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-3">商品总销售量:{$all_quantity}</div>
  91. <div class="col-md-3">总销售额(商城售价):<?php echo round($all_total,2); ?>(元)</div>
  92. </div>
  93. <form action="" method="post" class="layui-form" role="form">
  94. <div class="row">
  95. <div class="col-md-12">
  96. <table class="layui-table" lay-skin="line" lay-size="lg">
  97. <thead>
  98. <tr>
  99. <th style="width:50px;text-align:center;">排名</th>
  100. <th style="width: 10%;">
  101. 商品名称
  102. <span class="tipDiv" onmouseover="overShow1()" onmouseout="outHide1()"><span class="tipSpan">?</span></span>
  103. <div id="showDiv1" class="showDiv" style="left: 5px;right:0px;padding-top: 5px;"></div>
  104. </th>
  105. <th style="width: 100px;">规格</th>
  106. <th style="width: 100px;">商城售价(元)</th>
  107. <th style="width: 100px;">成本价(元)</th>
  108. <th style="width: 100px;">
  109. 商品销量
  110. <span class="tipDiv" onmouseover="overShow2()" onmouseout="outHide2()"><span class="tipSpan">?</span></span>
  111. <div id="showDiv2" class="showDiv" style="left: 5px;right:0px;padding-top: 5px;width: 150px;"></div>
  112. </th>
  113. <th style="width: 100px;">
  114. 商品销量总价(元)
  115. <span class="tipDiv" onmouseover="overShow3()" onmouseout="outHide3()"><span class="tipSpan">?</span></span>
  116. <div id="showDiv3" class="showDiv" style="left: 5px;right:0px;padding-top: 5px;width: 300px;"></div>
  117. </th>
  118. <th style="width: 100px;">
  119. 商品销量成本总价(元)
  120. <span class="tipDiv" onmouseover="overShow4()" onmouseout="outHide4()"><span class="tipSpan">?</span></span>
  121. <div id="showDiv4" class="showDiv" style="left: 5px;right:0px;padding-top: 5px;width: 300px;"></div>
  122. </th>
  123. <th style="width: 100px;">
  124. 毛利额
  125. <span class="tipDiv" onmouseover="overShow5()" onmouseout="outHide5()"><span class="tipSpan">?</span></span>
  126. <div id="showDiv5" class="showDiv" style="left: 5px;right:0px;padding-top: 5px;width: 300px;"></div>
  127. </th>
  128. <th style="width: 100px;">
  129. 毛利率(%)
  130. <span class="tipDiv" onmouseover="overShow6()" onmouseout="outHide6()"><span class="tipSpan">?</span></span>
  131. <div id="showDiv6" class="showDiv" style="right:10px;padding-top: 5px;width: 300px;"></div>
  132. </th>
  133. </tr>
  134. </thead>
  135. <tbody>
  136. <?php if(!empty($list)){ ?>
  137. <?php foreach($list as $item){ ?>
  138. <tr>
  139. <td style="width:100px;text-align:center;">
  140. {$item['rank']}
  141. </td>
  142. <td>
  143. {$item['name']}
  144. </td>
  145. <td>
  146. {$item['option_sku']}
  147. </td>
  148. <td>
  149. <?php echo round($item['price'],2); ?>
  150. </td>
  151. <td>
  152. <?php echo round($item['cost_price'],2); ?>
  153. </td>
  154. <td>
  155. {$item['quantity']}
  156. </td>
  157. <td>
  158. <?php echo round($item['total_price'],2); ?>
  159. </td>
  160. <td>
  161. <?php echo round($item['cost_total_price'],2); ?>
  162. </td>
  163. <td >
  164. <?php echo round($item['profit_total'],2); ?>
  165. </td>
  166. <td >
  167. {$item['profit_fee']}%
  168. </td>
  169. </tr>
  170. <?php } ?>
  171. <?php }else{ ?>
  172. <tr>
  173. <td colspan="10" style="text-align: center;">暂无数据!</td>
  174. </tr>
  175. <?php } ?>
  176. </tbody>
  177. <tfoot>
  178. <tr>
  179. <td colspan="10" style="text-align: right">
  180. {$pager}
  181. </td>
  182. </tr>
  183. </tfoot>
  184. </table>
  185. </div>
  186. </div>
  187. </form>
  188. </div>
  189. </div>
  190. </div>
  191. <script src="/layuiadmin/layui/layui.js"></script>
  192. <script>
  193. layui.config({
  194. base: '/layuiadmin/' //静态资源所在路径
  195. }).extend({
  196. index: 'lib/index' //主入口模块
  197. }).use('index');
  198. </script>
  199. <script>
  200. var layer = layui.layer;
  201. var $;
  202. layui.use(['jquery', 'layer','form'], function(){
  203. $ = layui.$;
  204. var form = layui.form;
  205. })
  206. function overShow1() {
  207. var showDiv = document.getElementById('showDiv1');
  208. showDiv.style.display = 'block';
  209. showDiv.innerHTML = '<div class="table"><div class="table-tr"><div class="table-td">只统计已完成的订单商品数量。</div></div></div>';
  210. }
  211. function outHide1() {
  212. var showDiv = document.getElementById('showDiv1');
  213. showDiv.style.display = 'none';
  214. showDiv.innerHTML = '';
  215. }
  216. function overShow2() {
  217. var showDiv = document.getElementById('showDiv2');
  218. showDiv.style.display = 'block';
  219. showDiv.innerHTML = '<div class="table"><div class="table-tr"><div class="table-td">不包含虚拟销量。</div></div></div>';
  220. }
  221. function outHide2() {
  222. var showDiv = document.getElementById('showDiv2');
  223. showDiv.style.display = 'none';
  224. showDiv.innerHTML = '';
  225. }
  226. function overShow3() {
  227. var showDiv = document.getElementById('showDiv3');
  228. showDiv.style.display = 'block';
  229. showDiv.innerHTML = '<div class="table"><div class="table-tr"><div class="table-td">商品销量总价 = 商城售价 * 商品销量</div></div></div>';
  230. }
  231. function outHide3() {
  232. var showDiv = document.getElementById('showDiv3');
  233. showDiv.style.display = 'none';
  234. showDiv.innerHTML = '';
  235. }
  236. function overShow4() {
  237. var showDiv = document.getElementById('showDiv4');
  238. showDiv.style.display = 'block';
  239. showDiv.innerHTML = '<div class="table"><div class="table-tr"><div class="table-td">商品销量成本总价 = 成本价 * 商品销量</div></div></div>';
  240. }
  241. function outHide4() {
  242. var showDiv = document.getElementById('showDiv4');
  243. showDiv.style.display = 'none';
  244. showDiv.innerHTML = '';
  245. }
  246. function overShow5() {
  247. var showDiv = document.getElementById('showDiv5');
  248. showDiv.style.display = 'block';
  249. showDiv.innerHTML = '<div class="table"><div class="table-tr"><div class="table-td">毛利额 = 商品销量总价 - 商品销量成本总价</div></div></div>';
  250. }
  251. function outHide5() {
  252. var showDiv = document.getElementById('showDiv5');
  253. showDiv.style.display = 'none';
  254. showDiv.innerHTML = '';
  255. }
  256. function overShow6() {
  257. var showDiv = document.getElementById('showDiv6');
  258. showDiv.style.display = 'block';
  259. showDiv.innerHTML = '<div class="table"><div class="table-tr"><div class="table-td">毛利率 = 毛利额 / 商品销量总价</div></div></div>';
  260. }
  261. function outHide6() {
  262. var showDiv = document.getElementById('showDiv6');
  263. showDiv.style.display = 'none';
  264. showDiv.innerHTML = '';
  265. }
  266. </script>
  267. <script>
  268. $(function () {
  269. $('.btn-submit').click(function () {
  270. var e = $(this).data('export');
  271. if(e>0 ){
  272. if($('#keyword').val() !='' ){
  273. $('#export').val(e);
  274. $('#search').submit();
  275. }else if($('#searchtime').val()!=''){
  276. $('#export').val(e);
  277. $('#search').submit();
  278. }else{
  279. $('#export').val(e);
  280. $('#search').submit();
  281. }
  282. }else{
  283. $('#export').val(0);
  284. $('#search').submit();
  285. }
  286. })
  287. })
  288. </script>
  289. </body>
  290. </html>