buy_order.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  1. <?php
  2. $pay_status = Dever::config('base', 'pay')->pay['status'];
  3. $status = array
  4. (
  5. 1 => '待支付',
  6. 2 => '待审核',
  7. 3 => '待发货',
  8. 4 => '待收货确认',
  9. 5 => '已完成',
  10. 6 => '已完成(有退款)',
  11. 7 => '已取消',
  12. );
  13. return array
  14. (
  15. # 表名
  16. 'name' => 'buy_order',
  17. # 显示给用户看的名称
  18. 'lang' => '采购订单',
  19. 'order' => 99,
  20. # 数据结构
  21. 'struct' => array
  22. (
  23. 'id' => array
  24. (
  25. 'type' => 'int-11',
  26. 'name' => 'ID',
  27. 'default' => '',
  28. 'desc' => '',
  29. 'match' => 'is_numeric',
  30. 'search' => 'order',
  31. //'list' => true,
  32. ),
  33. 'shop_id' => array
  34. (
  35. 'type' => 'int-11',
  36. 'name' => '所属门店',
  37. 'default' => '',
  38. 'desc' => '所属门店',
  39. 'match' => 'is_numeric',
  40. 'update' => 'hidden',
  41. 'value' => Dever::input('search_option_shop_id'),
  42. 'list' => 'Dever::load("shop/info-find#name", {shop_id})',
  43. ),
  44. 'mobile' => array
  45. (
  46. 'type' => 'varchar-300',
  47. 'name' => '下单手机号',
  48. 'default' => '',
  49. 'desc' => '手机号',
  50. 'match' => 'option',
  51. 'search' => array
  52. (
  53. 'api' => 'shop/info-select',//接口地址,最好是获取多条数据的地址
  54. 'col' => 'mobile',//要查询的字段
  55. 'result' => 'id',//返回的字段
  56. 'search' => 'shop_id',//本表的字段,默认为当前的字段
  57. ),
  58. ),
  59. 'name' => array
  60. (
  61. 'type' => 'varchar-80',
  62. 'name' => '订单名称',
  63. 'default' => '',
  64. 'desc' => '订单名称',
  65. 'match' => 'is_string',
  66. 'update' => 'text',
  67. ),
  68. 'order_num' => array
  69. (
  70. 'type' => 'varchar-100',
  71. 'name' => '订单编号',
  72. 'default' => '',
  73. 'desc' => '订单编号',
  74. 'match' => 'is_string',
  75. 'update' => 'text',
  76. 'search' => 'fulltext',
  77. 'list' => true,
  78. ),
  79. 'price' => array
  80. (
  81. 'type' => 'varchar-50',
  82. 'name' => '购买价格',
  83. 'default' => '',
  84. 'desc' => '购买价格',
  85. 'match' => 'option',
  86. 'update' => 'text',
  87. 'list' => true,
  88. ),
  89. 'num' => array
  90. (
  91. 'type' => 'int-11',
  92. 'name' => '购买数量',
  93. 'default' => '',
  94. 'desc' => '购买数量',
  95. 'match' => 'is_numeric',
  96. 'search' => 'select',
  97. 'list' => true,
  98. ),
  99. 'pay_id' => array
  100. (
  101. 'type' => 'varchar-100',
  102. 'name' => '支付订单ID',
  103. 'default' => '',
  104. 'desc' => '付款订单id',
  105. 'match' => 'is_string',
  106. //'update' => 'text',
  107. //'search' => 'fulltext',
  108. //'list' => true,
  109. ),
  110. 'pay_status' => array
  111. (
  112. 'type' => 'tinyint-1',
  113. 'name' => '支付状态',
  114. 'default' => '1',
  115. 'desc' => '请选择支付状态',
  116. 'match' => 'is_numeric',
  117. 'option' => $pay_status,
  118. ),
  119. 'pay_price' => array
  120. (
  121. 'type' => 'varchar-50',
  122. 'name' => '付款金额',
  123. 'default' => '',
  124. 'desc' => '付款金额',
  125. 'match' => 'option',
  126. 'update' => 'text',
  127. ),
  128. 'info' => array
  129. (
  130. 'type' => 'varchar-300',
  131. 'name' => '订单备注',
  132. 'default' => '',
  133. 'desc' => '订单备注',
  134. 'match' => 'option',
  135. 'update' => 'textarea',
  136. ),
  137. 'note' => array
  138. (
  139. 'type' => 'tinyint-1',
  140. 'name' => '是否发送状态提醒-1未发送,2已发送',
  141. 'default' => '1',
  142. 'desc' => '请选择状态',
  143. 'match' => 'is_numeric',
  144. ),
  145. 'notice' => array
  146. (
  147. 'type' => 'int-11',
  148. 'name' => '模板消息提醒次数',
  149. 'default' => '0',
  150. 'desc' => '模板消息提醒次数',
  151. 'match' => 'is_numeric',
  152. ),
  153. 'tk_pic' => array
  154. (
  155. 'type' => 'varchar-150',
  156. 'name' => '退款截图',
  157. 'default' => '',
  158. 'desc' => '退款截图',
  159. 'match' => 'is_string',
  160. 'update' => 'image',
  161. 'key' => 1
  162. ),
  163. 'tk_time' => array
  164. (
  165. 'type' => 'int-11',
  166. 'name' => '退款时间',
  167. 'default' => '',
  168. 'desc' => '退款时间',
  169. 'match' => 'option',
  170. //'list' => true,
  171. //'update' => 'date',
  172. 'callback' => 'maketime',
  173. 'show' => 'status=5',
  174. ),
  175. 'tk_admin' => array
  176. (
  177. 'type' => 'int-11',
  178. 'name' => '退款审核人',
  179. 'default' => '1',
  180. 'desc' => '退款审核人',
  181. 'match' => 'option',
  182. //'list' => true,
  183. 'show' => 'status=5',
  184. ),
  185. 'tk_desc' => array
  186. (
  187. 'type' => 'varchar-300',
  188. 'name' => '退款备注',
  189. 'default' => '',
  190. 'desc' => '退款备注',
  191. 'match' => 'option',
  192. 'update' => 'textarea',
  193. //'show' => 'status=5',
  194. ),
  195. 'area' => array
  196. (
  197. 'type' => 'varchar-500',
  198. 'name' => '所在地区',
  199. 'default' => '',
  200. 'desc' => '所在地区',
  201. 'match' => 'option',
  202. 'search' => 'linkage',
  203. 'option' => Dever::url('api.get?level_total=4', 'area'),
  204. ),
  205. 'province' => array
  206. (
  207. 'type' => 'int-11',
  208. 'name' => '省份',
  209. 'default' => '',
  210. 'desc' => '省份',
  211. 'match' => 'option',
  212. //'update' => 'text',
  213. ),
  214. 'city' => array
  215. (
  216. 'type' => 'int-11',
  217. 'name' => '城市',
  218. 'default' => '',
  219. 'desc' => '城市',
  220. 'match' => 'option',
  221. //'update' => 'text',
  222. ),
  223. 'county' => array
  224. (
  225. 'type' => 'int-11',
  226. 'name' => '县区',
  227. 'default' => '',
  228. 'desc' => '县区',
  229. 'match' => 'option',
  230. //'update' => 'text',
  231. ),
  232. 'town' => array
  233. (
  234. 'type' => 'int-11',
  235. 'name' => '街道',
  236. 'default' => '',
  237. 'desc' => '街道',
  238. 'match' => 'option',
  239. //'update' => 'text',
  240. ),
  241. 'status' => array
  242. (
  243. 'type' => 'tinyint-1',
  244. 'name' => '状态',
  245. 'default' => '1',
  246. 'desc' => '状态',
  247. 'match' => 'is_numeric',
  248. 'option' => $status,
  249. 'search' => 'select',
  250. 'list' => true,
  251. ),
  252. 'state' => array
  253. (
  254. 'type' => 'tinyint-1',
  255. 'name' => '状态',
  256. 'default' => '1',
  257. 'desc' => '请选择状态',
  258. 'match' => 'is_numeric',
  259. ),
  260. 'cdate' => array
  261. (
  262. 'type' => 'int-11',
  263. 'name' => '下单时间',
  264. 'match' => array('is_numeric', time()),
  265. 'desc' => '',
  266. # 只有insert时才生效
  267. 'insert' => true,
  268. 'search' => 'date',
  269. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  270. //'list' => 'Dever::load("service/lib/manage.showOrderTime", "{id}")',
  271. ),
  272. ),
  273. 'manage' => array
  274. (
  275. 'delete' => false,
  276. 'edit' => false,
  277. 'insert' => false,
  278. 'button' => array
  279. (
  280. //'导出订单' => array('location', 'user/lib/manage.out'),
  281. ),
  282. 'list_button' => array(
  283. //'edit' => array('退款', 'status,tk_time,tk_pic,tk_desc,tk_admin', '{status} == 2'),
  284. //'delete' => array('删除', '', '{status} == 1'),
  285. ),
  286. ),
  287. 'request' => array
  288. (
  289. # 获取订单数量
  290. 'getOrderNum' => array
  291. (
  292. # 匹配的正则或函数 选填项
  293. 'option' => array
  294. (
  295. 'start' => array('yes-cdate', '>='),
  296. 'end' => array('yes-cdate', '<='),
  297. 'shop_id' => 'yes',
  298. 'status' => array('yes', 'in'),
  299. 'state' => 1,
  300. ),
  301. 'type' => 'count',
  302. 'col' => '*',
  303. ),
  304. # 获取总金额
  305. 'getCashNum' => array
  306. (
  307. # 匹配的正则或函数 选填项
  308. 'option' => array
  309. (
  310. 'start' => array('yes-cdate', '>='),
  311. 'end' => array('yes-cdate', '<='),
  312. 'shop_id' => 'yes',
  313. 'status' => array('yes', 'in'),
  314. 'state' => 1,
  315. ),
  316. 'type' => 'one',
  317. 'col' => 'sum(price) as total',
  318. ),
  319. # 获取商品数量
  320. 'getGoodsNum' => array
  321. (
  322. # 匹配的正则或函数 选填项
  323. 'option' => array
  324. (
  325. 'start' => array('yes-cdate', '>='),
  326. 'end' => array('yes-cdate', '<='),
  327. 'shop_id' => 'yes',
  328. 'status' => array('yes', 'in'),
  329. 'state' => 1,
  330. ),
  331. 'type' => 'one',
  332. 'col' => 'sum(num) as total',
  333. ),
  334. ),
  335. );