order.php 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. <?php
  2. $type = array
  3. (
  4. 1 => '购买',
  5. 2 => '兑换',
  6. );
  7. $status = array
  8. (
  9. 1 => '待支付',
  10. 2 => '已支付',
  11. 3 => '支付失败',
  12. //4 => '申请退款',
  13. 5 => '已退款',
  14. );
  15. $product = function()
  16. {
  17. return Dever::db('journal/info')->state();
  18. };
  19. return array
  20. (
  21. # 表名
  22. 'name' => 'order',
  23. # 显示给用户看的名称
  24. 'lang' => '订单管理',
  25. 'order' => 1,
  26. 'end' => array
  27. (
  28. //'update' => 'journal/lib/manage.order',
  29. ),
  30. # 数据结构
  31. 'struct' => array
  32. (
  33. 'id' => array
  34. (
  35. 'type' => 'int-11',
  36. 'name' => 'ID',
  37. 'default' => '',
  38. 'desc' => '',
  39. 'match' => 'is_numeric',
  40. 'search' => 'order',
  41. 'list' => true,
  42. ),
  43. 'order_id' => array
  44. (
  45. 'type' => 'varchar-100',
  46. 'name' => '订单id',
  47. 'default' => '',
  48. 'desc' => '付款订单id',
  49. 'match' => 'is_string',
  50. 'update' => 'text',
  51. 'search' => 'fulltext',
  52. //'list' => true,
  53. //'list' => '"{order_id}" ? "{order_id}" : "{code}"',
  54. ),
  55. 'name' => array
  56. (
  57. 'type' => 'varchar-80',
  58. 'name' => '订单名称',
  59. 'default' => '',
  60. 'desc' => '订单名称',
  61. 'match' => 'is_string',
  62. 'update' => 'text',
  63. 'search' => 'fulltext',
  64. 'list_name' => '订单信息',
  65. //'list' => 'Dever::load("journal/lib/manage.showOrderUser", "{id}")',
  66. ),
  67. 'uid' => array
  68. (
  69. 'type' => 'int-11',
  70. 'name' => '用户id',
  71. 'default' => '',
  72. 'desc' => '用户id',
  73. 'match' => 'is_numeric',
  74. 'update' => 'text',
  75. ),
  76. 'product_id' => array
  77. (
  78. 'type' => 'int-11',
  79. 'name' => '小刊',
  80. 'default' => '',
  81. 'desc' => '小刊',
  82. 'match' => 'is_numeric',
  83. 'update' => 'select',
  84. 'option' => $product,
  85. 'search' => 'select',
  86. //'list' => true,
  87. ),
  88. 'type' => array
  89. (
  90. 'type' => 'int-11',
  91. 'name' => '支付方式',
  92. 'default' => '1',
  93. 'desc' => '支付方式',
  94. 'match' => 'is_numeric',
  95. 'option' => $type,
  96. 'search' => 'select',
  97. 'update' => 'radio',
  98. //'list' => true,
  99. 'control' => 'type',
  100. ),
  101. 'notice' => array
  102. (
  103. 'type' => 'int-11',
  104. 'name' => '模板消息提醒次数',
  105. 'default' => '0',
  106. 'desc' => '模板消息提醒次数',
  107. 'match' => 'is_numeric',
  108. ),
  109. 'cash' => array
  110. (
  111. 'type' => 'varchar-50',
  112. 'name' => '支付金额',
  113. 'default' => '',
  114. 'desc' => '支付金额',
  115. 'match' => 'option',
  116. 'update' => 'text',
  117. //'list' => true,
  118. 'show' => 'type=1',
  119. ),
  120. 'code' => array
  121. (
  122. 'type' => 'varchar-50',
  123. 'name' => '使用的兑换码',
  124. 'default' => '',
  125. 'desc' => '使用的兑换码',
  126. 'match' => 'option',
  127. 'update' => 'text',
  128. //'list' => true,
  129. 'show' => 'type=2',
  130. ),
  131. 'status' => array
  132. (
  133. 'type' => 'tinyint-1',
  134. 'name' => '订单状态',
  135. 'default' => '1',
  136. 'desc' => '请选择订单状态',
  137. 'match' => 'is_numeric',
  138. 'option' => $status,
  139. 'search' => 'select',
  140. 'update' => 'radio',
  141. //'list' => 'Dever::load("service/lib/manage.showOrderStatus", "{id}")',
  142. 'control' => 'status',
  143. ),
  144. 'tk_time' => array
  145. (
  146. 'type' => 'int-11',
  147. 'name' => '退款时间',
  148. 'default' => '',
  149. 'desc' => '退款时间',
  150. 'match' => 'option',
  151. //'list' => true,
  152. 'show' => 'status=5',
  153. ),
  154. 'tk_admin' => array
  155. (
  156. 'type' => 'int-11',
  157. 'name' => '退款审核人',
  158. 'default' => '1',
  159. 'desc' => '退款审核人',
  160. 'match' => 'option',
  161. //'list' => true,
  162. 'show' => 'status=5',
  163. ),
  164. 'tk_desc' => array
  165. (
  166. 'type' => 'varchar-300',
  167. 'name' => '退款备注',
  168. 'default' => '',
  169. 'desc' => '退款备注',
  170. 'match' => 'option',
  171. 'update' => 'textarea',
  172. //'show' => 'status=5',
  173. ),
  174. 'state' => array
  175. (
  176. 'type' => 'tinyint-1',
  177. 'name' => '状态',
  178. 'default' => '1',
  179. 'desc' => '请选择状态',
  180. 'match' => 'is_numeric',
  181. ),
  182. 'cdate' => array
  183. (
  184. 'type' => 'int-11',
  185. 'name' => '下单时间',
  186. 'match' => array('is_numeric', time()),
  187. 'desc' => '',
  188. # 只有insert时才生效
  189. 'insert' => true,
  190. 'search' => 'date',
  191. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  192. //'list' => 'Dever::load("service/lib/manage.showOrderTime", "{id}")',
  193. ),
  194. 'info' => array
  195. (
  196. 'type' => 'varchar-300',
  197. 'name' => '备注',
  198. 'default' => '',
  199. 'desc' => '备注',
  200. 'match' => 'option',
  201. 'update' => 'textarea',
  202. //'show' => 'status=5'
  203. 'list' => '"{info}" ? "{info}" : "双击添加备注"',
  204. 'edit' => true,
  205. ),
  206. 'mobile' => array
  207. (
  208. 'type' => 'varchar-300',
  209. 'name' => '手机号',
  210. 'default' => '',
  211. 'desc' => '手机号',
  212. 'match' => 'option',
  213. //'show' => 'status=5'
  214. 'search' => array
  215. (
  216. 'api' => 'passport/user-all',//接口地址,最好是获取多条数据的地址
  217. 'col' => 'mobile',//要查询的字段
  218. 'result' => 'id',//返回的字段
  219. 'search' => 'uid',//本表的字段,默认为当前的字段
  220. ),
  221. ),
  222. ),
  223. 'manage' => array
  224. (
  225. //'delete' => false,
  226. //'edit' => false,
  227. //'insert' => false,
  228. 'button' => array
  229. (
  230. '导出订单' => array('location', 'service/lib/manage.out'),
  231. ),
  232. 'list_button' => array(
  233. 'edit' => array('退款', 'tk_time,tk_desc,tk_admin', '{status} > 1'),
  234. 'delete' => array('删除', '', '{status} == 1'),
  235. ),
  236. ),
  237. 'request' => array
  238. (
  239. 'getAll' => array
  240. (
  241. # 匹配的正则或函数 选填项
  242. 'option' => array
  243. (
  244. 'status' => array('1', '!='),
  245. 'uid' => 'yes',
  246. 'state' => 1,
  247. ),
  248. 'type' => 'all',
  249. 'order' => array('cdate' => 'desc'),
  250. 'page' => array(10, 'list'),
  251. 'col' => '*',
  252. ),
  253. 'getYes' => array
  254. (
  255. # 匹配的正则或函数 选填项
  256. 'option' => array
  257. (
  258. 'product_id' => 'yes',
  259. 'state' => 1,
  260. ),
  261. 'type' => 'all',
  262. 'order' => array('cdate' => 'desc'),
  263. 'col' => '*',
  264. ),
  265. # 获取提交订单超过12个小时
  266. 'getDataByTime' => array
  267. (
  268. # 匹配的正则或函数 选填项
  269. 'option' => array
  270. (
  271. 'cdate' => array('yes', '>='),
  272. 'notice' => 'yes',
  273. 'state' => 1,
  274. ),
  275. 'type' => 'all',
  276. 'order' => array('cdate' => 'desc'),
  277. 'col' => '*',
  278. ),
  279. ),
  280. );