order.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466
  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_pic' => array
  267. (
  268. 'type' => 'varchar-150',
  269. 'name' => '退款截图',
  270. 'default' => '',
  271. 'desc' => '退款截图',
  272. 'match' => 'is_string',
  273. 'update' => 'image',
  274. 'key' => 1
  275. ),
  276. 'tk_time' => array
  277. (
  278. 'type' => 'int-11',
  279. 'name' => '退款时间',
  280. 'default' => '',
  281. 'desc' => '退款时间',
  282. 'match' => 'option',
  283. //'list' => true,
  284. //'update' => 'date',
  285. 'callback' => 'maketime',
  286. 'show' => 'status=5',
  287. ),
  288. 'tk_admin' => array
  289. (
  290. 'type' => 'int-11',
  291. 'name' => '退款审核人',
  292. 'default' => '1',
  293. 'desc' => '退款审核人',
  294. 'match' => 'option',
  295. //'list' => true,
  296. 'show' => 'status=5',
  297. ),
  298. 'tk_desc' => array
  299. (
  300. 'type' => 'varchar-300',
  301. 'name' => '退款备注',
  302. 'default' => '',
  303. 'desc' => '退款备注',
  304. 'match' => 'option',
  305. 'update' => 'textarea',
  306. //'show' => 'status=5',
  307. ),
  308. 'state' => array
  309. (
  310. 'type' => 'tinyint-1',
  311. 'name' => '状态',
  312. 'default' => '1',
  313. 'desc' => '请选择状态',
  314. 'match' => 'is_numeric',
  315. ),
  316. 'cdate' => array
  317. (
  318. 'type' => 'int-11',
  319. 'name' => '下单时间',
  320. 'match' => array('is_numeric', time()),
  321. 'desc' => '',
  322. # 只有insert时才生效
  323. 'insert' => true,
  324. 'search' => 'date',
  325. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  326. //'list' => 'Dever::load("service/lib/manage.showOrderTime", "{id}")',
  327. ),
  328. 'info' => array
  329. (
  330. 'type' => 'varchar-300',
  331. 'name' => '备注',
  332. 'default' => '',
  333. 'desc' => '备注',
  334. 'match' => 'option',
  335. 'update' => 'textarea',
  336. //'show' => 'status=5'
  337. //'list' => '"{info}" ? "{info}" : "双击添加备注"',
  338. //'edit' => true,
  339. ),
  340. 'mobile' => array
  341. (
  342. 'type' => 'varchar-300',
  343. 'name' => '手机号',
  344. 'default' => '',
  345. 'desc' => '手机号',
  346. 'match' => 'option',
  347. //'show' => 'status=5'
  348. 'search' => array
  349. (
  350. 'api' => 'passport/user-all',//接口地址,最好是获取多条数据的地址
  351. 'col' => 'mobile',//要查询的字段
  352. 'result' => 'id',//返回的字段
  353. 'search' => 'uid',//本表的字段,默认为当前的字段
  354. ),
  355. ),
  356. ),
  357. 'top' => Dever::config('base')->top,
  358. # 增加这个,为了给当前的list增加一个option
  359. 'top_option' => array
  360. (
  361. 'value' => $auth,
  362. 'col' => 'cate_id',
  363. ),
  364. 'manage' => array
  365. (
  366. 'delete' => false,
  367. 'edit' => false,
  368. 'insert' => false,
  369. 'button' => array
  370. (
  371. //'导出订单' => array('location', 'journal/lib/manage.out'),
  372. ),
  373. 'list_button' => array(
  374. 'edit' => array('退款', 'status,tk_time,tk_pic,tk_desc,tk_admin', '{status} > 1'),
  375. //'delete' => array('删除', '', '{status} == 1'),
  376. ),
  377. ),
  378. 'request' => array
  379. (
  380. 'getAll' => array
  381. (
  382. # 匹配的正则或函数 选填项
  383. 'option' => array
  384. (
  385. 'type' => 'yes',
  386. 'create_uid' => 'yes',
  387. 'status' => array('1', '!='),
  388. 'uid' => 'yes',
  389. 'state' => 1,
  390. ),
  391. 'type' => 'all',
  392. 'order' => array('cdate' => 'desc'),
  393. 'page' => array(10, 'list'),
  394. 'col' => '*',
  395. ),
  396. 'getYes' => array
  397. (
  398. # 匹配的正则或函数 选填项
  399. 'option' => array
  400. (
  401. 'product_id' => 'yes',
  402. 'state' => 1,
  403. ),
  404. 'type' => 'all',
  405. 'order' => array('cdate' => 'desc'),
  406. 'col' => '*',
  407. ),
  408. # 获取提交订单超过12个小时
  409. 'getDataByTime' => array
  410. (
  411. # 匹配的正则或函数 选填项
  412. 'option' => array
  413. (
  414. 'cdate' => array('yes', '>='),
  415. 'notice' => 'yes',
  416. 'state' => 1,
  417. ),
  418. 'type' => 'all',
  419. 'order' => array('cdate' => 'desc'),
  420. 'col' => '*',
  421. ),
  422. ),
  423. );