order.php 11 KB

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