sell_order.php 26 KB

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