order.php 11 KB

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