orders.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. <?php require_once 'header.php' ?>
  2. <div class="row wrapper wrapper-content">
  3. <div class="row">
  4. <div class="col-lg-12">
  5. <div class="panel panel-default">
  6. <div class="panel-heading">
  7. <div class="panel-title">
  8. <em class="fa fa-list">
  9. </em>
  10. <?php echo $title ?>
  11. </div>
  12. </div>
  13. <div class="panel-body">
  14. &nbsp;&nbsp;
  15. <span style="margin-top:-20px;margin-bottom:20px;text-align:center;font-size:12px;color:#666">
  16. 提交订单数:
  17. <span class="blue"> <?php echo $count['total_orders']?>
  18. </span>
  19. &nbsp;&nbsp;订单总金额:
  20. <span class="blue">
  21. &yen;
  22. <?php echo number_format($count['total_money'],2, '.', '')?>
  23. </span>
  24. &nbsp;&nbsp;已付订单数:
  25. <span class="green"><?php echo $count['success_orders']?>
  26. </span>
  27. &nbsp;&nbsp;已付总金额:
  28. <span class="green">&yen;<?php echo number_format($count['success_money'],2, '.', '')?>
  29. </span>
  30. &nbsp;&nbsp;预计收入:<span class="green">&yen;<?php echo number_format($count['income_user'],2, '.', '')?>
  31. </span>
  32. &nbsp;&nbsp;未付订单数:
  33. <span class="red"> <?php echo $count['total_orders']-$count['success_orders'] ?>
  34. </span>
  35. 未付总金额:
  36. <span class="red">&yen;<?php echo number_format($count['total_money']-$count['success_money'],2, '.', '')?>
  37. </span>
  38. &nbsp;&nbsp;
  39. </span><br><br>
  40. <form method="get" class="form-inline m-b-xs" action="" method="get">
  41. <div class="form-group">
  42. <select name="is_state" class="form-control">
  43. <option value="-1" <?php echo $search['is_state']=='-1' ? ' selected' : ''?>>全部
  44. </option>
  45. <option value="0" <?php echo $search['is_state']=='0' ? ' selected' : ''?>>未付款
  46. </option>
  47. <option value="1" <?php echo $search['is_state']=='1' ? ' selected' : ''?>>已付款
  48. </option>
  49. </select>
  50. </div>
  51. &nbsp;&nbsp;
  52. <div class="form-group">
  53. <select class="form-control" name="accid">
  54. <option value="0">
  55. 全部通道
  56. </option>
  57. <?php foreach($acc as $key=>
  58. $val):?>
  59. <option value="<?php echo $val['id']?>" <?php echo $val['id']==$search[
  60. 'accid'] ? ' selected' : ''?>>
  61. <?php echo $val['name']?>
  62. </option>
  63. <?php endforeach;?>
  64. </select>
  65. </div>
  66. &nbsp;&nbsp;
  67. <div class="form-group">
  68. <input type="text" class="form-control" name="sdorderno" placeholder="商户订单号"
  69. value="<?php echo $search['sdorderno']?>" size="15">
  70. </div>
  71. &nbsp;&nbsp;
  72. <div class="form-group">
  73. <input type="text" class="form-control" name="sdpayno" placeholder="平台订单号"
  74. value="<?php echo $search['sdpayno']?>" size="15">
  75. </div>
  76. &nbsp;&nbsp;
  77. <div class="form-group">
  78. <div class="input-group">
  79. <span class="input-group-addon">
  80. <i class="fa fa-calendar"></i>
  81. </span>
  82. <input size="16" type="text" name="fdate" readonly class="form_datetime form-control"
  83. value="<?php echo $search['fdate']?>">
  84. <span class="input-group-addon">
  85. </span>
  86. <input size="16" type="text" name="tdate" readonly class="form_datetime form-control"
  87. value="<?php echo $search['tdate']?>">
  88. </div>
  89. </div>
  90. &nbsp;&nbsp;
  91. <button type="submit" class="btn btn-primary">
  92. <i class="fa fa-search"></i>
  93. &nbsp;立即查询
  94. </button>
  95. </form>
  96. <?php if($search['is_state']=='1' ): ?>
  97. <div class="cb-title">
  98. <span class="glyphicon glyphicon-stats">
  99. </span>
  100. &nbsp;订单对比&nbsp;&nbsp;
  101. <span style="margin-top:-20px;margin-bottom:20px;text-align:center;font-size:12px;color:#666">
  102. 昨日此时订单:
  103. <span class="red">
  104. <?php echo $yestoday_orders ?>
  105. </span>
  106. &nbsp;&nbsp;今日此时订单:
  107. <span class="red">
  108. <?php echo $count['success_orders']?>
  109. </span>
  110. &nbsp;&nbsp;
  111. <?php echo ($result_order=$count['success_orders']-$yestoday_orders)>
  112. 0 ? '
  113. <span class="green">
  114. ↑'.$result_order.'
  115. </span>
  116. ' : '
  117. <span class="red">
  118. ↓'.($yestoday_orders-$count['success_orders']).'
  119. </span>
  120. '?>&nbsp;&nbsp;昨日此时金额:
  121. <span class="red">
  122. <?php echo $yestoday_money['realmoney'] ?>
  123. </span>
  124. &nbsp;&nbsp;今日此时金额:
  125. <span class="red">
  126. <?php echo $count['success_money']?>
  127. </span>
  128. &nbsp;&nbsp;
  129. <?php echo ($result_money=$count['success_money']-$yestoday_money['realmoney'])>0 ? '<span class="green">↑'.$result_money.' </span>' : '<span class="red">↓'.($yestoday_money['realmoney']-$count['success_money']).'</span>'?>
  130. </span>
  131. </div>
  132. <?php endif?>
  133. <div class="table-responsive">
  134. <table class="table table-bordered">
  135. <thead>
  136. <tr>
  137. <th>
  138. 订单时间
  139. </th>
  140. <th>
  141. 商户订单号
  142. </th>
  143. <th>
  144. 平台订单号
  145. </th>
  146. <th>
  147. 订单金额
  148. </th>
  149. <th>
  150. 实付金额
  151. </th>
  152. <th>
  153. 收入金额
  154. </th>
  155. <th>
  156. 付款渠道
  157. </th>
  158. <th>
  159. 订单状态
  160. </th>
  161. <th>
  162. 通知状态
  163. </th>
  164. <th>
  165. 通知
  166. </th>
  167. </tr>
  168. </thead>
  169. <tbody>
  170. <?php if($lists):?>
  171. <?php foreach($lists as $key=>$val):$orderinfo=$this->model()->select('remark')->from('orderinfo')->where(array('fields'=>'id=?','values'=>array($val['orderinfoid'])))->fetchRow();$remark=$orderinfo ? $orderinfo['remark'] : '-';$acc=$this->model()->select('name')->from('acc')->where(array('fields'=>'id=?','values'=>array($val['channelid'])))->fetchRow();$cname=$acc ? $acc['name'] : '-';switch($val['is_state']){case 0: $state='
  172. <span class="label label-warning">未付 </span>'; break;case 1: $state='<span class="label label-success"> 已付 </span>'; break;case 2: $state=' <span class="label label-danger">冻结</span>'; break;default:$state='-';}$notifyMsg='-';$notify=$this->model()->select('is_status')->from('ordernotify')->where(array('fields'=>'orid=?','values'=>array($val['id'])))->fetchRow();if($notify){switch($notify['is_status']){case '0': $notifyMsg='<span class="label label-warning">等待 </span>'; break;case '1': $notifyMsg=' <span class="label label-success">成功 </span>'; break;case '2': $notifyMsg='
  173. <span class="label label-danger">失败</span>'; break;}}?>
  174. <tr>
  175. <td class="text-center blue">
  176. <?php echo date( 'm-d H:i:s',$val['addtime'])?>
  177. </td>
  178. <td class="text-center ">
  179. <?php echo $val['sdorderno']?>
  180. <br>
  181. <span class="gray">
  182. <?php echo $remark ?>
  183. </span>
  184. </td>
  185. <td class="text-center">
  186. <?php echo $val['orderid']?>
  187. </td>
  188. <td class="text-center">
  189. <?php echo $val['total_fee']?>
  190. </td>
  191. <td class="text-center green">
  192. <?php echo $val['realmoney']?>
  193. </td>
  194. <td class="text-center green">
  195. <?php echo $val['realmoney']*$val['uprice']?>
  196. </td>
  197. <td class="text-center">
  198. <?php echo $cname ?>
  199. </td>
  200. <td class="text-center">
  201. <?php echo $state ?>
  202. </td>
  203. <td class="text-center">
  204. <?php echo $notifyMsg ?>
  205. </td>
  206. <td class="text-center">
  207. <a href="javascript:;" onclick="refresh('<?php echo $val['orderid']?>')">
  208. <span class="glyphicon glyphicon-refresh" data-toggle="tooltip" title="通知">
  209. </span>
  210. </a>
  211. </td>
  212. </tr>
  213. <?php endforeach;?>
  214. <?php else:?>
  215. <tr>
  216. <td class="text-center" colspan="10">
  217. <h4>
  218. 暂无记录
  219. </h4>
  220. </td>
  221. </tr>
  222. <?php endif;?>
  223. </tbody>
  224. </table>
  225. </div> <?php if($lists):?>
  226. <div class="dataTables_paginate">
  227. <ul class="pagination">
  228. <?php echo $pagelist ?>
  229. </u>
  230. </div>
  231. <?php endif;?>
  232. </div>
  233. </div>
  234. </div>
  235. </div>
  236. </div>
  237. </div>
  238. <script>
  239. function refresh(sdpayno) {
  240. $.post('/member/orders/refresh', {
  241. sdpayno: sdpayno,
  242. t: new Date().getTime()
  243. },
  244. function(ret) {
  245. alert(ret);
  246. });
  247. }
  248. </script>
  249. <?php require_once 'footer.php' ?>