ticket_order_temp.php 14 KB

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