sell_order.php 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916
  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. return array
  104. (
  105. # 表名
  106. 'name' => 'sell_order',
  107. # 显示给用户看的名称
  108. 'lang' => '销售订单',
  109. 'order' => 100,
  110. 'status' => $status,
  111. 'status_manage' => $status_manage,
  112. 'pay_method' => $pay_method,
  113. 'pay_type' => $pay_type,
  114. 'method' => $method,
  115. 'end' => array
  116. (
  117. 'insert' => 'shop/lib/manage.sellOrderUpdate',
  118. 'update' => 'shop/lib/manage.sellOrderUpdate',
  119. ),
  120. # 数据结构
  121. 'struct' => array
  122. (
  123. 'id' => array
  124. (
  125. 'type' => 'int-11',
  126. 'name' => 'ID',
  127. 'default' => '',
  128. 'desc' => '',
  129. 'match' => 'is_numeric',
  130. 'search' => 'order',
  131. //'list' => true,
  132. ),
  133. 'shop-info-sid'=> array
  134. (
  135. 'name' => '门店编号',
  136. 'default' => '',
  137. 'desc' => '门店编号',
  138. 'match' => 'option',
  139. # 读取另外表的关联方式
  140. 'sync' => array('shop_id', 'id'),
  141. 'list' => $search_option_shop_type == 1 ? true : false,
  142. 'list_order' => 1,
  143. ),
  144. 'shop_id' => array
  145. (
  146. 'type' => 'int-11',
  147. 'name' => '门店名称',
  148. 'default' => '',
  149. 'desc' => '门店名称',
  150. 'match' => 'is_numeric',
  151. 'search' => 'select',
  152. 'option' => $shop,
  153. 'update' => 'hidden',
  154. 'search' => 'hidden',
  155. 'search' => $search_option_shop_type == 1 ? array
  156. (
  157. 'api' => 'shop/info-like',
  158. 'col' => 'name',
  159. 'result' => 'id',
  160. ) : 'hidden',
  161. 'value' => Dever::input('search_option_shop_id'),
  162. 'list' => $search_option_shop_type == 1 ? 'Dever::load("shop/info-one#name", {shop_id})' : false,
  163. 'list_order' => 2,
  164. ),
  165. 'store_id' => array
  166. (
  167. 'type' => 'int-11',
  168. 'name' => '发货仓库-废弃',
  169. 'default' => '',
  170. 'desc' => '发货仓库',
  171. 'match' => 'is_numeric',
  172. 'option' => $store,
  173. 'update' => 'select',
  174. 'searchs' => $search_option_shop_type == 2 ? array
  175. (
  176. 'api' => 'store/info-like',
  177. 'col' => 'name',
  178. 'result' => 'id',
  179. ) : 'hidden',
  180. //'list' => $search_option_shop_type == 2 ? '"{store_id}" > 0 ? Dever::load("store/info-one#name", {store_id}) : ""' : false,
  181. 'list_order' => 6,
  182. ),
  183. 'shop-info-type'=> array
  184. (
  185. 'name' => '门店类型',
  186. 'default' => '',
  187. 'desc' => '门店类型',
  188. 'match' => 'option',
  189. # 读取另外表的关联方式
  190. 'sync' => array('shop_id', 'id'),
  191. 'list' => $search_option_shop_type == 1 ? 'Dever::load("shop/lib/manage.shopInfoType", {shop-info-type})' : false,
  192. 'list_order' => 3,
  193. ),
  194. 'area' => array
  195. (
  196. 'type' => 'varchar-500',
  197. 'name' => '所在街道',
  198. 'default' => '',
  199. 'desc' => '所在街道',
  200. 'match' => 'option',
  201. 'search' => $search_option_shop_type == 1 ? 'linkage' : false,
  202. 'update' => 'linkage',
  203. 'option' => Dever::url('lib/area.get', 'shop'),
  204. //'list' => 'Dever::load("area/api.string", "{area}")',
  205. ),
  206. 'uid' => array
  207. (
  208. 'type' => 'int-11',
  209. 'name' => $search_option_shop_type == 1 ? '购买人' : '收件人',
  210. 'default' => '0',
  211. 'desc' => '请选择用户',
  212. 'match' => 'is_numeric',
  213. 'update' => 'text',
  214. //'search' => 'select',
  215. 'search' => $search_option_shop_type == 1 ? array
  216. (
  217. 'api' => 'passport/user-one',
  218. 'col' => 'username',
  219. 'result' => 'id',
  220. ) : array
  221. (
  222. 'api' => 'passport/address-one',
  223. 'col' => 'contact',
  224. 'result' => 'uid',
  225. ),
  226. 'list' => $search_option_shop_type == 1 ? 'Dever::load("shop/lib/manage.user", {id})' : 'Dever::load("passport/address-one#contact", {address_id})',
  227. 'list_order' => 5,
  228. ),
  229. 'mobile' => array
  230. (
  231. 'type' => 'varchar-300',
  232. 'name' => $search_option_shop_type == 1 ? '下单手机号' : '收件人手机',
  233. 'default' => '',
  234. 'desc' => '手机号',
  235. 'match' => 'option',
  236. 'search' => 'fulltext',
  237. 'search' => $search_option_shop_type == 1 ? 'fulltext' : array
  238. (
  239. 'api' => 'passport/address-one',//接口地址,最好是获取多条数据的地址
  240. 'col' => 'mobile',//要查询的字段
  241. 'result' => 'uid',//返回的字段
  242. 'search' => 'uid',//本表的字段,默认为当前的字段
  243. ),
  244. 'list' => $search_option_shop_type == 1 ? false : 'Dever::load("passport/address-one#mobile", {address_id})',
  245. 'list_order' => 6,
  246. ),
  247. 'address_id' => array
  248. (
  249. 'type' => 'int-11',
  250. 'name' => '送货地址',
  251. 'default' => '',
  252. 'desc' => '送货地址',
  253. 'match' => 'is_numeric',
  254. //'list' => 'Dever::load("passport/address-find#address", {address_id})';
  255. ),
  256. 'invoice_id' => array
  257. (
  258. 'type' => 'int-11',
  259. 'name' => '发票信息',
  260. 'default' => '',
  261. 'desc' => '发票信息',
  262. 'match' => 'is_numeric',
  263. //'list' => 'Dever::load("passport/address-find#address", {address_id})';
  264. ),
  265. 'name' => array
  266. (
  267. 'type' => 'varchar-800',
  268. 'name' => '订单名称',
  269. 'default' => '',
  270. 'desc' => '订单名称',
  271. 'match' => 'is_string',
  272. 'update' => 'text',
  273. ),
  274. 'order_num' => array
  275. (
  276. 'type' => 'varchar-100',
  277. 'name' => '订单号',
  278. 'default' => '',
  279. 'desc' => '订单号',
  280. 'match' => 'is_string',
  281. 'update' => 'text',
  282. 'search' => 'fulltext',
  283. 'list' => true,
  284. 'list_order' => 4,
  285. ),
  286. 'oprice' => array
  287. (
  288. 'type' => 'varchar-50',
  289. 'name' => '原价',
  290. 'default' => '0',
  291. 'desc' => '原价',
  292. 'match' => 'option',
  293. 'update' => 'text',
  294. 'list_name' => '合计金额',
  295. 'list' => $search_option_shop_type == 1 ? 'Dever::load("shop/lib/manage.getTotalCash", {id})' : false,
  296. 'list_order' => 10,
  297. ),
  298. 'price' => array
  299. (
  300. 'type' => 'varchar-50',
  301. 'name' => $search_option_shop_type == 1 ? '实付金额' : '订单总金额',
  302. 'default' => '0',
  303. 'desc' => '实付金额',
  304. 'match' => 'option',
  305. 'update' => 'text',
  306. 'list' => 'Dever::load("cash/lib/set.getCash", "{price}")',
  307. 'list_order' => 11,
  308. ),
  309. 'num' => array
  310. (
  311. 'type' => 'int-11',
  312. 'name' => '购买总数量',
  313. 'default' => '',
  314. 'desc' => '购买总数量',
  315. 'match' => 'is_numeric',
  316. 'search' => 'select',
  317. 'list' => $search_option_shop_type == 2 ? true : false,
  318. 'list_order' => 10,
  319. ),
  320. 'refund_num' => array
  321. (
  322. 'type' => 'int-11',
  323. 'name' => '退款数量',
  324. 'default' => '0',
  325. 'desc' => '退款数量',
  326. 'match' => 'is_numeric',
  327. ),
  328. 'refund_cash' => array
  329. (
  330. 'type' => 'varchar-50',
  331. 'name' => $search_option_shop_type == 1 ? '已退订单金额' : '退款金额',
  332. 'default' => '0',
  333. 'desc' => '已退订单金额',
  334. 'match' => 'option',
  335. 'update' => 'text',
  336. 'list' => true,
  337. 'list_order' => $search_option_shop_type == 1 ? 12 : 19,
  338. ),
  339. 'refund_status' => array
  340. (
  341. 'type' => 'tinyint-1',
  342. 'name' => '退款状态',
  343. 'default' => '1',
  344. 'desc' => '申请退款状态',
  345. 'match' => 'is_numeric',
  346. 'option' => $refund_status,
  347. 'search' => $refund_search,
  348. 'list' => $search_option_shop_type == 2 ? 'Dever::load("shop/lib/manage.buyInfoRefundStatus", "{id}", "sell_order")' : false,
  349. 'list_name' => '退款状态',
  350. 'list_order' => 18,
  351. ),
  352. 'kou_cash' => array
  353. (
  354. 'type' => 'varchar-50',
  355. 'name' => '抹零金额',
  356. 'default' => '0',
  357. 'desc' => '抹零金额',
  358. 'match' => 'option',
  359. 'update' => 'text',
  360. ),
  361. 'ps_cash' => array
  362. (
  363. 'type' => 'varchar-50',
  364. 'name' => '配送费',
  365. 'default' => '0',
  366. 'desc' => '配送费',
  367. 'match' => 'option',
  368. 'update' => 'text',
  369. ),
  370. 'card_code_id' => array
  371. (
  372. 'type' => 'int-11',
  373. 'name' => '礼品卡id',
  374. 'default' => '',
  375. 'desc' => '礼品卡id',
  376. 'match' => 'option',
  377. ),
  378. 'card_code_card' => array
  379. (
  380. 'type' => 'varchar-800',
  381. 'name' => '礼品卡卡号',
  382. 'default' => '',
  383. 'desc' => '礼品卡卡号',
  384. 'match' => 'option',
  385. 'update' => 'text',
  386. ),
  387. 'card_code_cash' => array
  388. (
  389. 'type' => 'varchar-50',
  390. 'name' => '礼品卡抵扣金额',
  391. 'default' => '0',
  392. 'desc' => '礼品卡抵扣金额',
  393. 'match' => 'option',
  394. 'update' => 'text',
  395. ),
  396. 'wallet_cash' => array
  397. (
  398. 'type' => 'varchar-50',
  399. 'name' => '钱包抵扣金额',
  400. 'default' => '0',
  401. 'desc' => '钱包抵扣金额',
  402. 'match' => 'option',
  403. 'update' => 'text',
  404. ),
  405. 'coupon_id' => array
  406. (
  407. 'type' => 'int-11',
  408. 'name' => '门店的优惠券id',
  409. 'default' => '',
  410. 'desc' => '门店的优惠券id',
  411. 'match' => 'option',
  412. ),
  413. 'user_coupon_id' => array
  414. (
  415. 'type' => 'int-11',
  416. 'name' => '用户的优惠券id',
  417. 'default' => '',
  418. 'desc' => '用户的优惠券id',
  419. 'match' => 'option',
  420. ),
  421. 'coupon_cash' => array
  422. (
  423. 'type' => 'varchar-300',
  424. 'name' => '优惠金额',
  425. 'default' => '0',
  426. 'desc' => '优惠金额',
  427. 'match' => 'option',
  428. 'update' => 'text',
  429. ),
  430. 'method' => array
  431. (
  432. 'type' => 'int-11',
  433. 'name' => '配送类型',
  434. 'default' => '1',
  435. 'desc' => '配送类型',
  436. 'match' => 'is_numeric',
  437. 'update' => 'radio',
  438. 'search' => $search_option_shop_type == 1 ? 'select' : false,
  439. 'option' => $method,
  440. 'list' => $search_option_shop_type == 1 ? true : false,
  441. 'list_order' => 5,
  442. ),
  443. 'code' => array
  444. (
  445. 'type' => 'varchar-100',
  446. 'name' => '自提码或者核销码',
  447. 'default' => '',
  448. 'desc' => '自提码或者核销码',
  449. 'match' => 'is_numeric',
  450. ),
  451. 'pay_method' => array
  452. (
  453. 'type' => 'int-11',
  454. 'name' => '订单类型',
  455. 'default' => '1',
  456. 'desc' => '订单类型',
  457. 'match' => 'is_numeric',
  458. 'update' => 'radio',
  459. 'search' => $search_option_shop_type == 1 ? 'select' : false,
  460. 'option' => $pay_method,
  461. 'list' => $search_option_shop_type == 1 ? true : false,
  462. 'list_order' => 6,
  463. ),
  464. 'pay_type' => array
  465. (
  466. 'type' => 'int-11',
  467. 'name' => '支付渠道',
  468. 'default' => '1',
  469. 'desc' => '支付渠道',
  470. 'match' => 'is_numeric',
  471. 'update' => 'radio',
  472. 'option' => $pay_type,
  473. 'list' => $search_option_shop_type == 1 ? true : false,
  474. 'list_order' => 13,
  475. ),
  476. 'info' => array
  477. (
  478. 'type' => 'varchar-300',
  479. 'name' => '订单备注',
  480. 'default' => '',
  481. 'desc' => '订单备注',
  482. 'match' => 'option',
  483. 'update' => 'textarea',
  484. ),
  485. 'withdraw' => array
  486. (
  487. 'type' => 'tinyint-1',
  488. 'name' => '是否提现',
  489. 'default' => '1',
  490. 'desc' => '是否提现',
  491. 'match' => 'is_numeric',
  492. 'option' => $withdraw,
  493. //'search' => 'select',
  494. ),
  495. 'shop_type' => array
  496. (
  497. 'type' => 'tinyint-1',
  498. 'name' => '门店类型',
  499. 'default' => '1',
  500. 'desc' => '门店类型',
  501. 'match' => 'is_numeric',
  502. 'option' => $shop_type,
  503. 'search' => 'hidden',
  504. //'search' => 'select',
  505. ),
  506. 'status' => array
  507. (
  508. 'type' => 'tinyint-1',
  509. 'name' => '订单状态',
  510. 'default' => '1',
  511. 'desc' => '订单状态',
  512. 'match' => 'is_numeric',
  513. 'option' => $status_manage,
  514. 'search' => 'select',
  515. 'list' => true,
  516. 'list_order' => 14,
  517. ),
  518. 'audit' => array
  519. (
  520. 'type' => 'tinyint-1',
  521. 'name' => '审核状态',
  522. 'default' => '2',
  523. 'desc' => '审核状态',
  524. 'match' => 'is_numeric',
  525. 'option' => $audit,
  526. //'search' => 'select',
  527. 'update' => 'radio',
  528. ),
  529. 'audit_desc' => array
  530. (
  531. 'type' => 'varchar-500',
  532. 'name' => '未通过原因',
  533. 'default' => '',
  534. 'desc' => '未通过原因',
  535. 'match' => 'option',
  536. 'update' => 'textarea',
  537. ),
  538. 'notice' => array
  539. (
  540. 'type' => 'tinyint-1',
  541. 'name' => '是否发送通知',
  542. 'default' => '1',
  543. 'desc' => '是否发送通知',
  544. 'match' => 'is_numeric',
  545. ),
  546. 'fdate' => array
  547. (
  548. 'type' => 'int-11',
  549. 'name' => '完成时间',
  550. 'default' => '',
  551. 'match' => 'is_numeric',
  552. 'desc' => '',
  553. ),
  554. 'paydate' => array
  555. (
  556. 'type' => 'int-11',
  557. 'name' => '付款时间',
  558. 'default' => '',
  559. 'match' => 'is_numeric',
  560. 'desc' => '',
  561. 'list' => '"{paydate}" > 0 ? date("Y-m-d H:i", {paydate}) : "-"',
  562. 'list_order' => 8,
  563. ),
  564. 'operdate' => array
  565. (
  566. 'type' => 'int-11',
  567. 'name' => '操作时间',
  568. 'default' => '',
  569. 'match' => 'is_numeric',
  570. 'desc' => '',
  571. //'list' => '"{operdate}" > 0 ? date("Y-m-d H:i:s", {operdate}) : "-"',
  572. //'list_name' => '发货时间',
  573. //'list_order' => 8,
  574. ),
  575. 'shop-sell_order_ps-cdate'=> array
  576. (
  577. 'name' => '发货时间',
  578. 'default' => '',
  579. 'desc' => '发货时间',
  580. 'match' => 'option',
  581. # 读取另外表的关联方式
  582. 'sync' => array('id', 'order_id'),
  583. 'list' => '"{shop-sell_order_ps-cdate}" ? date("Y-m-d H:i", {shop-sell_order_ps-cdate}) : "-"',
  584. 'list_order' => 8,
  585. ),
  586. 'state' => array
  587. (
  588. 'type' => 'tinyint-1',
  589. 'name' => '状态',
  590. 'default' => '1',
  591. 'desc' => '请选择状态',
  592. 'match' => 'is_numeric',
  593. ),
  594. 'cdate' => array
  595. (
  596. 'type' => 'int-11',
  597. 'name' => '下单时间',
  598. 'match' => array('is_numeric', time()),
  599. 'desc' => '',
  600. # 只有insert时才生效
  601. 'insert' => true,
  602. 'search' => 'sdate',
  603. 'list' => 'date("Y-m-d H:i", {cdate})',
  604. //'list' => 'Dever::load("service/lib/manage.showOrderTime", "{id}")',
  605. 'list_order' => 7,
  606. ),
  607. ),
  608. 'manage' => array
  609. (
  610. 'delete' => false,
  611. 'edit' => false,
  612. 'insert' => false,
  613. 'excel' => $excel,
  614. 'button' => array
  615. (
  616. //'导出订单明细' => array('excel', 'shop/excel.sell_order'),
  617. ),
  618. 'list_button' => array
  619. (
  620. //fast_list
  621. 'list' => array('查看详情', '"sell_order_goods&project=shop&order_id={id}&page_type=&search_option_shop_type='.$search_option_shop_type.'"'),
  622. 'list1' => 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'),
  623. //'location2' => array('分配仓库', Dever::url('lib/set.store', 'shop')),
  624. //'edit' => array('分配仓库', 'store_id', '{status} == 2 && {shop_type} == 2'),
  625. //'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'),
  626. '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'),
  627. 'oper' => array('确认收货', '"shop/lib/manage.setSellOrderStatus?shop_id={shop_id}&order_id={id}"', '{status} == 4 && {shop_type} == 2'),
  628. //'edit' => array('退款', 'status,tk_time,tk_pic,tk_desc,tk_admin,tk_status', '{status} == 6'),
  629. //'delete' => array('删除', '', '{status} == 1'),
  630. ),
  631. ),
  632. 'request' => array
  633. (
  634. 'getList' => array
  635. (
  636. # 匹配的正则或函数 选填项
  637. 'option' => array
  638. (
  639. 'shop_id' => 'yes',
  640. 'uid' => 'yes',
  641. 'status' => 'yes',
  642. 'state' => 1,
  643. ),
  644. 'type' => 'all',
  645. 'order' => array('cdate' => 'desc'),
  646. 'page' => array(5, 'list'),
  647. 'col' => '*',
  648. ),
  649. 'getAll' => array
  650. (
  651. # 匹配的正则或函数 选填项
  652. 'option' => array
  653. (
  654. 'uid' => 'yes',
  655. 'name' => array('yes', 'like'),
  656. 'shop_id' => 'yes',
  657. 'mobile' => 'yes',
  658. 'method' => 'yes',
  659. 'pay_method' => 'yes',
  660. 'start' => array('yes-cdate', '>='),
  661. 'end' => array('yes-cdate', '<='),
  662. 'status' => array('yes', 'in'),
  663. 'state' => 1,
  664. ),
  665. 'type' => 'all',
  666. 'order' => array('cdate' => 'desc'),
  667. 'page' => array(10, 'list'),
  668. 'col' => '*',
  669. ),
  670. 'getYes' => array
  671. (
  672. # 匹配的正则或函数 选填项
  673. 'option' => array
  674. (
  675. 'shop_id' => 'yes',
  676. 'state' => 1,
  677. ),
  678. 'type' => 'all',
  679. 'order' => array('cdate' => 'desc'),
  680. 'col' => '*',
  681. ),
  682. # 获取提交订单超过12个小时
  683. 'getDataByTime' => array
  684. (
  685. # 匹配的正则或函数 选填项
  686. 'option' => array
  687. (
  688. 'cdate' => array('yes', '<='),
  689. 'status' => array('yes', 'in'),
  690. 'withdraw' => 'yes',
  691. 'notice' => 'yes',
  692. 'state' => 1,
  693. ),
  694. 'type' => 'all',
  695. 'order' => array('cdate' => 'desc'),
  696. 'col' => '*',
  697. ),
  698. # 获取1,2
  699. 'getBuy' => array
  700. (
  701. # 匹配的正则或函数 选填项
  702. 'option' => array
  703. (
  704. 'status' => 'yes',
  705. 'shop_id' => 'yes',
  706. 'order_num' => 'yes',
  707. 'uid' => 'yes',
  708. 'state' => 1,
  709. ),
  710. 'type' => 'all',
  711. 'order' => array('id' => 'desc'),
  712. 'col' => '*',
  713. ),
  714. 'getMyAll' => array
  715. (
  716. # 匹配的正则或函数 选填项
  717. 'option' => array
  718. (
  719. 'uid' => 'yes',
  720. 'status' => 'yes',
  721. 'cate_id' => 'yes',
  722. 'state' => 1,
  723. ),
  724. 'type' => 'all',
  725. 'order' => array('id' => 'desc'),
  726. 'page' => array(10, 'list'),
  727. 'col' => 'id,order_num,name,buy_num,cdate,cash,shop_id,buy_id',
  728. ),
  729. # 删除未支付订单
  730. 'drop' => array
  731. (
  732. # 匹配的正则或函数 选填项
  733. 'where' => array
  734. (
  735. 'time' => array('yes-cdate', '<='),
  736. 'status' => 1,
  737. 'state' => 1,
  738. ),
  739. 'type' => 'delete',
  740. 'col' => 'id,order_num',
  741. ),
  742. # 获取数据
  743. 'getAllByDate' => array
  744. (
  745. # 匹配的正则或函数 选填项
  746. 'where' => array
  747. (
  748. 'start' => array('yes-cdate', '>='),
  749. 'end' => array('yes-cdate', '<='),
  750. 'status' => array('yes', 'in'),
  751. 'state' => 1,
  752. ),
  753. 'type' => 'all',
  754. 'col' => 'id,order_num,mobile,shop_id,cdate,price-refund_cash as total,num-refund_num as num',
  755. ),
  756. # 获取订单数量
  757. 'getOrderNum' => array
  758. (
  759. # 匹配的正则或函数 选填项
  760. 'option' => array
  761. (
  762. 'start' => array('yes-cdate', '>='),
  763. 'end' => array('yes-cdate', '<='),
  764. 'shop_id' => 'yes',
  765. 'status' => array('yes', 'in'),
  766. 'state' => 1,
  767. ),
  768. 'type' => 'count',
  769. 'col' => '*',
  770. ),
  771. # 获取总金额
  772. 'getCashNum' => array
  773. (
  774. # 匹配的正则或函数 选填项
  775. 'option' => array
  776. (
  777. 'start' => array('yes-cdate', '>='),
  778. 'end' => array('yes-cdate', '<='),
  779. 'shop_id' => 'yes',
  780. 'status' => array('yes', 'in'),
  781. 'state' => 1,
  782. ),
  783. 'type' => 'one',
  784. 'col' => 'sum(price-refund_cash) as total',
  785. ),
  786. # 获取商品数量
  787. 'getGoodsNum' => array
  788. (
  789. # 匹配的正则或函数 选填项
  790. 'option' => array
  791. (
  792. 'start' => array('yes-cdate', '>='),
  793. 'end' => array('yes-cdate', '<='),
  794. 'shop_id' => 'yes',
  795. 'status' => array('yes', 'in'),
  796. 'state' => 1,
  797. ),
  798. 'type' => 'one',
  799. 'col' => 'sum(num-refund_num) as total',
  800. ),
  801. # 获取订单数量
  802. 'getUser' => array
  803. (
  804. # 匹配的正则或函数 选填项
  805. 'option' => array
  806. (
  807. 'start' => array('yes-cdate', '>='),
  808. 'end' => array('yes-cdate', '<='),
  809. 'shop_id' => 'yes',
  810. 'status' => array('yes', 'in'),
  811. 'state' => 1,
  812. ),
  813. 'type' => 'all',
  814. 'group' => 'mobile',
  815. 'col' => 'count(mobile) as total',
  816. ),
  817. 'getUserNum' => array
  818. (
  819. # 匹配的正则或函数 选填项
  820. 'option' => array
  821. (
  822. 'start' => array('yes-cdate', '>='),
  823. 'end' => array('yes-cdate', '<='),
  824. 'shop_id' => 'yes',
  825. 'status' => array('yes', 'in'),
  826. 'state' => 1,
  827. ),
  828. 'type' => 'count',
  829. 'col' => '*',
  830. ),
  831. ),
  832. );