order.php 15 KB

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