orders.php 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <?php require_once 'header.php' ?>
  2. <div class="row wrapper wrapper-content">
  3. <div class="row">
  4. <div class="col-md-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. <div style="background:#fff;padding:20px 15px;border:1px solid #ddd">
  15. <form class="form-inline" action="" method="get">
  16. <select name="is_state" class="form-control">
  17. <option value="-1" <?php echo $search['is_state']=='-1' ? ' selected'
  18. : ''?>
  19. >全部
  20. </option>
  21. <option value="0" <?php echo $search['is_state']=='0' ? ' selected' :
  22. ''?>
  23. >未付款
  24. </option>
  25. <option value="1" <?php echo $search['is_state']=='1' ? ' selected' :
  26. ''?>
  27. >已付款
  28. </option>
  29. </select>
  30. <input type="text" class="form-control" name="sdorderno" placeholder="商户订单号"
  31. value="<?php echo $search['sdorderno']?>" size="15">
  32. <input type="text" class="form-control" name="sdpayno" placeholder="平台订单号"
  33. value="<?php echo $search['sdpayno']?>" size="15">
  34. <div class="input-group">
  35. <span class="input-group-addon">
  36. <span class="glyphicon glyphicon-calendar">
  37. </span>
  38. </span>
  39. <input size="16" type="text" name="fdate" readonly class="form_datetime form-control"
  40. value="<?php echo $search['fdate']?>">
  41. <span class="input-group-addon">
  42. </span>
  43. <input size="16" type="text" name="tdate" readonly class="form_datetime form-control"
  44. value="<?php echo $search['tdate']?>">
  45. </div>
  46. <button type="submit" class="btn btn-primary">
  47. <span class="glyphicon glyphicon-search">
  48. </span>
  49. &nbsp;立即查询
  50. </button>
  51. </form>
  52. </div>
  53. <div class="content-box">
  54. <table class="table table-hover">
  55. <thead>
  56. <tr>
  57. <th>
  58. 订单时间
  59. </th>
  60. <th>
  61. 商户编号
  62. </th>
  63. <th>
  64. 商户订单号
  65. </th>
  66. <th>
  67. 平台订单号
  68. </th>
  69. <th>
  70. 订单金额
  71. </th>
  72. <th>
  73. 实付金额
  74. </th>
  75. <th>
  76. 商户收入
  77. </th>
  78. <th>
  79. 代理收入
  80. </th>
  81. <th>
  82. 付款渠道
  83. </th>
  84. <th>
  85. 订单状态
  86. </th>
  87. <th>
  88. 通知
  89. </th>
  90. </tr>
  91. </thead>
  92. <tbody>
  93. <?php if($lists):?>
  94. <?php foreach($lists as $key=>
  95. $val):$orderinfo=$this->model()->select('remark')->from('orderinfo')->where(array('fields'=>'id=?','values'=>array($val['orderinfoid'])))->fetchRow();$remark=$orderinfo
  96. ? $orderinfo['remark'] : '-';$acc=$this->model()->select('name')->from('acc')->where(array('fields'=>'id=?','values'=>array($val['channelid'])))->fetchRow();$cname=$acc
  97. ? $acc['name'] : '-';switch($val['is_state']){case 0: $state='
  98. <span class="label label-warning">
  99. 未付
  100. </span>
  101. '; break;case 1: $state='
  102. <span class="label label-success">
  103. 已付
  104. </span>
  105. '; break;case 2: $state='
  106. <span class="label label-danger">
  107. 冻结
  108. </span>
  109. '; break;case 3: $state='
  110. <span class="label label-danger">
  111. 关闭
  112. </span>
  113. '; break;}?>
  114. <tr>
  115. <td>
  116. <?php echo date( 'm-d H:i:s',$val['addtime'])?>
  117. </td>
  118. <td>
  119. <?php echo $val['userid']?>
  120. </td>
  121. <td>
  122. <?php echo $val['sdorderno']?>
  123. <br>
  124. <span class="gray">
  125. <?php echo $remark ?>
  126. </span>
  127. </td>
  128. <td>
  129. <?php echo $val['orderid']?>
  130. </td>
  131. <td>
  132. <?php echo $val['total_fee']?>
  133. </td>
  134. <td class="green">
  135. <?php echo $val['realmoney']?>
  136. </td>
  137. <td class="green">
  138. <?php echo $val['realmoney']*$val['uprice']?>
  139. </td>
  140. <td class="green">
  141. <?php echo $val['realmoney']*($val['gprice']-$val['uprice'])?>
  142. </td>
  143. <td>
  144. <?php echo $cname ?>
  145. </td>
  146. <td>
  147. <?php echo $state ?>
  148. </td>
  149. <td>
  150. <a href="javascript:;" onclick="refresh('<?php echo $val['orderid']?>')">
  151. <span class="glyphicon glyphicon-refresh" data-toggle="tooltip" title="通知">
  152. </span>
  153. </a>
  154. </td>
  155. </tr>
  156. <?php endforeach;?>
  157. <?php else:?>
  158. <tr>
  159. <td colspan="11" class="text-center">
  160. no data.
  161. </td>
  162. </tr>
  163. <?php endif;?>
  164. </tbody>
  165. </table>
  166. <?php if($lists):?>
  167. <div style="float:right">
  168. <?php echo $pagelist ?>
  169. </div>
  170. <br>
  171. <br>
  172. <?php endif;?>
  173. </div>
  174. </div></div>
  175. </div></div></div></div>
  176. <script>
  177. function refresh(sdpayno) {
  178. $.post('/agent/orders/refresh', {
  179. sdpayno: sdpayno,
  180. t: new Date().getTime()
  181. },
  182. function(ret) {
  183. alert(ret);
  184. });
  185. }
  186. </script>
  187. <?php require_once 'footer.php' ?>