ticket_order.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502
  1. <?php
  2. # 系统
  3. $system_source = Dever::config('base')->system_source;
  4. $status = Dever::config('base', 'pay')->pay['status'];
  5. $info = function()
  6. {
  7. return Dever::db('collection/info')->state();
  8. };
  9. $buy = function()
  10. {
  11. return Dever::db('collection/buy')->state();
  12. };
  13. # 获取分类权限
  14. $auth = Dever::tops();
  15. $cate = function() use ($auth)
  16. {
  17. $array = array();
  18. if ($auth) {
  19. $info = Dever::db('collection/cate')->getIds(array('ids' => $auth));
  20. } else {
  21. $info = Dever::db('collection/cate')->state();
  22. }
  23. if($info)
  24. {
  25. $array += $info;
  26. }
  27. return $array;
  28. };
  29. return array
  30. (
  31. # 表名
  32. 'name' => 'ticket_order',
  33. # 显示给用户看的名称
  34. 'lang' => '门票订单',
  35. 'order' => 1,
  36. 'end' => array
  37. (
  38. 'update' => 'user/lib/manage.refund',
  39. ),
  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_id' => array
  54. (
  55. 'type' => 'varchar-100',
  56. 'name' => '支付订单ID/订单表ID',
  57. 'default' => '',
  58. 'desc' => '付款订单id',
  59. 'match' => 'is_string',
  60. 'update' => 'text',
  61. 'search' => 'fulltext',
  62. //'list' => true,
  63. 'list' => 'Dever::load("user/lib/ticket.getOrderIdAndId", "{order_id}", {id})',
  64. ),
  65. 'uid' => array
  66. (
  67. 'type' => 'int-11',
  68. 'name' => '用户名',
  69. 'default' => '',
  70. 'desc' => '用户id',
  71. 'match' => 'is_numeric',
  72. 'search' => array
  73. (
  74. 'api' => 'passport/user-all',
  75. 'col' => 'username',
  76. 'result' => 'id',
  77. ),
  78. 'update' => 'text',
  79. ),
  80. 'parent_uid' => array
  81. (
  82. 'type' => 'int-11',
  83. 'name' => '邀请人',
  84. 'default' => '',
  85. 'desc' => '邀请人',
  86. 'match' => 'is_numeric',
  87. 'update' => 'text',
  88. ),
  89. 'system_source' => array
  90. (
  91. 'type' => 'tinyint-1',
  92. 'name' => '所属平台',
  93. 'default' => '1',
  94. 'desc' => '所属平台',
  95. 'match' => 'is_numeric',
  96. 'option' => $system_source,
  97. 'update' => 'radio',
  98. 'search' => 'select',
  99. 'list' => true,
  100. ),
  101. # 仅用于搜索
  102. 'cate_info_search' => array
  103. (
  104. 'name' => '合集',
  105. 'default' => '',
  106. 'desc' => '合集',
  107. 'search' => 'linkage',
  108. 'search_col' => 'cate_id,info_id',
  109. 'option' => Dever::url('lib/manage.search_cate_journal', 'collection'),
  110. ),
  111. 'cate_id' => array
  112. (
  113. 'type' => 'int-11',
  114. 'name' => '合集分类',
  115. 'default' => '1',
  116. 'desc' => '合集分类',
  117. 'match' => 'is_numeric',
  118. 'update' => 'select',
  119. 'option' => $cate,
  120. //'search' => 'select',
  121. 'list' => true,
  122. ),
  123. 'info_id' => array
  124. (
  125. 'type' => 'int-11',
  126. 'name' => '合集ID',
  127. 'default' => '',
  128. 'desc' => '合集ID',
  129. 'match' => 'is_numeric',
  130. 'update' => 'select',
  131. 'option' => $info,
  132. //'search' => 'select',
  133. //'list' => true,
  134. ),
  135. 'object_id' => array
  136. (
  137. 'type' => 'int-11',
  138. 'name' => '项目',
  139. 'default' => '',
  140. 'desc' => '项目',
  141. 'match' => 'is_numeric',
  142. 'update' => 'select',
  143. //'search' => 'select',
  144. //'list' => true,
  145. ),
  146. 'buy_id' => array
  147. (
  148. 'type' => 'int-11',
  149. 'name' => '购买本数ID',
  150. 'default' => '',
  151. 'desc' => '购买本数ID',
  152. 'match' => 'is_numeric',
  153. 'update' => 'select',
  154. 'option' => $buy,
  155. //'search' => 'select',
  156. //'list' => true,
  157. ),
  158. 'buy_num' => array
  159. (
  160. 'type' => 'int-11',
  161. 'name' => '购买数量',
  162. 'default' => '',
  163. 'desc' => '购买数量',
  164. 'match' => 'is_numeric',
  165. //'search' => 'select',
  166. //'list' => true,
  167. ),
  168. 'name' => array
  169. (
  170. 'type' => 'varchar-80',
  171. 'name' => '订单名称',
  172. 'default' => '',
  173. 'desc' => '订单名称',
  174. 'match' => 'is_string',
  175. 'update' => 'text',
  176. 'search' => 'fulltext',
  177. 'list_name' => '订单信息',
  178. 'list' => 'Dever::load("user/lib/manage.showOrderUser", "{id}")',
  179. ),
  180. 'cash' => array
  181. (
  182. 'type' => 'varchar-50',
  183. 'name' => '支付金额',
  184. 'default' => '',
  185. 'desc' => '支付金额',
  186. 'match' => 'option',
  187. 'update' => 'text',
  188. 'list' => true,
  189. ),
  190. 'status' => array
  191. (
  192. 'type' => 'tinyint-1',
  193. 'name' => '订单状态',
  194. 'default' => '1',
  195. 'desc' => '请选择订单状态',
  196. 'match' => 'is_numeric',
  197. 'option' => $status,
  198. 'search' => 'select',
  199. 'update' => 'radio',
  200. 'list' => true,
  201. 'list' => 'Dever::load("user/lib/manage.showOrderStatus", "{id}", "ticket")',
  202. 'control' => 'status',
  203. ),
  204. 'tk_pic' => array
  205. (
  206. 'type' => 'varchar-150',
  207. 'name' => '退款截图',
  208. 'default' => '',
  209. 'desc' => '退款截图',
  210. 'match' => 'is_string',
  211. 'update' => 'image',
  212. 'key' => 1
  213. ),
  214. 'tk_time' => array
  215. (
  216. 'type' => 'int-11',
  217. 'name' => '退款时间',
  218. 'default' => '',
  219. 'desc' => '退款时间',
  220. 'match' => 'option',
  221. //'list' => true,
  222. //'update' => 'date',
  223. 'callback' => 'maketime',
  224. 'show' => 'status=5',
  225. ),
  226. 'tk_admin' => array
  227. (
  228. 'type' => 'int-11',
  229. 'name' => '退款审核人',
  230. 'default' => '1',
  231. 'desc' => '退款审核人',
  232. 'match' => 'option',
  233. //'list' => true,
  234. 'show' => 'status=5',
  235. ),
  236. 'tk_desc' => array
  237. (
  238. 'type' => 'varchar-300',
  239. 'name' => '退款备注',
  240. 'default' => '',
  241. 'desc' => '退款备注',
  242. 'match' => 'option',
  243. 'update' => 'textarea',
  244. //'show' => 'status=5',
  245. ),
  246. 'info' => array
  247. (
  248. 'type' => 'varchar-300',
  249. 'name' => '订单备注',
  250. 'default' => '',
  251. 'desc' => '订单备注',
  252. 'match' => 'option',
  253. 'update' => 'textarea',
  254. //'show' => 'status=5'
  255. //'list' => '"{info}" ? "{info}" : "双击添加备注"',
  256. //'edit' => true,
  257. ),
  258. 'mobile' => array
  259. (
  260. 'type' => 'varchar-300',
  261. 'name' => '下单手机号',
  262. 'default' => '',
  263. 'desc' => '手机号',
  264. 'match' => 'option',
  265. //'show' => 'status=5'
  266. 'search' => array
  267. (
  268. 'api' => 'passport/user-all',//接口地址,最好是获取多条数据的地址
  269. 'col' => 'mobile',//要查询的字段
  270. 'result' => 'id',//返回的字段
  271. 'search' => 'uid',//本表的字段,默认为当前的字段
  272. ),
  273. ),
  274. 'note' => array
  275. (
  276. 'type' => 'tinyint-1',
  277. 'name' => '是否发送状态提醒-1未发送,2已发送',
  278. 'default' => '1',
  279. 'desc' => '请选择状态',
  280. 'match' => 'is_numeric',
  281. ),
  282. 'notice' => array
  283. (
  284. 'type' => 'int-11',
  285. 'name' => '模板消息提醒次数',
  286. 'default' => '0',
  287. 'desc' => '模板消息提醒次数',
  288. 'match' => 'is_numeric',
  289. ),
  290. 'state' => array
  291. (
  292. 'type' => 'tinyint-1',
  293. 'name' => '状态',
  294. 'default' => '1',
  295. 'desc' => '请选择状态',
  296. 'match' => 'is_numeric',
  297. ),
  298. 'cdate' => array
  299. (
  300. 'type' => 'int-11',
  301. 'name' => '下单时间',
  302. 'match' => array('is_numeric', time()),
  303. 'desc' => '',
  304. # 只有insert时才生效
  305. 'insert' => true,
  306. 'search' => 'date',
  307. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  308. //'list' => 'Dever::load("service/lib/manage.showOrderTime", "{id}")',
  309. ),
  310. ),
  311. 'top' => Dever::config('base')->top,
  312. # 增加这个,为了给当前的list增加一个option
  313. 'top_option' => array
  314. (
  315. 'value' => $auth,
  316. 'col' => 'cate_id',
  317. ),
  318. 'manage' => array
  319. (
  320. 'delete' => false,
  321. 'edit' => false,
  322. 'insert' => false,
  323. 'button' => array
  324. (
  325. //'导出订单' => array('location', 'user/lib/manage.out'),
  326. ),
  327. 'list_button' => array(
  328. 'edit' => array('退款', 'status,tk_time,tk_pic,tk_desc,tk_admin', '{status} == 2'),
  329. //'delete' => array('删除', '', '{status} == 1'),
  330. ),
  331. ),
  332. 'request' => array
  333. (
  334. 'getList' => array
  335. (
  336. # 匹配的正则或函数 选填项
  337. 'option' => array
  338. (
  339. 'info_id' => 'yes',
  340. 'uid' => 'yes',
  341. 'status' => 'yes',
  342. 'state' => 1,
  343. ),
  344. 'type' => 'all',
  345. 'order' => array('cdate' => 'desc'),
  346. 'page' => array(5, 'list'),
  347. 'col' => '*',
  348. ),
  349. 'getAll' => array
  350. (
  351. # 匹配的正则或函数 选填项
  352. 'option' => array
  353. (
  354. 'uid' => 'yes',
  355. 'status' => array('1', '!='),
  356. 'state' => 1,
  357. ),
  358. 'type' => 'all',
  359. 'order' => array('cdate' => 'desc'),
  360. 'page' => array(10, 'list'),
  361. 'col' => '*',
  362. ),
  363. 'getYes' => array
  364. (
  365. # 匹配的正则或函数 选填项
  366. 'option' => array
  367. (
  368. 'info_id' => 'yes',
  369. 'state' => 1,
  370. ),
  371. 'type' => 'all',
  372. 'order' => array('cdate' => 'desc'),
  373. 'col' => '*',
  374. ),
  375. # 获取提交订单超过12个小时
  376. 'getDataByTime' => array
  377. (
  378. # 匹配的正则或函数 选填项
  379. 'option' => array
  380. (
  381. 'cdate' => array('yes', '>='),
  382. 'notice' => 'yes',
  383. 'note' => 'yes',
  384. 'state' => 1,
  385. ),
  386. 'type' => 'all',
  387. 'order' => array('cdate' => 'desc'),
  388. 'col' => '*',
  389. ),
  390. # 获取1,2
  391. 'getBuy' => array
  392. (
  393. # 匹配的正则或函数 选填项
  394. 'option' => array
  395. (
  396. 'status' => 'yes',
  397. 'info_id' => 'yes',
  398. 'order_id' => 'yes',
  399. 'uid' => 'yes',
  400. 'state' => 1,
  401. ),
  402. 'type' => 'all',
  403. 'order' => array('id' => 'desc'),
  404. 'col' => '*',
  405. ),
  406. 'getMyAll' => array
  407. (
  408. # 匹配的正则或函数 选填项
  409. 'option' => array
  410. (
  411. 'uid' => 'yes',
  412. 'status' => 'yes',
  413. 'cate_id' => 'yes',
  414. 'state' => 1,
  415. ),
  416. 'type' => 'all',
  417. 'order' => array('id' => 'desc'),
  418. 'page' => array(10, 'list'),
  419. 'col' => 'id,order_id,name,buy_num,cdate,cash,info_id,buy_id',
  420. ),
  421. # 删除未支付订单
  422. 'drop' => array
  423. (
  424. # 匹配的正则或函数 选填项
  425. 'where' => array
  426. (
  427. 'time' => array('yes-cdate', '<='),
  428. 'status' => 1,
  429. 'state' => 1,
  430. ),
  431. 'type' => 'delete',
  432. 'col' => 'id,order_id',
  433. ),
  434. # 获取数据
  435. 'getAllByDate' => array
  436. (
  437. # 匹配的正则或函数 选填项
  438. 'where' => array
  439. (
  440. 'time' => array('yes-cdate', '<='),
  441. ),
  442. 'type' => 'all',
  443. 'col' => 'id,order_id',
  444. ),
  445. 'getNum' => array
  446. (
  447. # 匹配的正则或函数 选填项
  448. 'option' => array
  449. (
  450. 'object_id' => 'yes',
  451. 'info_id' => 'yes',
  452. 'state' => 1,
  453. ),
  454. 'type' => 'one',
  455. 'col' => 'sum(buy_num) as buy_num',
  456. ),
  457. ),
  458. );