order.php 12 KB

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