sell_order.php 27 KB

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