order_temp.php 16 KB

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