order.php 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  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 && "{code_num}" < 0');
  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_name' => '用户信息',
  95. 'list' => 'Dever::load("active/lib/manage.user", {uid})',
  96. ),
  97. 'active_id' => array
  98. (
  99. 'type' => 'int-11',
  100. 'name' => '活动名称',
  101. 'default' => '-1',
  102. 'desc' => '活动名称',
  103. 'match' => 'is_string',
  104. 'option' => $active,
  105. 'update' => 'text',
  106. // 'search' => 'text',
  107. 'list' => true,
  108. ),
  109. 'num' => array
  110. (
  111. 'type' => 'varchar-100',
  112. 'name' => '数量',
  113. 'default' => '',
  114. 'desc' => '数量',
  115. 'match' => 'option',
  116. 'list' => true,
  117. ),
  118. 'price' => array
  119. (
  120. 'type' => 'varchar-50',
  121. 'name' => '金额',
  122. 'default' => '0',
  123. 'desc' => '金额',
  124. 'match' => 'option',
  125. 'update' => 'text',
  126. 'list' => true,
  127. ),
  128. 'status' => array
  129. (
  130. 'type' => 'tinyint-1',
  131. 'name' => '支付状态',
  132. 'default' => '1',
  133. 'desc' => '支付状态',
  134. 'match' => 'is_numeric',
  135. 'option' => $status,
  136. 'search' => 'select',
  137. 'list' => true,
  138. ),
  139. 'pay_type' => array
  140. (
  141. 'type' => 'tinyint-1',
  142. 'name' => '支付类型',
  143. 'default' => '1',
  144. 'desc' => '支付类型',
  145. 'match' => 'is_numeric',
  146. 'option' => $pay_type,
  147. 'search' => 'select',
  148. 'list' => true,
  149. ),
  150. 'path' => array
  151. (
  152. 'type' => 'varchar-300',
  153. 'name' => '自定义字段',
  154. 'default' => '',
  155. 'desc' => '自定义字段',
  156. 'match' => 'option',
  157. // 'update' => 'textarea',
  158. ),
  159. 'code_num' => array
  160. (
  161. 'type' => 'varchar-100',
  162. 'name' => '已使用数量',
  163. 'default' => '-1',
  164. 'desc' => '已使用数量',
  165. 'match' => 'option',
  166. // 'list' => true,
  167. ),
  168. 'no_num' => array
  169. (
  170. 'type' => 'varchar-100',
  171. 'name' => '未核销数量',
  172. 'default' => '0',
  173. 'desc' => '未核销数量',
  174. 'match' => 'option',
  175. // 'list' => true,
  176. ),
  177. 'refund_num' => array
  178. (
  179. 'type' => 'varchar-100',
  180. 'name' => '退款数量',
  181. 'default' => '0',
  182. 'desc' => '退款数量',
  183. 'match' => 'option',
  184. // 'list' => true,
  185. ),
  186. 'remark' => array
  187. (
  188. 'type' => 'varchar-300',
  189. 'name' => '订单备注',
  190. 'default' => '',
  191. 'desc' => '订单备注',
  192. 'match' => 'option',
  193. 'update' => 'textarea',
  194. ),
  195. 'url' => array
  196. (
  197. 'type' => 'varchar-3000',
  198. 'name' => '支付链接',
  199. 'default' => '',
  200. 'desc' => '支付链接',
  201. 'match' => 'is_string',
  202. // 'update' => 'fulltext',
  203. //'search' => 'fulltext',
  204. //'list' => true,
  205. ),
  206. 'refund_admin' => array
  207. (
  208. 'type' => 'int-11',
  209. 'name' => '退款操作人',
  210. 'default' => '',
  211. 'desc' => '',
  212. 'match' => 'is_numeric',
  213. // 'search' => 'order',
  214. 'list_name' => '退款操作人<br>退款时间',
  215. 'list' => 'Dever::load("active/lib/manage.show",{id})',
  216. ),
  217. 'rdate' => array
  218. (
  219. 'type' => 'int-11',
  220. 'name' => '退款时间',
  221. 'default' => '',
  222. 'match' => 'is_numeric',
  223. 'search' => 'date',
  224. // 'desc' => '',
  225. // 'list' => 'date("Y-m-d H:i:s", {zdate})',
  226. ),
  227. 'state' => array
  228. (
  229. 'type' => 'tinyint-1',
  230. 'name' => '状态',
  231. 'default' => '1',
  232. 'desc' => '请选择状态',
  233. 'match' => 'is_numeric',
  234. ),
  235. 'cdate' => array
  236. (
  237. 'type' => 'int-11',
  238. 'name' => '下单时间',
  239. 'match' => array('is_numeric', time()),
  240. 'desc' => '',
  241. # 只有insert时才生效
  242. 'insert' => true,
  243. //'search' => 'date',
  244. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  245. //'list' => 'Dever::load("service/lib/manage.showOrderTime", "{id}")',
  246. ),
  247. ),
  248. 'manage' => array
  249. (
  250. 'delete' => false,
  251. 'edit' => false,
  252. 'insert' => false,
  253. 'excel' => $excel,
  254. 'list_button' => $list_button,
  255. ),
  256. 'request' => array
  257. (
  258. // # 获取数量
  259. 'getNum' => array
  260. (
  261. # 匹配的正则或函数 选填项
  262. 'option' => array
  263. (
  264. 'mid' => 'yes',
  265. 'uid' => 'yes',
  266. 'active_id' => 'yes',
  267. 'status' => array('yes', 'in'),
  268. 'state' => 1,
  269. ),
  270. 'type' => 'one',
  271. 'col' => 'sum(num-refund_num) as total',
  272. ),
  273. 'getAll' => array
  274. (
  275. # 匹配的正则或函数 选填项
  276. 'option' => array
  277. (
  278. 'mid' => 'yes',
  279. 'uid' => 'yes',
  280. 'status' => array('yes','!='),
  281. 'state' => 1,
  282. ),
  283. 'type' => 'all',
  284. 'order' => array('cdate'=>'desc'),
  285. 'page' => array(20,'list'),
  286. 'col' => '*',
  287. ),
  288. ),
  289. );