order.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447
  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' => '用户id',
  130. 'default' => '',
  131. 'desc' => '用户id',
  132. 'match' => 'is_numeric',
  133. 'update' => 'text',
  134. ),
  135. 'source_uid' => array
  136. (
  137. 'type' => 'int-11',
  138. 'name' => '邀请人',
  139. 'default' => '',
  140. 'desc' => '邀请人',
  141. 'match' => 'is_numeric',
  142. 'update' => 'text',
  143. ),
  144. 'product_id' => array
  145. (
  146. 'type' => 'int-11',
  147. 'name' => '小刊',
  148. 'default' => '',
  149. 'desc' => '小刊',
  150. 'match' => 'is_numeric',
  151. 'update' => 'select',
  152. 'option' => $product,
  153. //'search' => 'select',
  154. //'list' => true,
  155. ),
  156. 'buy_id' => array
  157. (
  158. 'type' => 'int-11',
  159. 'name' => '购买本数',
  160. 'default' => '',
  161. 'desc' => '购买本数',
  162. 'match' => 'is_numeric',
  163. 'update' => 'select',
  164. 'option' => $buy,
  165. //'search' => 'select',
  166. //'list' => true,
  167. ),
  168. 'type' => array
  169. (
  170. 'type' => 'int-11',
  171. 'name' => '支付方式',
  172. 'default' => '1',
  173. 'desc' => '支付方式',
  174. 'match' => 'is_numeric',
  175. 'option' => $type,
  176. 'search' => 'select',
  177. 'update' => 'radio',
  178. //'list' => true,
  179. 'control' => 'type',
  180. ),
  181. 'system' => array
  182. (
  183. 'type' => 'int-11',
  184. 'name' => '系统',
  185. 'default' => '1',
  186. 'desc' => '系统',
  187. 'match' => 'is_numeric',
  188. 'option' => $system,
  189. 'search' => 'select',
  190. 'update' => 'radio',
  191. 'list' => true,
  192. ),
  193. 'source' => array
  194. (
  195. 'type' => 'int-11',
  196. 'name' => '渠道来源',
  197. 'default' => '1',
  198. 'desc' => '支付方式',
  199. 'match' => 'is_numeric',
  200. 'option' => $source,
  201. 'search' => 'select',
  202. 'update' => 'radio',
  203. 'list' => true,
  204. ),
  205. 'seller_id' => array
  206. (
  207. 'type' => 'int-11',
  208. 'name' => '销售商',
  209. 'default' => '1',
  210. 'desc' => '销售商',
  211. 'match' => 'is_numeric',
  212. 'update' => 'select',
  213. 'option' => $seller,
  214. 'search' => 'select',
  215. //'list' => true,
  216. ),
  217. 'notice' => array
  218. (
  219. 'type' => 'int-11',
  220. 'name' => '模板消息提醒次数',
  221. 'default' => '0',
  222. 'desc' => '模板消息提醒次数',
  223. 'match' => 'is_numeric',
  224. ),
  225. 'cash' => array
  226. (
  227. 'type' => 'varchar-50',
  228. 'name' => '支付金额',
  229. 'default' => '',
  230. 'desc' => '支付金额',
  231. 'match' => 'option',
  232. 'update' => 'text',
  233. //'list' => true,
  234. 'show' => 'type=1',
  235. ),
  236. 'code' => array
  237. (
  238. 'type' => 'varchar-50',
  239. 'name' => '使用的兑换码',
  240. 'default' => '',
  241. 'desc' => '使用的兑换码',
  242. 'match' => 'option',
  243. 'update' => 'text',
  244. //'list' => true,
  245. 'show' => 'type=2',
  246. ),
  247. 'status' => array
  248. (
  249. 'type' => 'tinyint-1',
  250. 'name' => '订单状态',
  251. 'default' => '1',
  252. 'desc' => '请选择订单状态',
  253. 'match' => 'is_numeric',
  254. 'option' => $status,
  255. 'search' => 'select',
  256. 'update' => 'radio',
  257. 'list' => 'Dever::load("journal/lib/manage.showOrderStatus", "{id}")',
  258. 'control' => 'status',
  259. ),
  260. 'tk_time' => array
  261. (
  262. 'type' => 'int-11',
  263. 'name' => '退款时间',
  264. 'default' => '',
  265. 'desc' => '退款时间',
  266. 'match' => 'option',
  267. //'list' => true,
  268. 'show' => 'status=5',
  269. ),
  270. 'tk_admin' => array
  271. (
  272. 'type' => 'int-11',
  273. 'name' => '退款审核人',
  274. 'default' => '1',
  275. 'desc' => '退款审核人',
  276. 'match' => 'option',
  277. //'list' => true,
  278. 'show' => 'status=5',
  279. ),
  280. 'tk_desc' => array
  281. (
  282. 'type' => 'varchar-300',
  283. 'name' => '退款备注',
  284. 'default' => '',
  285. 'desc' => '退款备注',
  286. 'match' => 'option',
  287. 'update' => 'textarea',
  288. //'show' => 'status=5',
  289. ),
  290. 'state' => array
  291. (
  292. 'type' => 'tinyint-1',
  293. 'name' => '状态',
  294. 'default' => '1',
  295. 'desc' => '请选择状态',
  296. 'match' => 'is_numeric',
  297. ),
  298. 'cdate' => array
  299. (
  300. 'type' => 'int-11',
  301. 'name' => '下单时间',
  302. 'match' => array('is_numeric', time()),
  303. 'desc' => '',
  304. # 只有insert时才生效
  305. 'insert' => true,
  306. 'search' => 'date',
  307. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  308. //'list' => 'Dever::load("service/lib/manage.showOrderTime", "{id}")',
  309. ),
  310. 'info' => array
  311. (
  312. 'type' => 'varchar-300',
  313. 'name' => '备注',
  314. 'default' => '',
  315. 'desc' => '备注',
  316. 'match' => 'option',
  317. 'update' => 'textarea',
  318. //'show' => 'status=5'
  319. 'list' => '"{info}" ? "{info}" : "双击添加备注"',
  320. 'edit' => true,
  321. ),
  322. 'mobile' => array
  323. (
  324. 'type' => 'varchar-300',
  325. 'name' => '手机号',
  326. 'default' => '',
  327. 'desc' => '手机号',
  328. 'match' => 'option',
  329. //'show' => 'status=5'
  330. 'search' => array
  331. (
  332. 'api' => 'passport/user-all',//接口地址,最好是获取多条数据的地址
  333. 'col' => 'mobile',//要查询的字段
  334. 'result' => 'id',//返回的字段
  335. 'search' => 'uid',//本表的字段,默认为当前的字段
  336. ),
  337. ),
  338. ),
  339. 'top' => Dever::config('base')->top,
  340. # 增加这个,为了给当前的list增加一个option
  341. 'top_option' => array
  342. (
  343. 'value' => $auth,
  344. 'col' => 'cate_id',
  345. ),
  346. 'manage' => array
  347. (
  348. 'delete' => false,
  349. 'edit' => false,
  350. 'insert' => false,
  351. 'button' => array
  352. (
  353. //'导出订单' => array('location', 'journal/lib/manage.out'),
  354. ),
  355. 'list_button' => array(
  356. //'edit' => array('退款', 'tk_time,tk_desc,tk_admin', '{status} > 1'),
  357. //'delete' => array('删除', '', '{status} == 1'),
  358. ),
  359. ),
  360. 'request' => array
  361. (
  362. 'getAll' => array
  363. (
  364. # 匹配的正则或函数 选填项
  365. 'option' => array
  366. (
  367. 'type' => 'yes',
  368. 'create_uid' => 'yes',
  369. 'status' => array('1', '!='),
  370. 'uid' => 'yes',
  371. 'state' => 1,
  372. ),
  373. 'type' => 'all',
  374. 'order' => array('cdate' => 'desc'),
  375. 'page' => array(10, 'list'),
  376. 'col' => '*',
  377. ),
  378. 'getYes' => array
  379. (
  380. # 匹配的正则或函数 选填项
  381. 'option' => array
  382. (
  383. 'product_id' => 'yes',
  384. 'state' => 1,
  385. ),
  386. 'type' => 'all',
  387. 'order' => array('cdate' => 'desc'),
  388. 'col' => '*',
  389. ),
  390. # 获取提交订单超过12个小时
  391. 'getDataByTime' => array
  392. (
  393. # 匹配的正则或函数 选填项
  394. 'option' => array
  395. (
  396. 'cdate' => array('yes', '>='),
  397. 'notice' => 'yes',
  398. 'state' => 1,
  399. ),
  400. 'type' => 'all',
  401. 'order' => array('cdate' => 'desc'),
  402. 'col' => '*',
  403. ),
  404. ),
  405. );