communitystatics_order.html 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478
  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_order" />
  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: 200px;">团长昵称</th>
  105. <th style="width: 180px;">姓名/手机号</th>
  106. <th style="width: 200px;">小区信息</th>
  107. <th style="">总订单量</th>
  108. <th style="width: 120px;">有效订单量</th>
  109. <th style="">
  110. 已关闭订单量
  111. </th>
  112. <th style="">订单总金额(元)</th>
  113. <th style="">有效订单金额(元)</th>
  114. <th style="">待付款量</th>
  115. <th style="">退款量</th>
  116. <th style="">退款总金额(元)</th>
  117. <th style="text-align:right;width: 150px;">操作</th>
  118. </tr>
  119. </thead>
  120. <tbody>
  121. <?php foreach($data as $item){ ?>
  122. <tr>
  123. <td style="width:25px;">
  124. <input type='checkbox' value="{$item['head_id']}" name="item_checkbox" lay-skin="primary" />
  125. </td>
  126. <td style="width:100px;text-align:center;">
  127. {$item['head_id']}
  128. </td>
  129. <td>
  130. {$item['username']}
  131. </td>
  132. <td>
  133. {$item['head_name']}<br/>
  134. {$item['head_mobile']}
  135. </td>
  136. <td>
  137. {$item['community_name']}
  138. </td>
  139. <td>
  140. {$item['all_order_count']}
  141. </td>
  142. <td>
  143. {$item['effect_order_count']}
  144. </td>
  145. <td>
  146. {$item['close_order_count']}
  147. </td>
  148. <td>
  149. {$item['all_order_paymoney']}
  150. </td>
  151. <td>
  152. {$item['effect_order_paymoney']}
  153. </td>
  154. <td>
  155. {$item['pending_order_count']}
  156. </td>
  157. <td>
  158. {$item['refund_order_count']}
  159. </td>
  160. <td>
  161. {$item['refund_order_paymoney']}
  162. </td>
  163. <td style="overflow:visible;position:relative;text-align:right;">
  164. <?php if( isset($_GPC['searchtime']) && $_GPC['searchtime'] == 'create_time' ){ ?>
  165. <a class="layui-btn layui-btn-primary layui-btn-xs" href="{:U('order/index',array('time_end' => date('Y-m-d H:i', $endtime),'time_start'=>date('Y-m-d H:i', $starttime),'searchtime' => 'create','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 }else{ ?>
  171. <a class="layui-btn layui-btn-primary layui-btn-xs" href="{:U('order/index',array('searchfield'=>'head_name','keyword' => $item['head_name'],'type'=>0,'ok'=>1));}">
  172. <span data-toggle="tooltip" data-placement="top" title="" data-original-title="查看订单明细">
  173. 查看订单明细
  174. </span>
  175. </a>
  176. <?php } ?>
  177. </td>
  178. </tr>
  179. <?php } ?>
  180. </tbody>
  181. <tfoot>
  182. <tr>
  183. <td colspan="3" style="padding-left: 0;">
  184. <!-- <div class="page-table-header">
  185. <input type="checkbox">
  186. </div> -->
  187. </td>
  188. <td colspan="7" style="text-align: right">
  189. {$pager}
  190. </td>
  191. </tr>
  192. </tfoot>
  193. </table>
  194. </div>
  195. </div>
  196. </form>
  197. <div class="row">
  198. <blockquote class="layui-elem-quote layui-text">
  199. # 下单佣金<br/>
  200. - 为团长下面的会员下单产生的佣金<br/>
  201. # 退款佣金、<br/>
  202. - 为售后订单退款,佣金减少的记录<br/>
  203. # 下级下单佣金,下级退款佣金<br/>
  204. - 为团长推荐的别人成为团长的佣金<br/>
  205. </blockquote>
  206. </div>
  207. </div>
  208. </div>
  209. </div>
  210. <script src="/layuiadmin/layui/layui.js"></script>
  211. <script>
  212. layui.config({
  213. base: '/layuiadmin/' //静态资源所在路径
  214. }).extend({
  215. index: 'lib/index' //主入口模块
  216. }).use('index');
  217. </script>
  218. <script>
  219. var layer = layui.layer;
  220. var $;
  221. layui.use(['jquery', 'layer','form'], function(){
  222. $ = layui.$;
  223. var form = layui.form;
  224. $('.deldom').click(function(){
  225. var s_url = $(this).attr('data-href');
  226. layer.confirm($(this).attr('data-confirm'), function(index){
  227. $.ajax({
  228. url:s_url,
  229. type:'post',
  230. dataType:'json',
  231. success:function(info){
  232. if(info.status == 0)
  233. {
  234. layer.msg(info.result.message,{icon: 1,time: 2000});
  235. }else if(info.status == 1){
  236. var go_url = location.href;
  237. if( info.result.hasOwnProperty("url") )
  238. {
  239. go_url = info.result.url;
  240. }
  241. layer.msg('操作成功',{time: 1000,
  242. end:function(){
  243. location.href = info.result.url;
  244. }
  245. });
  246. }
  247. }
  248. })
  249. });
  250. })
  251. $('.btn-operation').click(function(){
  252. var ids_arr = [];
  253. var obj = $(this);
  254. var s_toggle = $(this).attr('data-toggle');
  255. var s_url = $(this).attr('data-href');
  256. $("input[name=item_checkbox]").each(function() {
  257. if( $(this).prop('checked') )
  258. {
  259. ids_arr.push( $(this).val() );
  260. }
  261. })
  262. if(ids_arr.length < 1)
  263. {
  264. layer.msg('请选择要操作的内容');
  265. }else{
  266. var can_sub = true;
  267. if( s_toggle == 'batch-remove' )
  268. {
  269. can_sub = false;
  270. layer.confirm($(obj).attr('data-confirm'), function(index){
  271. $.ajax({
  272. url:s_url,
  273. type:'post',
  274. dataType:'json',
  275. data:{ids:ids_arr},
  276. success:function(info){
  277. if(info.status == 0)
  278. {
  279. layer.msg(info.result.message,{icon: 1,time: 2000});
  280. }else if(info.status == 1){
  281. var go_url = location.href;
  282. if( info.result.hasOwnProperty("url") )
  283. {
  284. go_url = info.result.url;
  285. }
  286. layer.msg('操作成功',{time: 1000,
  287. end:function(){
  288. location.href = info.result.url;
  289. }
  290. });
  291. }
  292. }
  293. })
  294. });
  295. }else{
  296. $.ajax({
  297. url:s_url,
  298. type:'post',
  299. dataType:'json',
  300. data:{ids:ids_arr},
  301. success:function(info){
  302. if(info.status == 0)
  303. {
  304. layer.msg(info.result.message,{icon: 1,time: 2000});
  305. }else if(info.status == 1){
  306. var go_url = location.href;
  307. if( info.result.hasOwnProperty("url") )
  308. {
  309. go_url = info.result.url;
  310. }
  311. layer.msg('操作成功',{time: 1000,
  312. end:function(){
  313. location.href = info.result.url;
  314. }
  315. });
  316. }
  317. }
  318. })
  319. }
  320. }
  321. })
  322. form.on('switch(statewsitch)', function(data){
  323. var s_url = $(this).attr('data-href')
  324. var s_value = 1;
  325. if(data.elem.checked)
  326. {
  327. s_value = 1;
  328. }else{
  329. s_value = 0;
  330. }
  331. $.ajax({
  332. url:s_url,
  333. type:'post',
  334. dataType:'json',
  335. data:{state:s_value},
  336. success:function(info){
  337. if(info.status == 0)
  338. {
  339. layer.msg(info.result.message,{icon: 1,time: 2000});
  340. }else if(info.status == 1){
  341. var go_url = location.href;
  342. if( info.result.hasOwnProperty("url") )
  343. {
  344. go_url = info.result.url;
  345. }
  346. layer.msg('操作成功',{time: 1000,
  347. end:function(){
  348. location.href = info.result.url;
  349. }
  350. });
  351. }
  352. }
  353. })
  354. });
  355. form.on('checkbox(checkboxall)', function(data){
  356. if(data.elem.checked)
  357. {
  358. $("input[name=item_checkbox]").each(function() {
  359. $(this).prop("checked", true);
  360. });
  361. $("input[name=checkall]").each(function() {
  362. $(this).prop("checked", true);
  363. });
  364. }else{
  365. $("input[name=item_checkbox]").each(function() {
  366. $(this).prop("checked", false);
  367. });
  368. $("input[name=checkall]").each(function() {
  369. $(this).prop("checked", false);
  370. });
  371. }
  372. form.render('checkbox');
  373. });
  374. //监听提交
  375. form.on('submit(formDemo)', function(data){
  376. $.ajax({
  377. url: data.form.action,
  378. type: data.form.method,
  379. data: data.field,
  380. dataType:'json',
  381. success: function (info) {
  382. if(info.status == 0)
  383. {
  384. layer.msg(info.result.message,{icon: 1,time: 2000});
  385. }else if(info.status == 1){
  386. var go_url = location.href;
  387. if( info.result.hasOwnProperty("url") )
  388. {
  389. go_url = info.result.url;
  390. }
  391. layer.msg('操作成功',{time: 1000,
  392. end:function(){
  393. location.href = info.result.url;
  394. }
  395. });
  396. }
  397. }
  398. });
  399. return false;
  400. });
  401. })
  402. </script>
  403. <script>
  404. $(function () {
  405. $('.btn-submit').click(function () {
  406. var e = $(this).data('export');
  407. if(e>0 ){
  408. if($('#keyword').val() !='' ){
  409. $('#export').val(e);
  410. $('#search').submit();
  411. }else if($('#searchtime').val()!=''){
  412. $('#export').val(e);
  413. $('#search').submit();
  414. }else{
  415. $('#export').val(e);
  416. $('#search').submit();
  417. }
  418. }else{
  419. $('#export').val(0);
  420. $('#search').submit();
  421. }
  422. })
  423. })
  424. </script>
  425. </body>
  426. </html>