orders.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <?php require_once 'header.php'?>
  2. <h3><span class="current">订单列表</span>&nbsp;&nbsp;</h3>
  3. <br>
  4. <div class="panel panel-default">
  5. <div class="panel-body">
  6. <form class="form-inline" action="" method="get">
  7. <div class="row"><div class="col-md-12">
  8. <div class="form-group">
  9. <select name="is_state" class="form-control">
  10. <option value="-1"<?php echo $search['is_state'] == '-1' ? ' selected' : '' ?>>全部订单状态</option>
  11. <option value="0"<?php echo $search['is_state'] == '0' ? ' selected' : '' ?>>未付款</option>
  12. <option value="1"<?php echo $search['is_state'] == '1' ? ' selected' : '' ?>>已付款</option>
  13. <option value="3"<?php echo $search['is_state'] == '3' ? ' selected' : '' ?>>已关闭</option>
  14. <option value="2"<?php echo $search['is_state'] == '2' ? ' selected' : '' ?>>已冻结</option>
  15. </select></div>
  16. <div class="form-group">
  17. <select name="is_checkout" class="form-control">
  18. <option value="-1"<?php echo $search['is_checkout'] == '-1' ? ' selected' : '' ?>>全部接入源</option>
  19. <option value="0"<?php echo $search['is_checkout'] == '0' ? ' selected' : '' ?>>商户接入</option>
  20. <option value="1"<?php echo $search['is_checkout'] == '1' ? ' selected' : '' ?>>收银台</option>
  21. </select></div>
  22. <div class="form-group">
  23. <input type="text" class="form-control" name="kw" placeholder="用户名/编号" value="<?php echo $search['kw'] ?>"></div>
  24. <div class="form-group">
  25. <input type="text" class="form-control" name="orderid" placeholder="平台订单号" value="<?php echo $search['orderid'] ?>"></div>
  26. <div class="form-group">
  27. <input type="text" class="form-control" name="sdorderno" placeholder="商户订单号" value="<?php echo $search['sdorderno'] ?>"></div></div>
  28. <div class="col-md-10" style="margin-top:10px"><div class="form-group">
  29. <select class="form-control" name="accid">
  30. <option value="0">全部通道</option>
  31. <?php foreach ($acc as $key => $val): ?>
  32. <option value="<?php echo $val['id'] ?>"<?php echo $val['id'] == $search['accid'] ? ' selected' : '' ?>>
  33. <?php echo $val['name'] ?></option>
  34. <?php endforeach; ?></select></div>
  35. <div class="form-group"><div class="input-group"><span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span><input size="16" type="text" name="fdate" readonly class="form_datetime form-control" value="<?php
  36. echo $search['fdate'] ?>"><span class="input-group-addon">至</span><input size="16" type="text" name="tdate" readonly class="form_datetime form-control" value="<?php
  37. echo $search['tdate'] ?>"></div></div>
  38. <div class="form-group">
  39. <select name="is_notify" class="form-control">
  40. <option value="-1"<?php echo $search['is_notify'] == '-1' ? ' selected' : '' ?>>全部通知状态</option>
  41. <option value="0"<?php echo $search['is_notify'] == '0' ? ' selected' : '' ?>>等待</option>
  42. <option value="1"<?php echo $search['is_notify'] == '1' ? ' selected' : '' ?>>成功</option>
  43. <option value="2"<?php echo $search['is_notify'] == '2' ? ' selected' : '' ?>>失败</option>
  44. </select></div></div><div style="margin-left:14px;"><button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-search"></span>&nbsp;立即查询</button></div>
  45. </div></form></div></div>
  46. <div style="margin-top:20px;margin-bottom:20px;text-align:center;font-size:12px;color:#666">提交订单数:<span class="blue"><?php
  47. echo $count['total_orders'] ?></span>&nbsp;&nbsp;订单总金额:<span class="blue">&yen; <?php
  48. echo number_format($count['total_money'], 2, '.', '') ?></span>&nbsp;&nbsp;已付订单数:<span class="green"><?php
  49. echo $count['success_orders'] ?></span>&nbsp;&nbsp;已付总金额:<span class="green">&yen; <?php
  50. echo number_format($count['success_money'], 2, '.', '') ?></span>&nbsp;&nbsp;用户收入:<span class="green">&yen; <?php
  51. echo number_format($count['income_user'], 2, '.', '') ?></span>&nbsp;&nbsp;平台收入:<span class="green">&yen; <?php
  52. echo number_format($count['income_pt'], 2, '.', '') ?></span>&nbsp;&nbsp;未付订单数:<span class="red"><?php
  53. echo $count['total_orders'] - $count['success_orders'] ?></span>&nbsp;&nbsp;未付总金额:<span class="red">&yen; <?php
  54. echo number_format($count['total_money'] - $count['success_money'], 2, '.', '') ?></span>&nbsp;&nbsp;</div>
  55. <div class="table-responsive"><table id="table-6" class="table table-hover ">
  56. <thead><tr class="info"><th width="100">用户编号</th><th>接入源</th><th>代理编号</th><th width="166">平台订单号</th><th>商户订单号</th><th>订单金额</th><th>实付金额</th><th>支付方式</th><th>商户收入</th><th>代理收入</th><th>平台收入</th><th>提交时间</th><th>处理时间</th><th>订单状态</th><th>通知状态</th><th>操作</th></tr></thead>
  57. <tbody><?php if ($lists): ?>
  58. <?php
  59. foreach ($lists as $key => $val):
  60. switch ($val['is_state']) {
  61. case '0':
  62. $state = '<span class="label label-warning">未付</span>';
  63. break;
  64. case '1':
  65. $state = '<span class="label label-success">已付</span>';
  66. break;
  67. case '2':
  68. $state = '<span class="label label-danger">冻结</span>';
  69. break;
  70. case '3':
  71. $state = '<span class="label label-default">关闭</span>';
  72. break;
  73. }
  74. $acc = $this->model()->select('name')->from('acc')->where(array(
  75. 'fields' => 'id=?',
  76. 'values' => array(
  77. $val['channelid']
  78. )
  79. ))->fetchRow();
  80. $accname = $acc ? $acc['name'] : '-';
  81. $notifyMsg = '-';
  82. $notify = $this->model()->select('is_status')->from('ordernotify')->where(array(
  83. 'fields' => 'orid=?',
  84. 'values' => array(
  85. $val['id']
  86. )
  87. ))->fetchRow();
  88. if ($notify) {
  89. switch ($notify['is_status']) {
  90. case '0':
  91. $notifyMsg = '<span class="label label-warning">等待</span>';
  92. break;
  93. case '1':
  94. $notifyMsg = '<span class="label label-success">成功</span>';
  95. break;
  96. case '2':
  97. $notifyMsg = '<span class="label label-danger">失败</span>';
  98. break;
  99. }
  100. } ?><tr data-id="<?php
  101. echo $val['id'] ?>"><td><div class="dropdown"><a href="javascript:;" class="dropdown-toggle" id="menulist" data-toggle="dropdown" aria-expanded="true"><?php
  102. echo $val['userid'] ?><span class="caret"></span><ul class="dropdown-menu" aria-labelledby="menulist"><li><a href="javascript:;" onclick="showContent('基本信息','<?php
  103. echo $this->dir ?>users/getuserinfo/<?php
  104. echo $val['userid'] ?>')"><span class="glyphicon glyphicon-triangle-right"></span>&nbsp;基本信息</a></li><li><a href="javascript:;" onclick="showContent('设置分成比率','<?php
  105. echo $this->dir ?>users/getuserprice/<?php
  106. echo $val['userid'] ?>')"><span class="glyphicon glyphicon-triangle-right"></span>&nbsp;分成比率</a></li><li><a href="javascript:;" onclick="showContent('收款信息','<?php
  107. echo $this->dir ?>users/getbadata/<?php
  108. echo $val['userid'] ?>')"><span class="glyphicon glyphicon-triangle-right"></span>&nbsp;收款信息</a></li><li><a href="javascript:;" onclick="showContent('接入信息','<?php
  109. echo $this->dir ?>users/getapidata/<?php
  110. echo $val['userid'] ?>')"><span class="glyphicon glyphicon-triangle-right"></span>&nbsp;接入信息</a></li><li><a href="<?php
  111. echo $this->dir ?>userlogs/?uname=<?php
  112. echo $val['userid'] ?>"><span class="glyphicon glyphicon-triangle-right"></span>&nbsp;登陆日志</a></li></ul></div></td><td><?php
  113. echo $val['is_paytype'] == '1' ? '收银台商户' : '线上商户' ?></td><td><?php
  114. if ($val['agentid']): ?><div class="dropdown"><a href="javascript:;" class="dropdown-toggle" id="menulist" data-toggle="dropdown" aria-expanded="true"><?php
  115. echo $val['agentid'] ?><span class="caret"></span><ul class="dropdown-menu" aria-labelledby="menulist"><li><a href="javascript:;" onclick="showContent('基本信息','<?php
  116. echo $this->dir ?>users/getuserinfo/<?php
  117. echo $val['agentid'] ?>')"><span class="glyphicon glyphicon-triangle-right"></span>&nbsp;基本信息</a></li><li><a href="javascript:;" onclick="showContent('设置分成比率','<?php
  118. echo $this->dir ?>users/getuserprice/<?php
  119. echo $val['agentid'] ?>')"><span class="glyphicon glyphicon-triangle-right"></span>&nbsp;分成比率</a></li><li><a href="javascript:;" onclick="showContent('收款信息','<?php
  120. echo $this->dir ?>users/getbadata/<?php
  121. echo $val['agentid'] ?>')"><span class="glyphicon glyphicon-triangle-right"></span>&nbsp;收款信息</a></li><li><a href="javascript:;" onclick="showContent('接入信息','<?php
  122. echo $this->dir ?>users/getapidata/<?php
  123. echo $val['agentid'] ?>')"><span class="glyphicon glyphicon-triangle-right"></span>&nbsp;接入信息</a></li></ul></div><?php
  124. else: ?>-<?php
  125. endif; ?></td><td><div class="dropdown"><a href="javascript:;" class="dropdown-toggle" id="menulist" data-toggle="dropdown" aria-expanded="true"><?php
  126. echo $val['orderid'] ?><span class="caret"></span><ul class="dropdown-menu" aria-labelledby="menulist"><li><a href="javascript:;" onclick="showContent('订单详情','<?php
  127. echo $this->dir ?>orders/getorderinfo/<?php
  128. echo $val['id'] ?>')"><span class="glyphicon glyphicon-triangle-right"></span>&nbsp;订单详情</a></li><li><a href="javascript:;" onclick="showContent('通知详情','<?php
  129. echo $this->dir ?>orders/getnotifyinfo/<?php
  130. echo $val['id'] ?>')"><span class="glyphicon glyphicon-triangle-right"></span>&nbsp;通知详情</a></li></ul></div></td><td><?php
  131. echo $val['sdorderno'] ?><br><span class="gray"><?php
  132. echo $val['remark'] ?></span></td><td><?php
  133. echo $val['total_fee'] ?></td><td class="green"><?php
  134. echo $val['realmoney'] ?></td><td class="gray"><?php
  135. echo $accname ?></td><td class="blue"><?php
  136. echo $val['uprice'] * $val['realmoney'] ?></td><td class="red"><?php
  137. echo $val['gprice'] > 0 ? ($val['gprice'] - $val['uprice']) * $val['realmoney'] : '0.00' ?></td><td class="green"><?php
  138. echo $val['gprice'] > 0 ? ($val['wprice'] - $val['gprice']) * $val['realmoney'] : ($val['wprice'] - $val['uprice']) * $val['realmoney'] ?></td><td><?php
  139. echo date('m-d H:i:s', $val['addtime']) ?></td><td><?php
  140. echo date('m-d H:i:s', $val['lastime']) ?></td><td class="state<?php
  141. echo $val['id'] ?>"><?php
  142. echo $state ?></td><td><?php
  143. echo $notifyMsg ?></td><td width="70"><a href="javascript:;" onclick="pushOrder('<?php
  144. echo $val['orderid'] ?>')" data-toggle="tooltip" title="通知"><span class="glyphicon glyphicon-refresh"></span></a>&nbsp;<a href="javascript:;" onclick="del(<?php
  145. echo $val['id'] ?>,'<?php
  146. echo $this->dir ?>orders/del')" data-toggle="tooltip" title="删除"><span class="glyphicon glyphicon-trash"></span></a>&nbsp;<a href="javascript:;" onclick="freeze(<?php
  147. echo $val['id'] ?>,'<?php
  148. echo $this->dir ?>orders/freeze')" data-toggle="tooltip" class="freeze<?php
  149. echo $val['id'] ?>" title="<?php
  150. echo $val['freeze'] ? '还原' : '冻结' ?>订单"><?php
  151. echo $val['freeze'] ? '还' : '冻' ?></a></td></tr><?php
  152. endforeach; ?><?php
  153. else: ?><tr><td colspan="16">no data.</td><?php
  154. endif; ?></tbody></table></div><?php
  155. echo $lists ? $pagelist : '' ?><br><br><script>function pushOrder(orderid){$.post('<?php
  156. echo $this->dir ?>orders/notify',{orderid:orderid,t:new Date().getTime()},function(ret){alert('收到回复:\r\n'+ret);});}</script>
  157. <?php require_once 'footer.php' ?>