order.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417
  1. <?php
  2. # 系统
  3. $system = array
  4. (
  5. 1 => '小程序',
  6. 2 => 'H5',
  7. 3 => 'ios',
  8. 4 => '安卓',
  9. );
  10. $status = array
  11. (
  12. 1 => '待支付',
  13. 2 => '已支付',
  14. 3 => '支付失败',
  15. 4 => '待接单',
  16. 5 => '待服务',
  17. 6 => '用户取消',
  18. 7 => '老师取消',
  19. 8 => '服务完成',
  20. 9 => '已评价',
  21. 10 => '已退款',
  22. );
  23. $product = function()
  24. {
  25. return Dever::db('course/info')->state();
  26. };
  27. $seller = function()
  28. {
  29. $array = array
  30. (
  31. -1 => '无',
  32. );
  33. $info = Dever::db('seller/info')->state();
  34. if($info)
  35. {
  36. $array += $info;
  37. }
  38. return $array;
  39. };
  40. $teacher = function()
  41. {
  42. $array = array
  43. (
  44. -1 => '无',
  45. );
  46. $info = Dever::db('teacher/info')->state();
  47. if($info)
  48. {
  49. $array += $info;
  50. }
  51. return $array;
  52. };
  53. $cate = function()
  54. {
  55. $array = array();
  56. $info = Dever::db('course/cate')->state();
  57. if($info)
  58. {
  59. $array += $info;
  60. }
  61. return $array;
  62. };
  63. return array
  64. (
  65. # 表名
  66. 'name' => 'order',
  67. # 显示给用户看的名称
  68. 'lang' => '订单管理',
  69. 'order' => 1,
  70. 'end' => array
  71. (
  72. //'update' => 'course/lib/pay.order',
  73. ),
  74. # 数据结构
  75. 'struct' => array
  76. (
  77. 'id' => array
  78. (
  79. 'type' => 'int-11',
  80. 'name' => 'ID',
  81. 'default' => '',
  82. 'desc' => '',
  83. 'match' => 'is_numeric',
  84. 'search' => 'order',
  85. //'list' => true,
  86. ),
  87. 'order_id' => array
  88. (
  89. 'type' => 'varchar-100',
  90. 'name' => '订单id',
  91. 'default' => '',
  92. 'desc' => '付款订单id',
  93. 'match' => 'is_string',
  94. 'update' => 'text',
  95. 'search' => 'fulltext',
  96. 'list' => true,
  97. //'list' => '"{order_id}" ? "{order_id}" : "{code}"',
  98. ),
  99. 'cate_course' => array
  100. (
  101. 'name' => '课程',
  102. 'default' => '',
  103. 'desc' => '课程',
  104. 'search' => 'linkage',
  105. 'search_col' => 'cate_id,product_id',
  106. 'option' => Dever::url('lib/manage.search_cate_course', 'course'),
  107. ),
  108. 'cate_id' => array
  109. (
  110. 'type' => 'int-11',
  111. 'name' => '课程分类',
  112. 'default' => '1',
  113. 'desc' => '课程分类',
  114. 'match' => 'is_numeric',
  115. 'update' => 'select',
  116. 'option' => $cate,
  117. //'search' => 'select',
  118. 'list' => true,
  119. ),
  120. 'name' => array
  121. (
  122. 'type' => 'varchar-80',
  123. 'name' => '订单名称',
  124. 'default' => '',
  125. 'desc' => '订单名称',
  126. 'match' => 'is_string',
  127. 'update' => 'text',
  128. 'search' => 'fulltext',
  129. 'list_name' => '订单信息',
  130. 'list' => 'Dever::load("course/lib/manage.showOrderUser", "{id}")',
  131. ),
  132. 'uid' => array
  133. (
  134. 'type' => 'int-11',
  135. 'name' => '用户名',
  136. 'default' => '',
  137. 'desc' => '用户id',
  138. 'match' => 'is_numeric',
  139. 'search' => array
  140. (
  141. 'api' => 'passport/user-all',
  142. 'col' => 'username',
  143. 'result' => 'id',
  144. ),
  145. 'update' => 'text',
  146. ),
  147. 'product_id' => array
  148. (
  149. 'type' => 'int-11',
  150. 'name' => '课程',
  151. 'default' => '',
  152. 'desc' => '课程',
  153. 'match' => 'is_numeric',
  154. 'update' => 'select',
  155. 'option' => $product,
  156. //'search' => 'select',
  157. //'list' => true,
  158. ),
  159. 'buy_num' => array
  160. (
  161. 'type' => 'int-11',
  162. 'name' => '购买数量',
  163. 'default' => '',
  164. 'desc' => '购买数量',
  165. 'match' => 'is_numeric',
  166. //'search' => 'select',
  167. //'list' => true,
  168. ),
  169. 'system' => array
  170. (
  171. 'type' => 'int-11',
  172. 'name' => '系统',
  173. 'default' => '1',
  174. 'desc' => '系统',
  175. 'match' => 'is_numeric',
  176. 'option' => $system,
  177. 'search' => 'select',
  178. 'update' => 'radio',
  179. 'list' => true,
  180. ),
  181. 'teacher_id' => array
  182. (
  183. 'type' => 'int-11',
  184. 'name' => '讲师',
  185. 'default' => '-1',
  186. 'desc' => '讲师',
  187. 'match' => 'is_numeric',
  188. 'update' => 'select',
  189. 'option' => $teacher,
  190. 'search' => 'select',
  191. //'list' => true,
  192. ),
  193. 'seller_id' => array
  194. (
  195. 'type' => 'int-11',
  196. 'name' => '销售人',
  197. 'default' => '-1',
  198. 'desc' => '销售人',
  199. 'match' => 'is_numeric',
  200. 'update' => 'select',
  201. 'option' => $seller,
  202. 'search' => 'select',
  203. //'list' => true,
  204. ),
  205. 'cash' => array
  206. (
  207. 'type' => 'varchar-50',
  208. 'name' => '支付金额',
  209. 'default' => '',
  210. 'desc' => '支付金额',
  211. 'match' => 'option',
  212. 'update' => 'text',
  213. //'list' => true,
  214. ),
  215. 'status' => array
  216. (
  217. 'type' => 'tinyint-1',
  218. 'name' => '订单状态',
  219. 'default' => '1',
  220. 'desc' => '请选择订单状态',
  221. 'match' => 'is_numeric',
  222. 'option' => $status,
  223. 'search' => 'select',
  224. 'update' => 'radio',
  225. 'list' => 'Dever::load("course/lib/manage.showOrderStatus", "{id}")',
  226. 'control' => 'status',
  227. ),
  228. 'tk_pic' => array
  229. (
  230. 'type' => 'varchar-150',
  231. 'name' => '退款截图',
  232. 'default' => '',
  233. 'desc' => '退款截图',
  234. 'match' => 'is_string',
  235. 'update' => 'image',
  236. 'key' => 1
  237. ),
  238. 'tk_time' => array
  239. (
  240. 'type' => 'int-11',
  241. 'name' => '退款时间',
  242. 'default' => '',
  243. 'desc' => '退款时间',
  244. 'match' => 'option',
  245. //'list' => true,
  246. //'update' => 'date',
  247. 'callback' => 'maketime',
  248. 'show' => 'status=5',
  249. ),
  250. 'tk_admin' => array
  251. (
  252. 'type' => 'int-11',
  253. 'name' => '退款审核人',
  254. 'default' => '1',
  255. 'desc' => '退款审核人',
  256. 'match' => 'option',
  257. //'list' => true,
  258. 'show' => 'status=5',
  259. ),
  260. 'tk_desc' => array
  261. (
  262. 'type' => 'varchar-300',
  263. 'name' => '退款备注',
  264. 'default' => '',
  265. 'desc' => '退款备注',
  266. 'match' => 'option',
  267. 'update' => 'textarea',
  268. //'show' => 'status=5',
  269. ),
  270. 'state' => array
  271. (
  272. 'type' => 'tinyint-1',
  273. 'name' => '状态',
  274. 'default' => '1',
  275. 'desc' => '请选择状态',
  276. 'match' => 'is_numeric',
  277. ),
  278. 'cdate' => array
  279. (
  280. 'type' => 'int-11',
  281. 'name' => '下单时间',
  282. 'match' => array('is_numeric', time()),
  283. 'desc' => '',
  284. # 只有insert时才生效
  285. 'insert' => true,
  286. 'search' => 'date',
  287. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  288. //'list' => 'Dever::load("service/lib/manage.showOrderTime", "{id}")',
  289. ),
  290. ),
  291. 'manage' => array
  292. (
  293. 'delete' => false,
  294. 'edit' => false,
  295. 'insert' => false,
  296. 'button' => array
  297. (
  298. //'导出订单' => array('location', 'journal/lib/manage.out'),
  299. ),
  300. 'list_button' => array(
  301. 'edit' => array('退款', 'status,tk_time,tk_pic,tk_desc,tk_admin', '{status} == 2 && ({type} == 1 || {type} == 3)'),
  302. //'delete' => array('删除', '', '{status} == 1'),
  303. ),
  304. ),
  305. 'request' => array
  306. (
  307. 'getAll' => array
  308. (
  309. # 匹配的正则或函数 选填项
  310. 'option' => array
  311. (
  312. 'type' => 'yes',
  313. 'status' => array('1', '!='),
  314. 'uid' => 'yes',
  315. 'state' => 1,
  316. ),
  317. 'type' => 'all',
  318. 'order' => array('cdate' => 'desc'),
  319. 'page' => array(10, 'list'),
  320. 'col' => '*',
  321. ),
  322. 'getYes' => array
  323. (
  324. # 匹配的正则或函数 选填项
  325. 'option' => array
  326. (
  327. 'product_id' => 'yes',
  328. 'state' => 1,
  329. ),
  330. 'type' => 'all',
  331. 'order' => array('cdate' => 'desc'),
  332. 'col' => '*',
  333. ),
  334. # 获取提交订单超过12个小时
  335. 'getDataByTime' => array
  336. (
  337. # 匹配的正则或函数 选填项
  338. 'option' => array
  339. (
  340. 'cdate' => array('yes', '>='),
  341. 'notice' => 'yes',
  342. 'note' => 'yes',
  343. 'type' => array('yes', 'in'),
  344. 'state' => 1,
  345. ),
  346. 'type' => 'all',
  347. 'order' => array('cdate' => 'desc'),
  348. 'col' => '*',
  349. ),
  350. # 获取1,2
  351. 'getBuy' => array
  352. (
  353. # 匹配的正则或函数 选填项
  354. 'option' => array
  355. (
  356. 'status' => 'yes',
  357. 'type' => array('yes', 'in'),
  358. 'product_id' => 'yes',
  359. 'order_id' => 'yes',
  360. 'uid' => 'yes',
  361. 'state' => 1,
  362. ),
  363. 'type' => 'all',
  364. 'order' => array('id' => 'desc'),
  365. 'col' => '*',
  366. ),
  367. 'getNew' => array
  368. (
  369. # 匹配的正则或函数 选填项
  370. 'option' => array
  371. (
  372. 'state' => 1,
  373. ),
  374. 'type' => 'all',
  375. 'order' => array('cdate' => 'desc'),
  376. 'limit' => '0,100',
  377. 'col' => '*',
  378. ),
  379. ),
  380. );