order.php 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. <?php
  2. $excel = false;
  3. $excel[] = array('数据导出','数据导出','active/lib/excel.out_active_order');
  4. $list_button = array();
  5. if (Dever::load('manage/auth')->checkFunc('active.order', 'editRefund', '全额退款')) {
  6. $list_button['oper'] = array('全额退款', '"active/lib/manage.refund?id={id}"', '{status} == 2');
  7. }
  8. $pay_type = array
  9. (
  10. 1 => '在线支付',
  11. );
  12. $status = array
  13. (
  14. 1 => '待支付',
  15. 2 => '已支付',
  16. 3 => '已关闭',#超时未支付
  17. 4 => '已完成',
  18. 5 => '已完成(有退款)',
  19. 6 => '已退款',#(全部退款)
  20. );
  21. $active = function()
  22. {
  23. $array = array();
  24. $info = Dever::load('active/info-state');
  25. if($info)
  26. {
  27. $array += $info;
  28. }
  29. return $array;
  30. };
  31. return array
  32. (
  33. # 表名
  34. 'name' => 'order',
  35. # 显示给用户看的名称
  36. 'lang' => '活动订单',
  37. 'order' => 100,
  38. 'config_status' => $status,
  39. 'config_pay_type' => $pay_type,
  40. # 数据结构
  41. 'struct' => array
  42. (
  43. 'id' => array
  44. (
  45. 'type' => 'int-11',
  46. 'name' => 'ID',
  47. 'default' => '',
  48. 'desc' => '',
  49. 'match' => 'is_numeric',
  50. 'search' => 'order',
  51. // 'list' => true,
  52. ),
  53. 'order_num' => array
  54. (
  55. 'type' => 'varchar-100',
  56. 'name' => '订单单号',
  57. 'default' => '',
  58. 'desc' => '订单单号',
  59. 'match' => 'is_string',
  60. 'update' => 'text',
  61. 'search' => 'fulltext',
  62. 'list' => true,
  63. ),
  64. 'mid' => array
  65. (
  66. 'type' => 'int-11',
  67. 'name' => '代理商姓名/手机号',
  68. 'default' => '-1',
  69. 'desc' => '代理商',
  70. 'match' => 'is_string',
  71. 'update' => 'text',
  72. 'search' => array
  73. (
  74. 'api' => 'agent/member-getSearch',
  75. 'col' => 'col',
  76. 'result' => 'id',
  77. 'search' => 'mid',
  78. ),
  79. 'list_name' => '代理商信息',
  80. 'list' => 'Dever::load("agent/lib/member.getOne", {mid}, "agent/member", true)',
  81. ),
  82. 'active_id' => array
  83. (
  84. 'type' => 'int-11',
  85. 'name' => '活动名称',
  86. 'default' => '-1',
  87. 'desc' => '活动名称',
  88. 'match' => 'is_string',
  89. 'option' => $active,
  90. 'update' => 'text',
  91. // 'search' => 'text',
  92. 'list' => true,
  93. ),
  94. 'num' => array
  95. (
  96. 'type' => 'varchar-100',
  97. 'name' => '数量',
  98. 'default' => '',
  99. 'desc' => '数量',
  100. 'match' => 'option',
  101. 'list' => true,
  102. ),
  103. 'price' => array
  104. (
  105. 'type' => 'varchar-50',
  106. 'name' => '金额',
  107. 'default' => '0',
  108. 'desc' => '金额',
  109. 'match' => 'option',
  110. 'update' => 'text',
  111. 'list' => true,
  112. ),
  113. 'status' => array
  114. (
  115. 'type' => 'tinyint-1',
  116. 'name' => '支付状态',
  117. 'default' => '1',
  118. 'desc' => '支付状态',
  119. 'match' => 'is_numeric',
  120. 'option' => $status,
  121. 'search' => 'select',
  122. 'list' => true,
  123. ),
  124. 'pay_type' => array
  125. (
  126. 'type' => 'tinyint-1',
  127. 'name' => '支付类型',
  128. 'default' => '1',
  129. 'desc' => '支付类型',
  130. 'match' => 'is_numeric',
  131. 'option' => $pay_type,
  132. 'search' => 'select',
  133. 'list' => true,
  134. ),
  135. 'remark' => array
  136. (
  137. 'type' => 'varchar-300',
  138. 'name' => '订单备注',
  139. 'default' => '',
  140. 'desc' => '订单备注',
  141. 'match' => 'option',
  142. 'update' => 'textarea',
  143. ),
  144. 'url' => array
  145. (
  146. 'type' => 'varchar-3000',
  147. 'name' => '支付链接',
  148. 'default' => '',
  149. 'desc' => '支付链接',
  150. 'match' => 'is_string',
  151. // 'update' => 'fulltext',
  152. //'search' => 'fulltext',
  153. //'list' => true,
  154. ),
  155. 'refund_admin' => array
  156. (
  157. 'type' => 'int-11',
  158. 'name' => '退款操作人',
  159. 'default' => '',
  160. 'desc' => '',
  161. 'match' => 'is_numeric',
  162. // 'search' => 'order',
  163. 'list_name' => '退款操作人<br>退款时间',
  164. 'list' => 'Dever::load("active/lib/manage.show",{id})',
  165. ),
  166. 'rdate' => array
  167. (
  168. 'type' => 'int-11',
  169. 'name' => '退款时间',
  170. 'default' => '',
  171. 'match' => 'is_numeric',
  172. 'search' => 'date',
  173. // 'desc' => '',
  174. // 'list' => 'date("Y-m-d H:i:s", {zdate})',
  175. ),
  176. 'state' => array
  177. (
  178. 'type' => 'tinyint-1',
  179. 'name' => '状态',
  180. 'default' => '1',
  181. 'desc' => '请选择状态',
  182. 'match' => 'is_numeric',
  183. ),
  184. 'cdate' => array
  185. (
  186. 'type' => 'int-11',
  187. 'name' => '下单时间',
  188. 'match' => array('is_numeric', time()),
  189. 'desc' => '',
  190. # 只有insert时才生效
  191. 'insert' => true,
  192. //'search' => 'date',
  193. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  194. //'list' => 'Dever::load("service/lib/manage.showOrderTime", "{id}")',
  195. ),
  196. ),
  197. 'manage' => array
  198. (
  199. 'delete' => false,
  200. 'edit' => false,
  201. 'insert' => false,
  202. 'excel' => $excel,
  203. 'list_button' => $list_button,
  204. ),
  205. 'request' => array
  206. (
  207. // # 获取数量
  208. 'getNum' => array
  209. (
  210. # 匹配的正则或函数 选填项
  211. 'option' => array
  212. (
  213. 'mid' => 'yes',
  214. 'active_id' => 'yes',
  215. 'status' =>2,
  216. 'state' => 1,
  217. ),
  218. 'type' => 'one',
  219. 'col' => 'sum(num) as total',
  220. ),
  221. 'getAll' => array
  222. (
  223. # 匹配的正则或函数 选填项
  224. 'option' => array
  225. (
  226. 'mid' => 'yes',
  227. 'status' => array('yes','!='),
  228. 'state' => 1,
  229. ),
  230. 'type' => 'all',
  231. 'order' => array('cdate'=>'desc'),
  232. 'page' => array(20,'list'),
  233. 'col' => '*',
  234. ),
  235. ),
  236. );