order.php 8.7 KB

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