sell.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433
  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. $method = array
  16. (
  17. 1 => '自提',
  18. 2 => '外送',
  19. );
  20. $status = array
  21. (
  22. 1 => '待支付',
  23. 2 => '待处理',
  24. 3 => '处理中',
  25. 4 => '待收货确认',
  26. 5 => '已完成',
  27. 6 => '已完成(有退款)',
  28. 7 => '已取消',
  29. 8 => '已退款',
  30. 11 => '已过期',
  31. );
  32. $seller = function()
  33. {
  34. $array = array();
  35. $info = Dever::db('role/sell')->select();
  36. if($info)
  37. {
  38. $array += $info;
  39. }
  40. return $array;
  41. };
  42. return array
  43. (
  44. # 表名
  45. 'name' => 'sell',
  46. # 显示给用户看的名称
  47. 'lang' => '销售订单',
  48. 'order' => 100,
  49. 'set' => array
  50. (
  51. 'status' => $status,
  52. 'method' => $method,
  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/sell.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. 'uid' => array
  102. (
  103. 'type' => 'int-11',
  104. 'name' => '购买人',
  105. 'default' => '0',
  106. 'desc' => '购买人',
  107. 'match' => 'is_numeric',
  108. 'update' => 'text',
  109. 'search' => array
  110. (
  111. 'api' => 'passport/user-like',
  112. 'col' => 'username',
  113. 'result' => 'id',
  114. ),
  115. ),
  116. 'address' => array
  117. (
  118. 'type' => 'varchar-2000',
  119. 'name' => '收货信息',
  120. 'default' => '',
  121. 'desc' => '收货信息',
  122. 'match' => 'is_numeric',
  123. 'search' => 'fulltext',
  124. 'list' => 'Dever::load("order/lib/sell.info#address", {id})',
  125. ),
  126. 'num' => array
  127. (
  128. 'type' => 'int-11',
  129. 'name' => '购买总数量',
  130. 'default' => '',
  131. 'desc' => '购买总数量',
  132. 'match' => 'is_numeric',
  133. 'list_name' => '金额信息',
  134. 'list' => 'Dever::load("order/lib/sell.info#cash", {id})',
  135. ),
  136. 'cash' => array
  137. (
  138. 'type' => 'decimal-11,2',
  139. 'name' => '订单总金额',
  140. 'default' => '0',
  141. 'desc' => '订单总金额',
  142. 'match' => 'option',
  143. 'update' => 'text',
  144. ),
  145. 'pay_account' => array
  146. (
  147. 'type' => 'int-11',
  148. 'name' => '支付账号',
  149. 'default' => '1',
  150. 'desc' => '支付账号',
  151. 'match' => 'is_numeric',
  152. 'update' => 'radio',
  153. ),
  154. 'pay_cash' => array
  155. (
  156. 'type' => 'decimal-11,2',
  157. 'name' => '支付金额',
  158. 'default' => '0',
  159. 'desc' => '支付金额',
  160. 'match' => 'option',
  161. 'update' => 'text',
  162. ),
  163. 'ps_cash' => array
  164. (
  165. 'type' => 'decimal-11,2',
  166. 'name' => '配送费',
  167. 'default' => '0',
  168. 'desc' => '配送费',
  169. 'match' => 'option',
  170. 'update' => 'text',
  171. ),
  172. 'card_id' => array
  173. (
  174. 'type' => 'int-11',
  175. 'name' => '用户的礼品卡id',
  176. 'default' => '',
  177. 'desc' => '礼品卡id',
  178. 'match' => 'option',
  179. ),
  180. 'card_cash' => array
  181. (
  182. 'type' => 'decimal-11,2',
  183. 'name' => '礼品卡抵扣金额',
  184. 'default' => '0',
  185. 'desc' => '礼品卡抵扣金额',
  186. 'match' => 'option',
  187. 'update' => 'text',
  188. ),
  189. 'wallet_cash' => array
  190. (
  191. 'type' => 'decimal-11,2',
  192. 'name' => '钱包抵扣金额',
  193. 'default' => '0',
  194. 'desc' => '钱包抵扣金额',
  195. 'match' => 'option',
  196. 'update' => 'text',
  197. ),
  198. 'coupon_id' => array
  199. (
  200. 'type' => 'int-11',
  201. 'name' => '用户的优惠券id',
  202. 'default' => '',
  203. 'desc' => '用户的优惠券id',
  204. 'match' => 'option',
  205. ),
  206. 'coupon_cash' => array
  207. (
  208. 'type' => 'decimal-11,2',
  209. 'name' => '优惠金额',
  210. 'default' => '0',
  211. 'desc' => '优惠金额',
  212. 'match' => 'option',
  213. 'update' => 'text',
  214. ),
  215. 'discount_id' => array
  216. (
  217. 'type' => 'int-11',
  218. 'name' => '折扣ID',
  219. 'default' => '',
  220. 'desc' => '折扣ID',
  221. 'match' => 'option',
  222. ),
  223. 'discount_cash' => array
  224. (
  225. 'type' => 'decimal-11,2',
  226. 'name' => '折扣优惠金额',
  227. 'default' => '0',
  228. 'desc' => '折扣优惠金额',
  229. 'match' => 'option',
  230. 'update' => 'text',
  231. ),
  232. 'method' => array
  233. (
  234. 'type' => 'int-11',
  235. 'name' => '配送类型',
  236. 'default' => '1',
  237. 'desc' => '配送类型',
  238. 'match' => 'is_numeric',
  239. 'update' => 'radio',
  240. 'option' => $method,
  241. ),
  242. 'code' => array
  243. (
  244. 'type' => 'varchar-100',
  245. 'name' => '自提码或者核销码',
  246. 'default' => '',
  247. 'desc' => '自提码或者核销码',
  248. 'match' => 'is_numeric',
  249. ),
  250. 'info' => array
  251. (
  252. 'type' => 'varchar-300',
  253. 'name' => '订单备注',
  254. 'default' => '',
  255. 'desc' => '订单备注',
  256. 'match' => 'option',
  257. 'update' => 'textarea',
  258. ),
  259. 'status' => array
  260. (
  261. 'type' => 'tinyint-1',
  262. 'name' => '订单状态',
  263. 'default' => '1',
  264. 'desc' => '订单状态',
  265. 'match' => 'is_numeric',
  266. 'option' => $status,
  267. 'search' => 'select',
  268. //'search_after' => '<br />',
  269. //'mul' => true,
  270. //'mul_option' => array(2 => '批量审核', 5 => '确认收货'),
  271. ),
  272. 'pay_date' => array
  273. (
  274. 'type' => 'int-11',
  275. 'name' => '付款时间',
  276. 'default' => '',
  277. 'match' => 'is_numeric',
  278. 'desc' => '',
  279. 'list' => '"{paydate}" > 0 ? date("Y-m-d H:i", {paydate}) : "-"',
  280. ),
  281. 'finish_date' => array
  282. (
  283. 'type' => 'int-11',
  284. 'name' => '完成时间',
  285. 'default' => '',
  286. 'match' => 'is_numeric',
  287. 'desc' => '',
  288. 'search' => 'date',
  289. 'list' => '"{finish_date}" ? date("Y-m-d H:i", {finish_date}) : "-"',
  290. ),
  291. 'oper_date' => array
  292. (
  293. 'type' => 'int-11',
  294. 'name' => '审核时间',
  295. 'default' => '',
  296. 'match' => 'is_numeric',
  297. 'desc' => '',
  298. //'list' => '"{operdate}" > 0 ? date("Y-m-d H:i:s", {operdate}) : "-"',
  299. //'list_name' => '发货时间',
  300. //'list_order' => 8,
  301. ),
  302. 'fa_date' => array
  303. (
  304. 'type' => 'int-11',
  305. 'name' => '发货时间',
  306. 'default' => '',
  307. 'match' => 'is_numeric',
  308. 'desc' => '',
  309. 'search' => 'date',
  310. 'list' => '"{fa_date}" > 0 ? date("Y-m-d H:i:s", {fa_date}) : "-"',
  311. ),
  312. 'state' => array
  313. (
  314. 'type' => 'tinyint-1',
  315. 'name' => '状态',
  316. 'default' => '1',
  317. 'desc' => '请选择状态',
  318. 'match' => 'is_numeric',
  319. ),
  320. 'cdate' => array
  321. (
  322. 'type' => 'int-11',
  323. 'name' => '下单时间',
  324. 'match' => array('is_numeric', time()),
  325. 'desc' => '',
  326. # 只有insert时才生效
  327. 'insert' => true,
  328. 'search' => 'sdate',
  329. 'list' => 'date("Y-m-d H:i", {cdate})',
  330. ),
  331. ),
  332. 'manage' => array
  333. (
  334. 'delete' => false,
  335. 'edit' => false,
  336. 'insert' => false,
  337. //'excel' => $excel,
  338. //'mul' => $mul,
  339. 'button' => array
  340. (
  341. //'导出订单明细' => array('excel', 'shop/excel.sell_order'),
  342. ),
  343. 'list_button' => array
  344. (
  345. //fast_list
  346. /*
  347. 'list' => array('查看详情', '"sell_order_goods&project=shop&order_id={id}&page_type=&search_option_shop_type='.$search_option_shop_type.'"'),
  348. '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'),
  349. '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'),
  350. 'oper' => array('确认收货', '"shop/lib/manage.setSellOrderStatus?shop_id={shop_id}&order_id={id}"', '{status} == 4 && {shop_type} == 2'),
  351. */
  352. ),
  353. ),
  354. 'request' => array
  355. (
  356. 'getList' => array
  357. (
  358. # 匹配的正则或函数 选填项
  359. 'option' => array
  360. (
  361. 'shop_id' => 'yes',
  362. 'uid' => 'yes',
  363. 'status' => 'yes',
  364. 'state' => 1,
  365. ),
  366. 'type' => 'all',
  367. 'order' => array('cdate' => 'desc'),
  368. 'page' => array(5, 'list'),
  369. 'col' => '*',
  370. ),
  371. 'getAll' => array
  372. (
  373. # 匹配的正则或函数 选填项
  374. 'option' => array
  375. (
  376. 'uid' => 'yes',
  377. 'name' => array('yes', 'like'),
  378. 'shop_id' => 'yes',
  379. 'mobile' => 'yes',
  380. 'method' => 'yes',
  381. 'pay_method' => 'yes',
  382. 'start' => array('yes-cdate', '>='),
  383. 'end' => array('yes-cdate', '<='),
  384. 'status' => array('yes', 'in'),
  385. 'state' => 1,
  386. ),
  387. 'type' => 'all',
  388. 'order' => array('cdate' => 'desc'),
  389. 'page' => array(10, 'list'),
  390. 'col' => '*',
  391. ),
  392. ),
  393. );