order.php 9.7 KB

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