order.php 9.3 KB

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