seat_order.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520
  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' => 'seat_order',
  33. # 显示给用户看的名称
  34. 'lang' => '座位订单',
  35. 'order' => 1,
  36. 'ends' => 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/seat.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. 'info_id' => array
  102. (
  103. 'type' => 'int-11',
  104. 'name' => '合集ID',
  105. 'default' => '',
  106. 'desc' => '合集ID',
  107. 'match' => 'is_numeric',
  108. 'update' => 'select',
  109. 'option' => $info,
  110. //'search' => 'select',
  111. //'list' => true,
  112. ),
  113. 'parent_page_id' => array
  114. (
  115. 'type' => 'int-11',
  116. 'name' => '父级章节id',
  117. 'default' => '',
  118. 'desc' => '章节id',
  119. 'match' => 'is_numeric',
  120. 'update' => 'text',
  121. ),
  122. 'page_id' => array
  123. (
  124. 'type' => 'int-11',
  125. 'name' => '章节id',
  126. 'default' => '',
  127. 'desc' => '章节id',
  128. 'match' => 'is_numeric',
  129. 'update' => 'text',
  130. ),
  131. 'times_id' => array
  132. (
  133. 'type' => 'int-11',
  134. 'name' => '时光id',
  135. 'default' => '',
  136. 'desc' => '时光id',
  137. 'match' => 'is_numeric',
  138. 'update' => 'text',
  139. ),
  140. 'day' => array
  141. (
  142. 'type' => 'int-11',
  143. 'name' => '时光下的日期',
  144. 'default' => '-1',
  145. 'desc' => '时光下的日期',
  146. 'match' => 'is_numeric',
  147. 'update' => 'text',
  148. ),
  149. 'content_id' => array
  150. (
  151. 'type' => 'int-11',
  152. 'name' => '内容id',
  153. 'default' => '',
  154. 'desc' => '内容id',
  155. 'match' => 'is_numeric',
  156. 'update' => 'text',
  157. ),
  158. 'index' => array
  159. (
  160. 'type' => 'int-11',
  161. 'name' => '内容索引值',
  162. 'default' => '',
  163. 'desc' => '内容索引值',
  164. 'match' => 'is_numeric',
  165. 'update' => 'text',
  166. ),
  167. 'seat' => array
  168. (
  169. 'type' => 'varchar-1000',
  170. 'name' => '座位信息',
  171. 'default' => '',
  172. 'desc' => '座位信息',
  173. 'match' => 'is_string',
  174. 'update' => 'text',
  175. ),
  176. 'name' => array
  177. (
  178. 'type' => 'varchar-80',
  179. 'name' => '订单名称',
  180. 'default' => '',
  181. 'desc' => '订单名称',
  182. 'match' => 'is_string',
  183. 'update' => 'text',
  184. 'search' => 'fulltext',
  185. 'list_name' => '订单信息',
  186. 'list' => 'Dever::load("user/lib/manage.showSeatOrderUser", "{id}")',
  187. ),
  188. 'price' => array
  189. (
  190. 'type' => 'int-11',
  191. 'name' => '单价',
  192. 'default' => '',
  193. 'desc' => '单价',
  194. 'match' => 'is_numeric',
  195. 'update' => 'select',
  196. //'search' => 'select',
  197. //'list' => true,
  198. ),
  199. 'num' => array
  200. (
  201. 'type' => 'int-11',
  202. 'name' => '购买数量',
  203. 'default' => '',
  204. 'desc' => '购买数量',
  205. 'match' => 'is_numeric',
  206. //'search' => 'select',
  207. //'list' => true,
  208. ),
  209. 'cash' => array
  210. (
  211. 'type' => 'varchar-50',
  212. 'name' => '支付金额',
  213. 'default' => '',
  214. 'desc' => '支付金额',
  215. 'match' => 'option',
  216. 'update' => 'text',
  217. 'list' => true,
  218. ),
  219. 'status' => array
  220. (
  221. 'type' => 'tinyint-1',
  222. 'name' => '订单状态',
  223. 'default' => '1',
  224. 'desc' => '请选择订单状态',
  225. 'match' => 'is_numeric',
  226. 'option' => $status,
  227. 'search' => 'select',
  228. 'update' => 'radio',
  229. 'list' => true,
  230. 'list' => 'Dever::load("user/lib/manage.showOrderStatus", "{id}", "seat")',
  231. 'control' => 'status',
  232. ),
  233. 'tk_pic' => array
  234. (
  235. 'type' => 'varchar-150',
  236. 'name' => '退款截图',
  237. 'default' => '',
  238. 'desc' => '退款截图',
  239. 'match' => 'is_string',
  240. 'update' => 'image',
  241. 'key' => 1
  242. ),
  243. 'tk_time' => array
  244. (
  245. 'type' => 'int-11',
  246. 'name' => '退款时间',
  247. 'default' => '',
  248. 'desc' => '退款时间',
  249. 'match' => 'option',
  250. //'list' => true,
  251. //'update' => 'date',
  252. 'callback' => 'maketime',
  253. 'show' => 'status=5',
  254. ),
  255. 'tk_admin' => array
  256. (
  257. 'type' => 'int-11',
  258. 'name' => '退款审核人',
  259. 'default' => '1',
  260. 'desc' => '退款审核人',
  261. 'match' => 'option',
  262. //'list' => true,
  263. 'show' => 'status=5',
  264. ),
  265. 'tk_desc' => array
  266. (
  267. 'type' => 'varchar-300',
  268. 'name' => '退款备注',
  269. 'default' => '',
  270. 'desc' => '退款备注',
  271. 'match' => 'option',
  272. 'update' => 'textarea',
  273. //'show' => 'status=5',
  274. ),
  275. 'info' => array
  276. (
  277. 'type' => 'varchar-300',
  278. 'name' => '订单备注',
  279. 'default' => '',
  280. 'desc' => '订单备注',
  281. 'match' => 'option',
  282. 'update' => 'textarea',
  283. //'show' => 'status=5'
  284. //'list' => '"{info}" ? "{info}" : "双击添加备注"',
  285. //'edit' => true,
  286. ),
  287. 'mobile' => array
  288. (
  289. 'type' => 'varchar-300',
  290. 'name' => '下单手机号',
  291. 'default' => '',
  292. 'desc' => '手机号',
  293. 'match' => 'option',
  294. //'show' => 'status=5'
  295. 'search' => array
  296. (
  297. 'api' => 'passport/user-all',//接口地址,最好是获取多条数据的地址
  298. 'col' => 'mobile',//要查询的字段
  299. 'result' => 'id',//返回的字段
  300. 'search' => 'uid',//本表的字段,默认为当前的字段
  301. ),
  302. ),
  303. 'note' => array
  304. (
  305. 'type' => 'tinyint-1',
  306. 'name' => '是否发送状态提醒-1未发送,2已发送',
  307. 'default' => '1',
  308. 'desc' => '请选择状态',
  309. 'match' => 'is_numeric',
  310. ),
  311. 'notice' => array
  312. (
  313. 'type' => 'int-11',
  314. 'name' => '模板消息提醒次数',
  315. 'default' => '0',
  316. 'desc' => '模板消息提醒次数',
  317. 'match' => 'is_numeric',
  318. ),
  319. 'state' => array
  320. (
  321. 'type' => 'tinyint-1',
  322. 'name' => '状态',
  323. 'default' => '1',
  324. 'desc' => '请选择状态',
  325. 'match' => 'is_numeric',
  326. ),
  327. 'cdate' => array
  328. (
  329. 'type' => 'int-11',
  330. 'name' => '下单时间',
  331. 'match' => array('is_numeric', time()),
  332. 'desc' => '',
  333. # 只有insert时才生效
  334. 'insert' => true,
  335. 'search' => 'date',
  336. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  337. //'list' => 'Dever::load("service/lib/manage.showOrderTime", "{id}")',
  338. ),
  339. ),
  340. 'top' => Dever::config('base')->top,
  341. # 增加这个,为了给当前的list增加一个option
  342. 'top_option' => array
  343. (
  344. 'value' => $auth,
  345. 'col' => 'cate_id',
  346. ),
  347. 'manage' => array
  348. (
  349. 'delete' => false,
  350. 'edit' => false,
  351. 'insert' => false,
  352. 'button' => array
  353. (
  354. //'导出订单' => array('location', 'user/lib/manage.out'),
  355. ),
  356. 'list_button' => array(
  357. 'edit' => array('退款', 'status,tk_time,tk_pic,tk_desc,tk_admin', '{status} == 2'),
  358. //'delete' => array('删除', '', '{status} == 1'),
  359. ),
  360. ),
  361. 'request' => array
  362. (
  363. 'getAll' => array
  364. (
  365. # 匹配的正则或函数 选填项
  366. 'option' => array
  367. (
  368. 'uid' => 'yes',
  369. 'status' => array('1', '!='),
  370. 'state' => 1,
  371. ),
  372. 'type' => 'all',
  373. 'order' => array('cdate' => 'desc'),
  374. 'page' => array(10, 'list'),
  375. 'col' => '*',
  376. ),
  377. 'getYes' => array
  378. (
  379. # 匹配的正则或函数 选填项
  380. 'option' => array
  381. (
  382. 'info_id' => 'yes',
  383. 'state' => 1,
  384. ),
  385. 'type' => 'all',
  386. 'order' => array('cdate' => 'desc'),
  387. 'col' => '*',
  388. ),
  389. # 获取提交订单超过12个小时
  390. 'getDataByTime' => array
  391. (
  392. # 匹配的正则或函数 选填项
  393. 'option' => array
  394. (
  395. 'cdate' => array('yes', '>='),
  396. 'notice' => 'yes',
  397. 'note' => 'yes',
  398. 'state' => 1,
  399. ),
  400. 'type' => 'all',
  401. 'order' => array('cdate' => 'desc'),
  402. 'col' => '*',
  403. ),
  404. # 获取1,2
  405. 'getBuy' => array
  406. (
  407. # 匹配的正则或函数 选填项
  408. 'option' => array
  409. (
  410. 'status' => 'yes',
  411. 'info_id' => 'yes',
  412. 'order_id' => 'yes',
  413. 'uid' => 'yes',
  414. 'state' => 1,
  415. ),
  416. 'type' => 'all',
  417. 'order' => array('id' => 'desc'),
  418. 'col' => '*',
  419. ),
  420. 'getMyAll' => array
  421. (
  422. # 匹配的正则或函数 选填项
  423. 'option' => array
  424. (
  425. 'uid' => 'yes',
  426. 'status' => 'yes',
  427. 'cate_id' => 'yes',
  428. 'state' => 1,
  429. ),
  430. 'type' => 'all',
  431. 'order' => array('id' => 'desc'),
  432. 'page' => array(10, 'list'),
  433. 'col' => 'id,order_id,name,buy_num,cdate,cash,info_id,buy_id',
  434. ),
  435. # 删除未支付订单
  436. 'drop' => array
  437. (
  438. # 匹配的正则或函数 选填项
  439. 'where' => array
  440. (
  441. 'time' => array('yes-cdate', '<='),
  442. 'status' => 1,
  443. 'state' => 1,
  444. ),
  445. 'type' => 'delete',
  446. 'col' => 'id,order_id',
  447. ),
  448. # 获取数据
  449. 'getAllByDate' => array
  450. (
  451. # 匹配的正则或函数 选填项
  452. 'where' => array
  453. (
  454. 'time' => array('yes-cdate', '<='),
  455. ),
  456. 'type' => 'all',
  457. 'col' => 'id,order_id',
  458. ),
  459. 'getNum' => array
  460. (
  461. # 匹配的正则或函数 选填项
  462. 'option' => array
  463. (
  464. 'object_id' => 'yes',
  465. 'info_id' => 'yes',
  466. 'state' => 1,
  467. ),
  468. 'type' => 'one',
  469. 'col' => 'sum(buy_num) as buy_num',
  470. ),
  471. ),
  472. );