buy.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  1. <?php
  2. $pay_account = function()
  3. {
  4. $array = array
  5. (
  6. -1 => '其他',
  7. );
  8. $info = Dever::db('pay/account')->select();
  9. if($info)
  10. {
  11. $array += $info;
  12. }
  13. return $array;
  14. };
  15. $status = array
  16. (
  17. 1 => '待支付',
  18. 2 => '待处理',
  19. 3 => '处理中',
  20. 4 => '待收货确认',
  21. 5 => '已完成',
  22. 6 => '已完成(有退款)',
  23. 7 => '已取消',
  24. 8 => '已退款',
  25. 11 => '已过期',
  26. );
  27. $audit = array
  28. (
  29. //1 => '待审核',
  30. 2 => '审核通过',
  31. 3 => '审核未通过',
  32. );
  33. $seller = function()
  34. {
  35. $array = array();
  36. $info = Dever::db('role/sell')->select();
  37. if($info)
  38. {
  39. $array += $info;
  40. }
  41. return $array;
  42. };
  43. return array
  44. (
  45. # 表名
  46. 'name' => 'buy',
  47. # 显示给用户看的名称
  48. 'lang' => '订货订单',
  49. 'order' => 99,
  50. 'set' => array
  51. (
  52. 'status' => $status,
  53. ),
  54. 'ends' => array
  55. (
  56. 'insert' => 'shop/lib/manage.sellOrderUpdate',
  57. 'update' => 'shop/lib/manage.sellOrderUpdate',
  58. 'updatemul' => 'shop/lib/manage.setSellOrderStatusMul_commit',
  59. ),
  60. # 数据结构
  61. 'struct' => array
  62. (
  63. 'id' => array
  64. (
  65. 'type' => 'int-11',
  66. 'name' => 'ID',
  67. 'default' => '',
  68. 'desc' => '',
  69. 'match' => 'is_numeric',
  70. 'search' => 'order',
  71. //'list' => true,
  72. ),
  73. 'order_num' => array
  74. (
  75. 'type' => 'varchar-100',
  76. 'name' => '订单号',
  77. 'default' => '',
  78. 'desc' => '订单号',
  79. 'match' => 'is_string',
  80. 'update' => 'text',
  81. 'search' => 'fulltext',
  82. 'list_name' => '订单信息',
  83. 'list' => 'Dever::load("order/lib/buy.info#order", {id})',
  84. ),
  85. 'seller_id' => array
  86. (
  87. 'type' => 'int-11',
  88. 'name' => '销售商',
  89. 'default' => '',
  90. 'desc' => '销售商',
  91. 'match' => 'is_numeric',
  92. 'update' => 'hidden',
  93. 'search' => array
  94. (
  95. 'api' => 'role/seller-like',
  96. 'col' => 'name',
  97. 'result' => 'id',
  98. ),
  99. 'value' => Dever::input('search_option_seller_id'),
  100. ),
  101. 'address' => array
  102. (
  103. 'type' => 'varchar-2000',
  104. 'name' => '收货信息',
  105. 'default' => '',
  106. 'desc' => '收货信息',
  107. 'match' => 'is_numeric',
  108. 'search' => 'fulltext',
  109. 'list' => 'Dever::load("order/lib/sell.info#address", {id})',
  110. ),
  111. 'num' => array
  112. (
  113. 'type' => 'int-11',
  114. 'name' => '购买总数量',
  115. 'default' => '',
  116. 'desc' => '购买总数量',
  117. 'match' => 'is_numeric',
  118. 'list_name' => '金额信息',
  119. 'list' => 'Dever::load("order/lib/sell.info#cash", {id})',
  120. ),
  121. 'cash' => array
  122. (
  123. 'type' => 'decimal-11,2',
  124. 'name' => '订单总金额',
  125. 'default' => '0',
  126. 'desc' => '订单总金额',
  127. 'match' => 'option',
  128. 'update' => 'text',
  129. ),
  130. 'pay_account' => array
  131. (
  132. 'type' => 'int-11',
  133. 'name' => '支付账号',
  134. 'default' => '1',
  135. 'desc' => '支付账号',
  136. 'match' => 'is_numeric',
  137. 'update' => 'radio',
  138. 'option' => $pay_account,
  139. ),
  140. 'pay_cash' => array
  141. (
  142. 'type' => 'decimal-11,2',
  143. 'name' => '支付金额',
  144. 'default' => '0',
  145. 'desc' => '支付金额',
  146. 'match' => 'option',
  147. 'update' => 'text',
  148. ),
  149. 'ps_cash' => array
  150. (
  151. 'type' => 'decimal-11,2',
  152. 'name' => '配送费',
  153. 'default' => '0',
  154. 'desc' => '配送费',
  155. 'match' => 'option',
  156. 'update' => 'text',
  157. ),
  158. 'wallet_cash' => array
  159. (
  160. 'type' => 'decimal-11,2',
  161. 'name' => '钱包抵扣金额',
  162. 'default' => '0',
  163. 'desc' => '钱包抵扣金额',
  164. 'match' => 'option',
  165. 'update' => 'text',
  166. ),
  167. 'info' => array
  168. (
  169. 'type' => 'varchar-300',
  170. 'name' => '订单备注',
  171. 'default' => '',
  172. 'desc' => '订单备注',
  173. 'match' => 'option',
  174. 'update' => 'textarea',
  175. ),
  176. 'status' => array
  177. (
  178. 'type' => 'tinyint-1',
  179. 'name' => '订单状态',
  180. 'default' => '1',
  181. 'desc' => '订单状态',
  182. 'match' => 'is_numeric',
  183. 'option' => $status,
  184. 'search' => 'select',
  185. //'search_after' => '<br />',
  186. //'mul' => true,
  187. //'mul_option' => array(2 => '批量审核', 5 => '确认收货'),
  188. ),
  189. 'pay_date' => array
  190. (
  191. 'type' => 'int-11',
  192. 'name' => '付款时间',
  193. 'default' => '',
  194. 'match' => 'is_numeric',
  195. 'desc' => '',
  196. 'list' => '"{paydate}" > 0 ? date("Y-m-d H:i", {paydate}) : "-"',
  197. ),
  198. 'finish_date' => array
  199. (
  200. 'type' => 'int-11',
  201. 'name' => '完成时间',
  202. 'default' => '',
  203. 'match' => 'is_numeric',
  204. 'desc' => '',
  205. 'search' => 'date',
  206. 'list' => '"{finish_date}" ? date("Y-m-d H:i", {finish_date}) : "-"',
  207. ),
  208. 'oper_date' => array
  209. (
  210. 'type' => 'int-11',
  211. 'name' => '审核时间',
  212. 'default' => '',
  213. 'match' => 'is_numeric',
  214. 'desc' => '',
  215. //'list' => '"{operdate}" > 0 ? date("Y-m-d H:i:s", {operdate}) : "-"',
  216. //'list_name' => '发货时间',
  217. //'list_order' => 8,
  218. ),
  219. 'fa_date' => array
  220. (
  221. 'type' => 'int-11',
  222. 'name' => '发货时间',
  223. 'default' => '',
  224. 'match' => 'is_numeric',
  225. 'desc' => '',
  226. 'search' => 'date',
  227. 'list' => '"{fa_date}" > 0 ? date("Y-m-d H:i:s", {fa_date}) : "-"',
  228. ),
  229. 'audit' => array
  230. (
  231. 'type' => 'tinyint-1',
  232. 'name' => '审核状态',
  233. 'default' => '1',
  234. 'desc' => '审核状态',
  235. 'match' => 'is_numeric',
  236. 'option' => $audit,
  237. //'search' => 'select',
  238. 'update' => 'radio',
  239. ),
  240. 'audit_desc' => array
  241. (
  242. 'type' => 'varchar-500',
  243. 'name' => '审核备注',
  244. 'default' => '',
  245. 'desc' => '审核备注',
  246. 'match' => 'option',
  247. 'update' => 'textarea',
  248. ),
  249. 'state' => array
  250. (
  251. 'type' => 'tinyint-1',
  252. 'name' => '状态',
  253. 'default' => '1',
  254. 'desc' => '请选择状态',
  255. 'match' => 'is_numeric',
  256. ),
  257. 'cdate' => array
  258. (
  259. 'type' => 'int-11',
  260. 'name' => '下单时间',
  261. 'match' => array('is_numeric', time()),
  262. 'desc' => '',
  263. # 只有insert时才生效
  264. 'insert' => true,
  265. 'search' => 'sdate',
  266. 'list' => 'date("Y-m-d H:i", {cdate})',
  267. ),
  268. ),
  269. 'manage' => array
  270. (
  271. 'delete' => false,
  272. 'edit' => false,
  273. 'insert' => false,
  274. //'excel' => $excel,
  275. //'mul' => $mul,
  276. 'button' => array
  277. (
  278. //'导出订单明细' => array('excel', 'shop/excel.sell_order'),
  279. ),
  280. 'list_button' => array
  281. (
  282. //fast_list
  283. /*
  284. 'list' => array('查看详情', '"sell_order_goods&project=shop&order_id={id}&page_type=&search_option_shop_type='.$search_option_shop_type.'"'),
  285. 'list11' => array('查看采购单', '"buy_order&project=shop&search_option_type=1&&search_option_parent_type=2&search_option_parent_order_id={id}&oper_table=sell_order&search_option_shop_type='.$search_option_shop_type.'"', '{status} >= 3 && {audit} == 2 && {shop_type} == 2'),
  286. 'list1' => array('审核', '"sell_order_goods&project=shop&order_id={id}&audit=1&page_type=&search_option_shop_type='.$search_option_shop_type.'"', '{status} == 2 && {shop_type} == 2'),
  287. 'oper' => array('确认收货', '"shop/lib/manage.setSellOrderStatus?shop_id={shop_id}&order_id={id}"', '{status} == 4 && {shop_type} == 2'),
  288. */
  289. ),
  290. ),
  291. 'request' => array
  292. (
  293. 'getList' => array
  294. (
  295. # 匹配的正则或函数 选填项
  296. 'option' => array
  297. (
  298. 'shop_id' => 'yes',
  299. 'uid' => 'yes',
  300. 'status' => 'yes',
  301. 'state' => 1,
  302. ),
  303. 'type' => 'all',
  304. 'order' => array('cdate' => 'desc'),
  305. 'page' => array(5, 'list'),
  306. 'col' => '*',
  307. ),
  308. 'getAll' => array
  309. (
  310. # 匹配的正则或函数 选填项
  311. 'option' => array
  312. (
  313. 'uid' => 'yes',
  314. 'name' => array('yes', 'like'),
  315. 'shop_id' => 'yes',
  316. 'mobile' => 'yes',
  317. 'method' => 'yes',
  318. 'pay_method' => 'yes',
  319. 'start' => array('yes-cdate', '>='),
  320. 'end' => array('yes-cdate', '<='),
  321. 'status' => array('yes', 'in'),
  322. 'state' => 1,
  323. ),
  324. 'type' => 'all',
  325. 'order' => array('cdate' => 'desc'),
  326. 'page' => array(10, 'list'),
  327. 'col' => '*',
  328. ),
  329. ),
  330. );