order.php 12 KB

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