sell_order.php 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064
  1. <?php
  2. $pay_status = Dever::config('base', 'pay')->pay['status'];
  3. $method = array
  4. (
  5. 1 => '自提',
  6. 2 => '外送',
  7. );
  8. $pay_method = array
  9. (
  10. 1 => '平台结算',
  11. 2 => '门店代下单',
  12. 3 => '礼品卡',
  13. );
  14. $audit = array
  15. (
  16. //1 => '待审核',
  17. 2 => '审核通过',
  18. 3 => '审核未通过',
  19. );
  20. $pay_type = array
  21. (
  22. 1 => '微信',
  23. 2 => '现金',
  24. );
  25. $status = array
  26. (
  27. 1 => '待支付',
  28. 2 => '待处理',
  29. 3 => '处理中',
  30. 4 => '待收货确认',
  31. 5 => '已完成',
  32. 6 => '已完成(有退款)',
  33. 7 => '已取消',
  34. 8 => '已取消',//已退款
  35. 11 => '已取消',//已过期
  36. );
  37. $status_manage = array
  38. (
  39. 1 => '待支付',
  40. 2 => '待处理',
  41. 3 => '处理中',
  42. 4 => '待收货确认',
  43. 5 => '已完成',
  44. 6 => '已完成(有退款)',
  45. 7 => '已取消',
  46. 8 => '已退款',//已退款
  47. 11 => '已过期',//已过期
  48. );
  49. //1待支付2支付成功3处理中4待确认5已完成6已完成(有退款)7已取消8已退款11已过期
  50. $refund_status = array
  51. (
  52. 1 => '未申请',
  53. 2 => '申请中',
  54. 3 => '有退款',
  55. 4 => '已退款',
  56. );
  57. $shop = function()
  58. {
  59. $array = array();
  60. $info = Dever::db('shop/info')->select();
  61. if($info)
  62. {
  63. $array += $info;
  64. }
  65. return $array;
  66. };
  67. $store = function()
  68. {
  69. $array = array();
  70. $info = Dever::db('store/info')->select();
  71. if($info)
  72. {
  73. $array += $info;
  74. }
  75. return $array;
  76. };
  77. $withdraw = array
  78. (
  79. 1 => '未提现',
  80. 2 => '已提现',
  81. );
  82. $shop_type = array
  83. (
  84. 1 => '普通店',
  85. 2 => '平台店',
  86. );
  87. $search_option_shop_type = Dever::input('search_option_shop_type', 1);
  88. if ($search_option_shop_type == 1) {
  89. $excel = array
  90. (
  91. array('导出订单', '门店零售订单', ''),
  92. array('导出订单明细', '门店零售订单明细', 'shop/excel.sell_order'),
  93. );
  94. $refund_search = false;
  95. } elseif ($search_option_shop_type == 2) {
  96. $excel = array
  97. (
  98. array('导出订单', '平台商城订单', ''),
  99. array('导出订单明细', '平台商城订单明细', 'shop/excel.p_sell_order'),
  100. );
  101. $refund_search = 'select';
  102. }
  103. $mul = false;
  104. if (Dever::load('manage/auth')->checkFunc('menu_61.menu_85', 'piliangfafang', '批量收货')) {
  105. $mul = '({status} == 4 || {status} == 2) && {shop_type} == 2';
  106. } elseif (Dever::load('manage/auth')->checkFunc('menu_61.menu_218', 'piliangfafang', '批量收货')) {
  107. $mul = '({status} == 4 || {status} == 2) && {shop_type} == 2';
  108. }
  109. return array
  110. (
  111. # 表名
  112. 'name' => 'sell_order',
  113. # 显示给用户看的名称
  114. 'lang' => '销售订单',
  115. 'order' => 100,
  116. 'status' => $status,
  117. 'status_manage' => $status_manage,
  118. 'pay_method' => $pay_method,
  119. 'pay_type' => $pay_type,
  120. 'method' => $method,
  121. 'end' => array
  122. (
  123. 'insert' => 'shop/lib/manage.sellOrderUpdate',
  124. 'update' => 'shop/lib/manage.sellOrderUpdate',
  125. 'updatemul' => 'shop/lib/manage.setSellOrderStatusMul_commit',
  126. ),
  127. # 数据结构
  128. 'struct' => array
  129. (
  130. 'id' => array
  131. (
  132. 'type' => 'int-11',
  133. 'name' => 'ID',
  134. 'default' => '',
  135. 'desc' => '',
  136. 'match' => 'is_numeric',
  137. 'search' => 'order',
  138. //'list' => true,
  139. ),
  140. 'shop-info-sid'=> array
  141. (
  142. 'name' => '门店编号',
  143. 'default' => '',
  144. 'desc' => '门店编号',
  145. 'match' => 'option',
  146. # 读取另外表的关联方式
  147. 'sync' => array('shop_id', 'id'),
  148. 'list' => $search_option_shop_type == 1 ? true : false,
  149. 'list_order' => 1,
  150. ),
  151. 'shop_id' => array
  152. (
  153. 'type' => 'int-11',
  154. 'name' => '门店名称',
  155. 'default' => '',
  156. 'desc' => '门店名称',
  157. 'match' => 'is_numeric',
  158. 'search' => 'select',
  159. 'option' => $shop,
  160. 'update' => 'hidden',
  161. 'search' => 'hidden',
  162. 'search' => $search_option_shop_type == 1 ? array
  163. (
  164. 'api' => 'shop/info-like',
  165. 'col' => 'name',
  166. 'result' => 'id',
  167. ) : 'hidden',
  168. 'value' => Dever::input('search_option_shop_id'),
  169. 'list' => $search_option_shop_type == 1 ? 'Dever::load("shop/info-one#name", {shop_id})' : false,
  170. 'list_order' => 2,
  171. ),
  172. 'store_id' => array
  173. (
  174. 'type' => 'int-11',
  175. 'name' => '发货仓库-废弃',
  176. 'default' => '',
  177. 'desc' => '发货仓库',
  178. 'match' => 'is_numeric',
  179. 'option' => $store,
  180. 'update' => 'select',
  181. 'searchs' => $search_option_shop_type == 2 ? array
  182. (
  183. 'api' => 'store/info-like',
  184. 'col' => 'name',
  185. 'result' => 'id',
  186. ) : 'hidden',
  187. //'list' => $search_option_shop_type == 2 ? '"{store_id}" > 0 ? Dever::load("store/info-one#name", {store_id}) : ""' : false,
  188. 'list_order' => 6,
  189. ),
  190. 'shop-info-type'=> array
  191. (
  192. 'name' => '门店类型',
  193. 'default' => '',
  194. 'desc' => '门店类型',
  195. 'match' => 'option',
  196. # 读取另外表的关联方式
  197. 'sync' => array('shop_id', 'id'),
  198. 'list' => $search_option_shop_type == 1 ? 'Dever::load("shop/lib/manage.shopInfoType", {shop-info-type})' : false,
  199. 'list_order' => 3,
  200. ),
  201. 'area' => array
  202. (
  203. 'type' => 'varchar-500',
  204. 'name' => '所在街道',
  205. 'default' => '',
  206. 'desc' => '所在街道',
  207. 'match' => 'option',
  208. 'search' => $search_option_shop_type == 1 ? 'linkage' : false,
  209. 'update' => 'linkage',
  210. 'option' => Dever::url('lib/area.get', 'shop'),
  211. //'list' => 'Dever::load("area/api.string", "{area}")',
  212. ),
  213. 'uid' => array
  214. (
  215. 'type' => 'int-11',
  216. 'name' => $search_option_shop_type == 1 ? '购买人' : '收件人',
  217. 'default' => '0',
  218. 'desc' => '请选择用户',
  219. 'match' => 'is_numeric',
  220. 'update' => 'text',
  221. //'search' => 'select',
  222. 'search' => $search_option_shop_type == 1 ? array
  223. (
  224. 'api' => 'passport/user-one',
  225. 'col' => 'username',
  226. 'result' => 'id',
  227. ) : array
  228. (
  229. 'api' => 'passport/address-all',
  230. 'col' => 'contact',
  231. 'result' => 'id',//返回的字段
  232. 'search' => 'address_id',//本表的字段,默认为当前的字段
  233. ),
  234. 'list' => $search_option_shop_type == 1 ? 'Dever::load("shop/lib/manage.user", {id})' : 'Dever::load("passport/address-one#contact", {address_id})',
  235. 'list_order' => 5,
  236. ),
  237. 'mobile' => array
  238. (
  239. 'type' => 'varchar-300',
  240. 'name' => $search_option_shop_type == 1 ? '下单手机号' : '收件人手机',
  241. 'default' => '',
  242. 'desc' => '手机号',
  243. 'match' => 'option',
  244. 'search' => 'fulltext',
  245. 'search' => $search_option_shop_type == 1 ? 'fulltext' : array
  246. (
  247. 'api' => 'passport/address-all',//接口地址,最好是获取多条数据的地址
  248. 'col' => 'mobile',//要查询的字段
  249. 'result' => 'id',//返回的字段
  250. 'search' => 'address_id',//本表的字段,默认为当前的字段
  251. ),
  252. 'list' => $search_option_shop_type == 1 ? false : 'Dever::load("passport/address-one#mobile", {address_id})',
  253. 'list_order' => 6,
  254. ),
  255. 'address_id' => array
  256. (
  257. 'type' => 'int-11',
  258. 'name' => $search_option_shop_type == 1 ? false : '商品信息',#'送货地址',
  259. 'default' => '',
  260. 'desc' => '送货地址',
  261. 'match' => 'is_numeric',
  262. 'list' => $search_option_shop_type == 1 ? false : 'Dever::load("shop/lib/manage.goods_list",{id})',
  263. //'list' => 'Dever::load("passport/address-find#address", {address_id})';
  264. ),
  265. 'invoice_id' => array
  266. (
  267. 'type' => 'int-11',
  268. 'name' => '发票信息',
  269. 'default' => '',
  270. 'desc' => '发票信息',
  271. 'match' => 'is_numeric',
  272. //'list' => 'Dever::load("passport/address-find#address", {address_id})';
  273. ),
  274. 'name' => array
  275. (
  276. 'type' => 'varchar-800',
  277. 'name' => '订单名称',
  278. 'default' => '',
  279. 'desc' => '订单名称',
  280. 'match' => 'is_string',
  281. 'update' => 'text',
  282. ),
  283. 'order_num' => array
  284. (
  285. 'type' => 'varchar-100',
  286. 'name' => '订单号',
  287. 'default' => '',
  288. 'desc' => '订单号',
  289. 'match' => 'is_string',
  290. 'update' => 'text',
  291. 'search' => 'fulltext',
  292. 'list' => true,
  293. 'list_order' => 4,
  294. ),
  295. 'oprice' => array
  296. (
  297. 'type' => 'varchar-50',
  298. 'name' => '原价',
  299. 'default' => '0',
  300. 'desc' => '原价',
  301. 'match' => 'option',
  302. 'update' => 'text',
  303. 'list_name' => '合计金额',
  304. //'list' => $search_option_shop_type == 1 ? 'Dever::load("shop/lib/manage.getTotalCash", {id})' : false,
  305. 'list' => 'Dever::load("shop/lib/manage.getTotalCash", {id})',
  306. 'list_order' => 10,
  307. ),
  308. 'price' => array
  309. (
  310. 'type' => 'varchar-50',
  311. //'name' => $search_option_shop_type == 1 ? '实付金额' : '订单总金额',
  312. 'name' => '实付金额',
  313. 'default' => '0',
  314. 'desc' => '实付金额',
  315. 'match' => 'option',
  316. 'update' => 'text',
  317. 'list' => 'Dever::load("cash/lib/set.getCash", "{price}")',
  318. 'list_order' => 11,
  319. ),
  320. 'num' => array
  321. (
  322. 'type' => 'int-11',
  323. 'name' => '购买总数量',
  324. 'default' => '',
  325. 'desc' => '购买总数量',
  326. 'match' => 'is_numeric',
  327. 'search' => 'select',
  328. 'list' => $search_option_shop_type == 2 ? true : false,
  329. 'list_order' => 10,
  330. ),
  331. 'refund_num' => array
  332. (
  333. 'type' => 'int-11',
  334. 'name' => '退款数量',
  335. 'default' => '0',
  336. 'desc' => '退款数量',
  337. 'match' => 'is_numeric',
  338. ),
  339. 'refund_cash' => array
  340. (
  341. 'type' => 'varchar-50',
  342. 'name' => $search_option_shop_type == 1 ? '已退订单金额' : '退款金额',
  343. 'default' => '0',
  344. 'desc' => '已退订单金额',
  345. 'match' => 'option',
  346. 'update' => 'text',
  347. 'list' => true,
  348. 'list_order' => $search_option_shop_type == 1 ? 12 : 19,
  349. ),
  350. 'refund_status' => array
  351. (
  352. 'type' => 'tinyint-1',
  353. 'name' => '退款状态',
  354. 'default' => '1',
  355. 'desc' => '申请退款状态',
  356. 'match' => 'is_numeric',
  357. 'option' => $refund_status,
  358. 'search' => $refund_search,
  359. 'list' => $search_option_shop_type == 2 ? 'Dever::load("shop/lib/manage.buyInfoRefundStatus", "{id}", "sell_order")' : false,
  360. 'list_name' => '退款状态',
  361. 'list_order' => 18,
  362. ),
  363. 'kou_cash' => array
  364. (
  365. 'type' => 'varchar-50',
  366. 'name' => '抹零金额',
  367. 'default' => '0',
  368. 'desc' => '抹零金额',
  369. 'match' => 'option',
  370. 'update' => 'text',
  371. ),
  372. 'ps_cash' => array
  373. (
  374. 'type' => 'varchar-50',
  375. 'name' => '配送费',
  376. 'default' => '0',
  377. 'desc' => '配送费',
  378. 'match' => 'option',
  379. 'update' => 'text',
  380. ),
  381. 'card_code_id' => array
  382. (
  383. 'type' => 'int-11',
  384. 'name' => '礼品卡id',
  385. 'default' => '',
  386. 'desc' => '礼品卡id',
  387. 'match' => 'option',
  388. ),
  389. 'card_code_card' => array
  390. (
  391. 'type' => 'varchar-800',
  392. 'name' => '礼品卡卡号',
  393. 'default' => '',
  394. 'desc' => '礼品卡卡号',
  395. 'match' => 'option',
  396. 'update' => 'text',
  397. ),
  398. 'card_code_cash' => array
  399. (
  400. 'type' => 'varchar-50',
  401. 'name' => '礼品卡抵扣金额',
  402. 'default' => '0',
  403. 'desc' => '礼品卡抵扣金额',
  404. 'match' => 'option',
  405. 'update' => 'text',
  406. ),
  407. 'wallet_cash' => array
  408. (
  409. 'type' => 'varchar-50',
  410. 'name' => '钱包抵扣金额',
  411. 'default' => '0',
  412. 'desc' => '钱包抵扣金额',
  413. 'match' => 'option',
  414. 'update' => 'text',
  415. ),
  416. 'coupon_id' => array
  417. (
  418. 'type' => 'int-11',
  419. 'name' => '门店的优惠券id',
  420. 'default' => '',
  421. 'desc' => '门店的优惠券id',
  422. 'match' => 'option',
  423. ),
  424. 'user_coupon_id' => array
  425. (
  426. 'type' => 'int-11',
  427. 'name' => '用户的优惠券id',
  428. 'default' => '',
  429. 'desc' => '用户的优惠券id',
  430. 'match' => 'option',
  431. ),
  432. 'coupon_cash' => array
  433. (
  434. 'type' => 'varchar-300',
  435. 'name' => '优惠金额',
  436. 'default' => '0',
  437. 'desc' => '优惠金额',
  438. 'match' => 'option',
  439. 'update' => 'text',
  440. ),
  441. 'discount_id' => array
  442. (
  443. 'type' => 'int-11',
  444. 'name' => '折扣ID',
  445. 'default' => '',
  446. 'desc' => '折扣ID',
  447. 'match' => 'option',
  448. ),
  449. 'discount_cash' => array
  450. (
  451. 'type' => 'varchar-300',
  452. 'name' => '折扣优惠金额',
  453. 'default' => '0',
  454. 'desc' => '折扣优惠金额',
  455. 'match' => 'option',
  456. 'update' => 'text',
  457. ),
  458. 'method' => array
  459. (
  460. 'type' => 'int-11',
  461. 'name' => '配送类型',
  462. 'default' => '1',
  463. 'desc' => '配送类型',
  464. 'match' => 'is_numeric',
  465. 'update' => 'radio',
  466. 'search' => $search_option_shop_type == 1 ? 'select' : false,
  467. 'option' => $method,
  468. 'list' => $search_option_shop_type == 1 ? true : false,
  469. 'list_order' => 5,
  470. ),
  471. 'code' => array
  472. (
  473. 'type' => 'varchar-100',
  474. 'name' => '自提码或者核销码',
  475. 'default' => '',
  476. 'desc' => '自提码或者核销码',
  477. 'match' => 'is_numeric',
  478. ),
  479. 'pay_method' => array
  480. (
  481. 'type' => 'int-11',
  482. 'name' => '订单类型',
  483. 'default' => '1',
  484. 'desc' => '订单类型',
  485. 'match' => 'is_numeric',
  486. 'update' => 'radio',
  487. 'search' => $search_option_shop_type == 1 ? 'select' : false,
  488. 'option' => $pay_method,
  489. 'list' => $search_option_shop_type == 1 ? true : false,
  490. 'list_order' => 6,
  491. ),
  492. 'pay_type' => array
  493. (
  494. 'type' => 'int-11',
  495. 'name' => '支付渠道',
  496. 'default' => '1',
  497. 'desc' => '支付渠道',
  498. 'match' => 'is_numeric',
  499. 'update' => 'radio',
  500. 'option' => $pay_type,
  501. 'list' => $search_option_shop_type == 1 ? true : false,
  502. 'list_order' => 13,
  503. ),
  504. 'info' => array
  505. (
  506. 'type' => 'varchar-300',
  507. 'name' => '订单备注',
  508. 'default' => '',
  509. 'desc' => '订单备注',
  510. 'match' => 'option',
  511. 'update' => 'textarea',
  512. ),
  513. 'withdraw' => array
  514. (
  515. 'type' => 'tinyint-1',
  516. 'name' => '是否提现',
  517. 'default' => '1',
  518. 'desc' => '是否提现',
  519. 'match' => 'is_numeric',
  520. 'option' => $withdraw,
  521. //'search' => 'select',
  522. ),
  523. 'shop_type' => array
  524. (
  525. 'type' => 'tinyint-1',
  526. 'name' => '门店类型',
  527. 'default' => '1',
  528. 'desc' => '门店类型',
  529. 'match' => 'is_numeric',
  530. 'option' => $shop_type,
  531. 'search' => 'hidden',
  532. //'search' => 'select',
  533. ),
  534. 'status' => array
  535. (
  536. 'type' => 'tinyint-1',
  537. 'name' => '订单状态',
  538. 'default' => '1',
  539. 'desc' => '订单状态',
  540. 'match' => 'is_numeric',
  541. 'option' => $status_manage,
  542. 'search' => 'select',
  543. //'search_after' => '<br />',
  544. 'list' => true,
  545. 'list_order' => 14,
  546. 'mul' => true,
  547. 'mul_option' => array(2 => '批量审核', 5 => '确认收货'),
  548. ),
  549. 'audit' => array
  550. (
  551. 'type' => 'tinyint-1',
  552. 'name' => '审核状态',
  553. 'default' => '2',
  554. 'desc' => '审核状态',
  555. 'match' => 'is_numeric',
  556. 'option' => $audit,
  557. //'search' => 'select',
  558. 'update' => 'radio',
  559. ),
  560. 'audit_desc' => array
  561. (
  562. 'type' => 'varchar-500',
  563. 'name' => '审核备注',
  564. 'default' => '',
  565. 'desc' => '审核备注',
  566. 'match' => 'option',
  567. 'update' => 'textarea',
  568. ),
  569. 'notice' => array
  570. (
  571. 'type' => 'tinyint-1',
  572. 'name' => '是否发送通知',
  573. 'default' => '1',
  574. 'desc' => '是否发送通知',
  575. 'match' => 'is_numeric',
  576. ),
  577. 'fdate' => array
  578. (
  579. 'type' => 'int-11',
  580. 'name' => '完成时间',
  581. 'default' => '',
  582. 'match' => 'is_numeric',
  583. 'desc' => '',
  584. 'search' => 'date',
  585. 'list_name' =>'收货时间',
  586. 'list' => '"{fdate}" ? date("Y-m-d H:i", \'{fdate}\') : "-"',
  587. 'list_order' => 8,
  588. ),
  589. 'paydate' => array
  590. (
  591. 'type' => 'int-11',
  592. 'name' => '付款时间',
  593. 'default' => '',
  594. 'match' => 'is_numeric',
  595. 'desc' => '',
  596. 'list' => '"{paydate}" > 0 ? date("Y-m-d H:i", {paydate}) : "-"',
  597. 'list_order' => 9,
  598. ),
  599. 'operdate' => array
  600. (
  601. 'type' => 'int-11',
  602. 'name' => '操作时间',
  603. 'default' => '',
  604. 'match' => 'is_numeric',
  605. 'desc' => '',
  606. //'list' => '"{operdate}" > 0 ? date("Y-m-d H:i:s", {operdate}) : "-"',
  607. //'list_name' => '发货时间',
  608. //'list_order' => 8,
  609. ),
  610. 'fadate' => array
  611. (
  612. 'type' => 'int-11',
  613. 'name' => '发货时间',
  614. 'default' => '',
  615. 'match' => 'is_numeric',
  616. 'desc' => '',
  617. 'search' => 'date',
  618. 'list' => '"{fadate}" > 0 ? date("Y-m-d H:i:s", {fadate}) : "-"',
  619. 'list_order' => 8,
  620. ),
  621. 'shop-sell_order_ps-cdate'=> array
  622. (
  623. 'name' => '发货时间',
  624. 'default' => '',
  625. 'desc' => '发货时间',
  626. 'match' => 'option',
  627. # 读取另外表的关联方式
  628. 'sync' => array('id', 'order_id'),
  629. // 'list' => '"{shop-sell_order_ps-cdate}" ? date("Y-m-d H:i", \'{shop-sell_order_ps-cdate}\') : "-"',
  630. // 'list_order' => 8,
  631. ),
  632. 'state' => array
  633. (
  634. 'type' => 'tinyint-1',
  635. 'name' => '状态',
  636. 'default' => '1',
  637. 'desc' => '请选择状态',
  638. 'match' => 'is_numeric',
  639. ),
  640. 'cdate' => array
  641. (
  642. 'type' => 'int-11',
  643. 'name' => '下单时间',
  644. 'match' => array('is_numeric', time()),
  645. 'desc' => '',
  646. # 只有insert时才生效
  647. 'insert' => true,
  648. 'search' => 'sdate',
  649. 'list' => 'date("Y-m-d H:i", {cdate})',
  650. //'list' => 'Dever::load("service/lib/manage.showOrderTime", "{id}")',
  651. 'list_order' => 7,
  652. ),
  653. ),
  654. 'manage' => array
  655. (
  656. 'delete' => false,
  657. 'edit' => false,
  658. 'insert' => false,
  659. 'excel' => $excel,
  660. 'mul' => $mul,
  661. # 表格使用html模式,默认是js渲染模式
  662. 'list_table' => 'html',
  663. 'button' => array
  664. (
  665. //'导出订单明细' => array('excel', 'shop/excel.sell_order'),
  666. ),
  667. 'list_button' => array
  668. (
  669. //fast_list
  670. 'list' => array('查看详情', '"sell_order_goods&project=shop&order_id={id}&page_type=&search_option_shop_type='.$search_option_shop_type.'"'),
  671. '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'),
  672. //'location2' => array('分配仓库', Dever::url('lib/set.store', 'shop')),
  673. //'edit' => array('分配仓库', 'store_id', '{status} == 2 && {shop_type} == 2'),
  674. //'fast1' => array('发货', '"sell_order_ps&where_id={id}&search_option_order_id={id}&oper_save_jump=sell_order&oper_table=sell_order&oper_parent=sell_order"', '{status} == 2 && {shop_type} == 2'),
  675. //'fast' => array('审核', '"sell_order&where_id={id}&col=audit,audit_desc&oper_save_jump=sell_order&oper_table=sell_order&oper_parent=sell_order"', '{status} == 2 && {shop_type} == 2'),
  676. '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'),
  677. 'oper' => array('确认收货', '"shop/lib/manage.setSellOrderStatus?shop_id={shop_id}&order_id={id}"', '{status} == 4 && {shop_type} == 2'),
  678. //'edit' => array('退款', 'status,tk_time,tk_pic,tk_desc,tk_admin,tk_status', '{status} == 6'),
  679. //'delete' => array('删除', '', '{status} == 1'),
  680. ),
  681. ),
  682. 'request' => array
  683. (
  684. 'getList' => array
  685. (
  686. # 匹配的正则或函数 选填项
  687. 'option' => array
  688. (
  689. 'shop_id' => 'yes',
  690. 'uid' => 'yes',
  691. 'status' => 'yes',
  692. 'state' => 1,
  693. ),
  694. 'type' => 'all',
  695. 'order' => array('cdate' => 'desc'),
  696. 'page' => array(5, 'list'),
  697. 'col' => '*',
  698. ),
  699. 'getAll' => array
  700. (
  701. # 匹配的正则或函数 选填项
  702. 'option' => array
  703. (
  704. 'uid' => 'yes',
  705. 'name' => array('yes', 'like'),
  706. 'shop_id' => 'yes',
  707. 'mobile' => 'yes',
  708. 'method' => 'yes',
  709. 'pay_method' => 'yes',
  710. 'start' => array('yes-cdate', '>='),
  711. 'end' => array('yes-cdate', '<='),
  712. 'status' => array('yes', 'in'),
  713. 'state' => 1,
  714. ),
  715. 'type' => 'all',
  716. 'order' => array('cdate' => 'desc'),
  717. 'page' => array(10, 'list'),
  718. 'col' => '*',
  719. ),
  720. 'getYes' => array
  721. (
  722. # 匹配的正则或函数 选填项
  723. 'option' => array
  724. (
  725. 'shop_id' => 'yes',
  726. 'state' => 1,
  727. ),
  728. 'type' => 'all',
  729. 'order' => array('cdate' => 'desc'),
  730. 'col' => '*',
  731. ),
  732. # 获取提交订单超过12个小时
  733. 'getDataByTime' => array
  734. (
  735. # 匹配的正则或函数 选填项
  736. 'option' => array
  737. (
  738. 'id' => 'yes',
  739. 'cdate' => array('yes', '<='),
  740. 'status' => array('yes', 'in'),
  741. 'withdraw' => 'yes',
  742. 'notice' => 'yes',
  743. 'state' => 1,
  744. ),
  745. 'type' => 'all',
  746. 'order' => array('cdate' => 'desc'),
  747. 'col' => '*',
  748. ),
  749. # 获取1,2
  750. 'getBuy' => array
  751. (
  752. # 匹配的正则或函数 选填项
  753. 'option' => array
  754. (
  755. 'status' => 'yes',
  756. 'shop_id' => 'yes',
  757. 'order_num' => 'yes',
  758. 'uid' => 'yes',
  759. 'state' => 1,
  760. ),
  761. 'type' => 'all',
  762. 'order' => array('id' => 'desc'),
  763. 'col' => '*',
  764. ),
  765. 'getMyAll' => array
  766. (
  767. # 匹配的正则或函数 选填项
  768. 'option' => array
  769. (
  770. 'uid' => 'yes',
  771. 'status' => 'yes',
  772. 'cate_id' => 'yes',
  773. 'state' => 1,
  774. ),
  775. 'type' => 'all',
  776. 'order' => array('id' => 'desc'),
  777. 'page' => array(10, 'list'),
  778. 'col' => 'id,order_num,name,buy_num,cdate,cash,shop_id,buy_id',
  779. ),
  780. # 删除未支付订单
  781. 'drop' => array
  782. (
  783. # 匹配的正则或函数 选填项
  784. 'where' => array
  785. (
  786. 'time' => array('yes-cdate', '<='),
  787. 'status' => 1,
  788. 'state' => 1,
  789. ),
  790. 'type' => 'delete',
  791. 'col' => 'id,order_num',
  792. ),
  793. # 获取数据
  794. 'getAllByDate' => array
  795. (
  796. # 匹配的正则或函数 选填项
  797. 'where' => array
  798. (
  799. 'start' => array('yes-cdate', '>='),
  800. 'end' => array('yes-cdate', '<='),
  801. 'status' => array('yes', 'in'),
  802. 'state' => 1,
  803. ),
  804. 'type' => 'all',
  805. 'col' => 'id,order_num,mobile,shop_id,cdate,price-refund_cash as total,num-refund_num as num',
  806. ),
  807. # 获取订单数量
  808. 'getOrderNum' => array
  809. (
  810. # 匹配的正则或函数 选填项
  811. 'option' => array
  812. (
  813. 'start' => array('yes-cdate', '>='),
  814. 'end' => array('yes-cdate', '<='),
  815. 'shop_id' => 'yes',
  816. 'status' => array('yes', 'in'),
  817. 'state' => 1,
  818. ),
  819. 'type' => 'count',
  820. 'col' => '*',
  821. ),
  822. # 获取总金额
  823. 'getCashNum' => array
  824. (
  825. # 匹配的正则或函数 选填项
  826. 'option' => array
  827. (
  828. 'start' => array('yes-cdate', '>='),
  829. 'end' => array('yes-cdate', '<='),
  830. 'shop_id' => 'yes',
  831. 'status' => array('yes', 'in'),
  832. 'state' => 1,
  833. ),
  834. 'type' => 'one',
  835. 'col' => 'sum(price-refund_cash) as total',
  836. ),
  837. # 获取商品数量
  838. 'getGoodsNum' => array
  839. (
  840. # 匹配的正则或函数 选填项
  841. 'option' => array
  842. (
  843. 'start' => array('yes-cdate', '>='),
  844. 'end' => array('yes-cdate', '<='),
  845. 'shop_id' => 'yes',
  846. 'status' => array('yes', 'in'),
  847. 'state' => 1,
  848. ),
  849. 'type' => 'one',
  850. 'col' => 'sum(num-refund_num) as total',
  851. ),
  852. # 获取订单数量
  853. 'getUser' => array
  854. (
  855. # 匹配的正则或函数 选填项
  856. 'option' => array
  857. (
  858. 'start' => array('yes-cdate', '>='),
  859. 'end' => array('yes-cdate', '<='),
  860. 'shop_id' => 'yes',
  861. 'status' => array('yes', 'in'),
  862. 'state' => 1,
  863. ),
  864. 'type' => 'all',
  865. 'group' => 'mobile',
  866. 'col' => 'count(mobile) as total',
  867. ),
  868. 'getUserNum' => array
  869. (
  870. # 匹配的正则或函数 选填项
  871. 'option' => array
  872. (
  873. 'start' => array('yes-cdate', '>='),
  874. 'end' => array('yes-cdate', '<='),
  875. 'shop_id' => 'yes',
  876. 'status' => array('yes', 'in'),
  877. 'state' => 1,
  878. ),
  879. 'type' => 'count',
  880. 'col' => '*',
  881. ),
  882. 'getSumCdate' => array
  883. (
  884. # 匹配的正则或函数 选填项
  885. 'where' => array
  886. (
  887. 'start' => array('yes-cdate', '>='),
  888. 'end' => array('yes-cdate', '<='),
  889. 'card_code_id' => 'yes',
  890. // 'status' => array('yes', 'in'),
  891. 'state' => 1,
  892. ),
  893. 'type' => 'one',
  894. 'col' => 'sum(card_code_cash) as total',
  895. ),
  896. 'getCardAll' => array
  897. (
  898. # 匹配的正则或函数 选填项
  899. 'where' => array
  900. (
  901. 'start' => array('yes-cdate', '>='),
  902. 'end' => array('yes-cdate', '<='),
  903. 'card_code_id' => 'yes',
  904. // 'status' => array('yes', 'in'),
  905. 'state' => 1,
  906. ),
  907. 'type' => 'one',
  908. 'col' => 'sum(card_code_cash) as total',
  909. ),
  910. 'getCardAlls' => array
  911. (
  912. # 匹配的正则或函数 选填项
  913. 'option' => array
  914. (
  915. 'start' => array('yes-cdate', '>='),
  916. 'end' => array('yes-cdate', '<='),
  917. 'card_code_id' => 'yes',
  918. 'status' => array('yes', 'in'),
  919. 'state' => 1,
  920. ),
  921. 'type' => 'one',
  922. 'col' => 'sum(card_code_cash) as total',
  923. ),
  924. 'getSellDui' => array
  925. (
  926. # 匹配的正则或函数 选填项
  927. 'option' => array
  928. (
  929. 'id' => 'yes',
  930. 'state' => 1,
  931. ),
  932. 'type' => 'one',
  933. 'col' => 'num',
  934. ),
  935. 'getExcel' => array
  936. (
  937. # 匹配的正则或函数 选填项
  938. 'option' => array
  939. (
  940. 'start' => array('yes-cdate','>='),
  941. 'end' => array('yes-cdate','<='),
  942. 'fastart' => array('yes-fadate','>='),
  943. 'faend' => array('yes-fadate','<='),
  944. 'fstart' => array('yes-fdate','>='),
  945. 'fend' => array('yes-fdate','<='),
  946. 'shop_type' => 'yes',
  947. 'name' => 'yes',
  948. 'shop_id' => 'yes',
  949. 'order_num' => 'yes',
  950. 'state' => 1,
  951. ),
  952. 'type' => 'all',
  953. 'page' => array(20, 'list'),
  954. 'col' => '*',
  955. ),
  956. 'getOutOne' => array
  957. (
  958. # 匹配的正则或函数 选填项
  959. 'option' => array
  960. (
  961. 'shop_id' => 'yes',
  962. 'start' => array('yes-cdate', '>='),
  963. 'end' => array('yes-cdate', '<='),
  964. 'card_code_id' => 'yes',
  965. 'status' => array('yes', 'in'),
  966. 'state' => 1,
  967. ),
  968. 'type' => 'one',
  969. // 'page' => array(20, 'list'),
  970. 'col' => '*',
  971. ),
  972. ),
  973. );