order.php 9.1 KB

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