communitystatics.html 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475
  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. </style>
  52. </head>
  53. <body layadmin-themealias="default">
  54. <div class="layui-fluid">
  55. <div class="layui-card">
  56. <div class="layui-card-header layui-elem-quote">当前位置:<span class="line-text">团长统计</span></div>
  57. <div class="layui-tab layui-tab-brief" >
  58. <ul class="layui-tab-title">
  59. <li <?php if( empty($_GPC['type']) || $_GPC['type']=='0' ){ ?>class="layui-this"<?php } ?><a href="{:U('reports/communitystatics', array('type' => 0))}">团长销售额统计</a></li>
  60. <li <?php if( $_GPC['type']=='2' ){ ?>class="layui-this"<?php } ?> ><a href="{:U('reports/communitystatics_commiss', array('type' => 2))}">团长佣金金额统计</a></li>
  61. <li <?php if( $_GPC['type']=='3' ){ ?>class="layui-this"<?php } ?> ><a href="{:U('reports/communitystatics_order', array('type' => 3))}">团长订单统计</a></li>
  62. </ul>
  63. </div>
  64. <div class="layui-card-body" style="padding:15px;">
  65. <div class="page-content">
  66. <form action="" method="get" class="form-horizontal form-search layui-form" role="form" id="search">
  67. <input type="hidden" name="c" value="reports" />
  68. <input type="hidden" name="a" value="communitystatics" />
  69. <input type="hidden" name="type" value="{$_GPC['type']}" />
  70. <div class="page-toolbar">
  71. <div class="layui-form-item">
  72. <span class="layui-input-inline">
  73. <select name='searchtime' class='form-control' style="width:100px;padding:0 5px;" id="searchtime">
  74. <option value=''>不按时间</option>
  75. <option value='create_time' <?php if($_GPC['searchtime']=='create_time'){ ?>selected<?php } ?>>下单时间</option>
  76. </select>
  77. </span>
  78. <span class="layui-input-inline" style="width: 285px;">
  79. {:tpl_form_field_daterange('time', array('starttime'=>date('Y-m-d H:i', $starttime),'endtime'=>date('Y-m-d H:i', $endtime)),true);}
  80. </span>
  81. <div class="layui-input-inline">
  82. <input type="hidden" name="export" id="export" value="0">
  83. </div>
  84. <div class="layui-input-inline" style="width: 400px;margin-right: 0px;">
  85. <input type="text" class="layui-input" name='keyword' id="keyword" value="{$_GPC['keyword']}" placeholder="请输入团长昵称/团长姓名/社区昵称">
  86. </div>
  87. <div class="layui-btn-group">
  88. <button class="layui-btn btn-submit layui-btn-sm" data-export="0" type="submit"> 搜索</button>
  89. <button data-export="1" type="submit" class="layui-btn layui-btn-sm btn-submit layui-btn-primary">导出</button>
  90. </div>
  91. </div>
  92. </div>
  93. </form>
  94. <form action="" method="post" class="layui-form" role="form">
  95. <div class="row">
  96. <div class="col-md-12">
  97. <table class="layui-table" lay-skin="line" lay-size="lg">
  98. <thead>
  99. <tr>
  100. <th style="width:25px;">
  101. <input type='checkbox' name="checkall" lay-skin="primary" lay-filter="checkboxall" />
  102. </th>
  103. <th style="width:50px;text-align:center;">ID</th>
  104. <th style="width: 100px;">团长昵称</th>
  105. <th style="width: 180px;">姓名/手机号</th>
  106. <th style="width: 200px;">小区信息</th>
  107. <th style="width: 100px;">团长等级</th>
  108. <th style="">下单会员数</th>
  109. <th style="width: 100px;">下单数量</th>
  110. <th style="">销售额(元)</th>
  111. <th >退款量</th>
  112. <th >退款额(元)</th>
  113. <th style="">净销售额(元)</th>
  114. <th style="text-align:right;width: 150px;">操作</th>
  115. </tr>
  116. </thead>
  117. <tbody>
  118. <?php foreach($data as $item){ ?>
  119. <tr>
  120. <td style="width:25px;">
  121. <input type='checkbox' value="{$item['head_id']}" name="item_checkbox" lay-skin="primary" />
  122. </td>
  123. <td style="width:100px;text-align:center;">
  124. {$item['head_id']}
  125. </td>
  126. <td>
  127. {$item['username']}
  128. </td>
  129. <td>
  130. {$item['head_name']}<br/>
  131. {$item['head_mobile']}
  132. </td>
  133. <td>
  134. {$item['community_name']}
  135. </td>
  136. <td>
  137. {$item['head_levelname']}
  138. </td>
  139. <td>
  140. {$item['buy_mb_count']}
  141. </td>
  142. <td>
  143. {$item['buy_order_count']}
  144. </td>
  145. <td>
  146. {$item['sum_order_paymoney']}
  147. </td>
  148. <td >
  149. {$item['refund_order_count']}
  150. </td>
  151. <td >
  152. {$item['refund_order_money']}
  153. </td>
  154. <td>
  155. {$item['real_sale_money']}
  156. </td>
  157. <td style="overflow:visible;position:relative;text-align:right;">
  158. <?php if( isset($_GPC['searchtime']) && $_GPC['searchtime'] == 'create_time' ){ ?>
  159. <a class="layui-btn layui-btn-primary layui-btn-xs" href="{:U('order/index',array('searchfield'=>'head_name','type'=>0,'keyword' => $item['head_name'],'ok'=>1,'time_end' => date('Y-m-d H:i', $endtime),'time_start'=>date('Y-m-d H:i', $starttime),'searchtime' => 'create'));}">
  160. <span data-toggle="tooltip" data-placement="top" title="" data-original-title="查看订单明细">
  161. 查看订单明细
  162. </span>
  163. </a>
  164. <?php }else{ ?>
  165. <a class="layui-btn layui-btn-primary layui-btn-xs" href="{:U('order/index',array('searchfield'=>'head_name','type'=>0,'keyword' => $item['head_name'],'ok'=>1));}">
  166. <span data-toggle="tooltip" data-placement="top" title="" data-original-title="查看订单明细">
  167. 查看订单明细
  168. </span>
  169. </a>
  170. <?php } ?>
  171. </td>
  172. </tr>
  173. <?php } ?>
  174. </tbody>
  175. <tfoot>
  176. <tr>
  177. <td colspan="3" style="padding-left: 0;">
  178. <!-- <div class="page-table-header">
  179. <input type="checkbox">
  180. </div> -->
  181. </td>
  182. <td colspan="7" style="text-align: right">
  183. {$pager}
  184. </td>
  185. </tr>
  186. </tfoot>
  187. </table>
  188. </div>
  189. </div>
  190. </form>
  191. <div class="row">
  192. <blockquote class="layui-elem-quote layui-text">
  193. #下单会员数<br/>
  194. - 下单会员数 为此团长下面的下单的会员数量统计<br/>
  195. #下单数量<br/>
  196. - 下单数量为 此团长下面会员一共下单的数量<br/>
  197. #销售额<br/>
  198. - 销售额为 下单数量所有的金额总和。<br/>
  199. #净销售额<br/>
  200. - 净销售额为 销售额 - 退款额 = 净销售额<br/>
  201. </blockquote>
  202. </div>
  203. </div>
  204. </div>
  205. </div>
  206. <script src="/layuiadmin/layui/layui.js"></script>
  207. <script>
  208. layui.config({
  209. base: '/layuiadmin/' //静态资源所在路径
  210. }).extend({
  211. index: 'lib/index' //主入口模块
  212. }).use('index');
  213. </script>
  214. <script>
  215. var layer = layui.layer;
  216. var $;
  217. layui.use(['jquery', 'layer','form'], function(){
  218. $ = layui.$;
  219. var form = layui.form;
  220. $('.deldom').click(function(){
  221. var s_url = $(this).attr('data-href');
  222. layer.confirm($(this).attr('data-confirm'), function(index){
  223. $.ajax({
  224. url:s_url,
  225. type:'post',
  226. dataType:'json',
  227. success:function(info){
  228. if(info.status == 0)
  229. {
  230. layer.msg(info.result.message,{icon: 1,time: 2000});
  231. }else if(info.status == 1){
  232. var go_url = location.href;
  233. if( info.result.hasOwnProperty("url") )
  234. {
  235. go_url = info.result.url;
  236. }
  237. layer.msg('操作成功',{time: 1000,
  238. end:function(){
  239. location.href = info.result.url;
  240. }
  241. });
  242. }
  243. }
  244. })
  245. });
  246. })
  247. $('.btn-operation').click(function(){
  248. var ids_arr = [];
  249. var obj = $(this);
  250. var s_toggle = $(this).attr('data-toggle');
  251. var s_url = $(this).attr('data-href');
  252. $("input[name=item_checkbox]").each(function() {
  253. if( $(this).prop('checked') )
  254. {
  255. ids_arr.push( $(this).val() );
  256. }
  257. })
  258. if(ids_arr.length < 1)
  259. {
  260. layer.msg('请选择要操作的内容');
  261. }else{
  262. var can_sub = true;
  263. if( s_toggle == 'batch-remove' )
  264. {
  265. can_sub = false;
  266. layer.confirm($(obj).attr('data-confirm'), function(index){
  267. $.ajax({
  268. url:s_url,
  269. type:'post',
  270. dataType:'json',
  271. data:{ids:ids_arr},
  272. success:function(info){
  273. if(info.status == 0)
  274. {
  275. layer.msg(info.result.message,{icon: 1,time: 2000});
  276. }else if(info.status == 1){
  277. var go_url = location.href;
  278. if( info.result.hasOwnProperty("url") )
  279. {
  280. go_url = info.result.url;
  281. }
  282. layer.msg('操作成功',{time: 1000,
  283. end:function(){
  284. location.href = info.result.url;
  285. }
  286. });
  287. }
  288. }
  289. })
  290. });
  291. }else{
  292. $.ajax({
  293. url:s_url,
  294. type:'post',
  295. dataType:'json',
  296. data:{ids:ids_arr},
  297. success:function(info){
  298. if(info.status == 0)
  299. {
  300. layer.msg(info.result.message,{icon: 1,time: 2000});
  301. }else if(info.status == 1){
  302. var go_url = location.href;
  303. if( info.result.hasOwnProperty("url") )
  304. {
  305. go_url = info.result.url;
  306. }
  307. layer.msg('操作成功',{time: 1000,
  308. end:function(){
  309. location.href = info.result.url;
  310. }
  311. });
  312. }
  313. }
  314. })
  315. }
  316. }
  317. })
  318. form.on('switch(statewsitch)', function(data){
  319. var s_url = $(this).attr('data-href')
  320. var s_value = 1;
  321. if(data.elem.checked)
  322. {
  323. s_value = 1;
  324. }else{
  325. s_value = 0;
  326. }
  327. $.ajax({
  328. url:s_url,
  329. type:'post',
  330. dataType:'json',
  331. data:{state:s_value},
  332. success:function(info){
  333. if(info.status == 0)
  334. {
  335. layer.msg(info.result.message,{icon: 1,time: 2000});
  336. }else if(info.status == 1){
  337. var go_url = location.href;
  338. if( info.result.hasOwnProperty("url") )
  339. {
  340. go_url = info.result.url;
  341. }
  342. layer.msg('操作成功',{time: 1000,
  343. end:function(){
  344. location.href = info.result.url;
  345. }
  346. });
  347. }
  348. }
  349. })
  350. });
  351. form.on('checkbox(checkboxall)', function(data){
  352. if(data.elem.checked)
  353. {
  354. $("input[name=item_checkbox]").each(function() {
  355. $(this).prop("checked", true);
  356. });
  357. $("input[name=checkall]").each(function() {
  358. $(this).prop("checked", true);
  359. });
  360. }else{
  361. $("input[name=item_checkbox]").each(function() {
  362. $(this).prop("checked", false);
  363. });
  364. $("input[name=checkall]").each(function() {
  365. $(this).prop("checked", false);
  366. });
  367. }
  368. form.render('checkbox');
  369. });
  370. //监听提交
  371. form.on('submit(formDemo)', function(data){
  372. $.ajax({
  373. url: data.form.action,
  374. type: data.form.method,
  375. data: data.field,
  376. dataType:'json',
  377. success: function (info) {
  378. if(info.status == 0)
  379. {
  380. layer.msg(info.result.message,{icon: 1,time: 2000});
  381. }else if(info.status == 1){
  382. var go_url = location.href;
  383. if( info.result.hasOwnProperty("url") )
  384. {
  385. go_url = info.result.url;
  386. }
  387. layer.msg('操作成功',{time: 1000,
  388. end:function(){
  389. location.href = info.result.url;
  390. }
  391. });
  392. }
  393. }
  394. });
  395. return false;
  396. });
  397. })
  398. </script>
  399. <script>
  400. $(function () {
  401. $('.btn-submit').click(function () {
  402. var e = $(this).data('export');
  403. if(e>0 ){
  404. if($('#keyword').val() !='' ){
  405. $('#export').val(e);
  406. $('#search').submit();
  407. }else if($('#searchtime').val()!=''){
  408. $('#export').val(e);
  409. $('#search').submit();
  410. }else{
  411. $('#export').val(e);
  412. $('#search').submit();
  413. }
  414. }else{
  415. $('#export').val(0);
  416. $('#search').submit();
  417. }
  418. })
  419. })
  420. </script>
  421. </body>
  422. </html>