sell_order.php 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862
  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' => 'select',
  483. ),
  484. 'status' => array
  485. (
  486. 'type' => 'tinyint-1',
  487. 'name' => '订单状态',
  488. 'default' => '1',
  489. 'desc' => '订单状态',
  490. 'match' => 'is_numeric',
  491. 'option' => $status_manage,
  492. 'search' => 'select',
  493. 'list' => true,
  494. 'list_order' => 14,
  495. ),
  496. 'notice' => array
  497. (
  498. 'type' => 'tinyint-1',
  499. 'name' => '是否发送通知',
  500. 'default' => '1',
  501. 'desc' => '是否发送通知',
  502. 'match' => 'is_numeric',
  503. ),
  504. 'fdate' => array
  505. (
  506. 'type' => 'int-11',
  507. 'name' => '完成时间',
  508. 'default' => '',
  509. 'match' => 'is_numeric',
  510. 'desc' => '',
  511. ),
  512. 'paydate' => array
  513. (
  514. 'type' => 'int-11',
  515. 'name' => '付款时间',
  516. 'default' => '',
  517. 'match' => 'is_numeric',
  518. 'desc' => '',
  519. 'list' => '"{paydate}" > 0 ? date("Y-m-d H:i", {paydate}) : "-"',
  520. 'list_order' => 8,
  521. ),
  522. 'operdate' => array
  523. (
  524. 'type' => 'int-11',
  525. 'name' => '操作时间',
  526. 'default' => '',
  527. 'match' => 'is_numeric',
  528. 'desc' => '',
  529. //'list' => '"{operdate}" > 0 ? date("Y-m-d H:i:s", {operdate}) : "-"',
  530. //'list_name' => '发货时间',
  531. //'list_order' => 8,
  532. ),
  533. 'shop-sell_order_ps-cdate'=> array
  534. (
  535. 'name' => '发货时间',
  536. 'default' => '',
  537. 'desc' => '发货时间',
  538. 'match' => 'option',
  539. # 读取另外表的关联方式
  540. 'sync' => array('id', 'order_id'),
  541. 'list' => '"{shop-sell_order_ps-cdate}" ? date("Y-m-d H:i", {shop-sell_order_ps-cdate}) : "-"',
  542. 'list_order' => 8,
  543. ),
  544. 'state' => array
  545. (
  546. 'type' => 'tinyint-1',
  547. 'name' => '状态',
  548. 'default' => '1',
  549. 'desc' => '请选择状态',
  550. 'match' => 'is_numeric',
  551. ),
  552. 'cdate' => array
  553. (
  554. 'type' => 'int-11',
  555. 'name' => '下单时间',
  556. 'match' => array('is_numeric', time()),
  557. 'desc' => '',
  558. # 只有insert时才生效
  559. 'insert' => true,
  560. 'search' => 'sdate',
  561. 'list' => 'date("Y-m-d H:i", {cdate})',
  562. //'list' => 'Dever::load("service/lib/manage.showOrderTime", "{id}")',
  563. 'list_order' => 7,
  564. ),
  565. ),
  566. 'manage' => array
  567. (
  568. 'delete' => false,
  569. 'edit' => false,
  570. 'insert' => false,
  571. 'excel' => $excel,
  572. 'button' => array
  573. (
  574. //'导出订单明细' => array('excel', 'shop/excel.sell_order'),
  575. ),
  576. 'list_button' => array
  577. (
  578. //fast_list
  579. 'list' => array('查看详情', '"sell_order_goods&project=shop&order_id={id}&page_type=1"'),
  580. //'location2' => array('分配仓库', Dever::url('lib/set.store', 'shop')),
  581. 'edit' => array('分配仓库', 'store_id'),
  582. '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} < 3 && {shop_type} == 2'),
  583. //'edit' => array('退款', 'status,tk_time,tk_pic,tk_desc,tk_admin,tk_status', '{status} == 6'),
  584. //'delete' => array('删除', '', '{status} == 1'),
  585. ),
  586. ),
  587. 'request' => array
  588. (
  589. 'getList' => array
  590. (
  591. # 匹配的正则或函数 选填项
  592. 'option' => array
  593. (
  594. 'shop_id' => 'yes',
  595. 'uid' => 'yes',
  596. 'status' => 'yes',
  597. 'state' => 1,
  598. ),
  599. 'type' => 'all',
  600. 'order' => array('cdate' => 'desc'),
  601. 'page' => array(5, 'list'),
  602. 'col' => '*',
  603. ),
  604. 'getAll' => array
  605. (
  606. # 匹配的正则或函数 选填项
  607. 'option' => array
  608. (
  609. 'uid' => 'yes',
  610. 'name' => array('yes', 'like'),
  611. 'shop_id' => 'yes',
  612. 'mobile' => 'yes',
  613. 'method' => 'yes',
  614. 'pay_method' => 'yes',
  615. 'start' => array('yes-cdate', '>='),
  616. 'end' => array('yes-cdate', '<='),
  617. 'status' => array('yes', 'in'),
  618. 'state' => 1,
  619. ),
  620. 'type' => 'all',
  621. 'order' => array('cdate' => 'desc'),
  622. 'page' => array(10, 'list'),
  623. 'col' => '*',
  624. ),
  625. 'getYes' => array
  626. (
  627. # 匹配的正则或函数 选填项
  628. 'option' => array
  629. (
  630. 'shop_id' => 'yes',
  631. 'state' => 1,
  632. ),
  633. 'type' => 'all',
  634. 'order' => array('cdate' => 'desc'),
  635. 'col' => '*',
  636. ),
  637. # 获取提交订单超过12个小时
  638. 'getDataByTime' => array
  639. (
  640. # 匹配的正则或函数 选填项
  641. 'option' => array
  642. (
  643. 'cdate' => array('yes', '<='),
  644. 'status' => array('yes', 'in'),
  645. 'withdraw' => 'yes',
  646. 'notice' => 'yes',
  647. 'state' => 1,
  648. ),
  649. 'type' => 'all',
  650. 'order' => array('cdate' => 'desc'),
  651. 'col' => '*',
  652. ),
  653. # 获取1,2
  654. 'getBuy' => array
  655. (
  656. # 匹配的正则或函数 选填项
  657. 'option' => array
  658. (
  659. 'status' => 'yes',
  660. 'shop_id' => 'yes',
  661. 'order_num' => 'yes',
  662. 'uid' => 'yes',
  663. 'state' => 1,
  664. ),
  665. 'type' => 'all',
  666. 'order' => array('id' => 'desc'),
  667. 'col' => '*',
  668. ),
  669. 'getMyAll' => array
  670. (
  671. # 匹配的正则或函数 选填项
  672. 'option' => array
  673. (
  674. 'uid' => 'yes',
  675. 'status' => 'yes',
  676. 'cate_id' => 'yes',
  677. 'state' => 1,
  678. ),
  679. 'type' => 'all',
  680. 'order' => array('id' => 'desc'),
  681. 'page' => array(10, 'list'),
  682. 'col' => 'id,order_num,name,buy_num,cdate,cash,shop_id,buy_id',
  683. ),
  684. # 删除未支付订单
  685. 'drop' => array
  686. (
  687. # 匹配的正则或函数 选填项
  688. 'where' => array
  689. (
  690. 'time' => array('yes-cdate', '<='),
  691. 'status' => 1,
  692. 'state' => 1,
  693. ),
  694. 'type' => 'delete',
  695. 'col' => 'id,order_num',
  696. ),
  697. # 获取数据
  698. 'getAllByDate' => array
  699. (
  700. # 匹配的正则或函数 选填项
  701. 'where' => array
  702. (
  703. 'start' => array('yes-cdate', '>='),
  704. 'end' => array('yes-cdate', '<='),
  705. ),
  706. 'type' => 'all',
  707. 'col' => 'id,order_num',
  708. ),
  709. # 获取订单数量
  710. 'getOrderNum' => array
  711. (
  712. # 匹配的正则或函数 选填项
  713. 'option' => array
  714. (
  715. 'start' => array('yes-cdate', '>='),
  716. 'end' => array('yes-cdate', '<='),
  717. 'shop_id' => 'yes',
  718. 'status' => array('yes', 'in'),
  719. 'state' => 1,
  720. ),
  721. 'type' => 'count',
  722. 'col' => '*',
  723. ),
  724. # 获取总金额
  725. 'getCashNum' => array
  726. (
  727. # 匹配的正则或函数 选填项
  728. 'option' => array
  729. (
  730. 'start' => array('yes-cdate', '>='),
  731. 'end' => array('yes-cdate', '<='),
  732. 'shop_id' => 'yes',
  733. 'status' => array('yes', 'in'),
  734. 'state' => 1,
  735. ),
  736. 'type' => 'one',
  737. 'col' => 'sum(price-refund_cash) as total',
  738. ),
  739. # 获取商品数量
  740. 'getGoodsNum' => array
  741. (
  742. # 匹配的正则或函数 选填项
  743. 'option' => array
  744. (
  745. 'start' => array('yes-cdate', '>='),
  746. 'end' => array('yes-cdate', '<='),
  747. 'shop_id' => 'yes',
  748. 'status' => array('yes', 'in'),
  749. 'state' => 1,
  750. ),
  751. 'type' => 'one',
  752. 'col' => 'sum(num) as total',
  753. ),
  754. # 获取订单数量
  755. 'getUser' => array
  756. (
  757. # 匹配的正则或函数 选填项
  758. 'option' => array
  759. (
  760. 'start' => array('yes-cdate', '>='),
  761. 'end' => array('yes-cdate', '<='),
  762. 'shop_id' => 'yes',
  763. 'status' => array('yes', 'in'),
  764. 'state' => 1,
  765. ),
  766. 'type' => 'all',
  767. 'group' => 'uid',
  768. 'col' => 'count(uid) as total',
  769. ),
  770. 'getUserNum' => array
  771. (
  772. # 匹配的正则或函数 选填项
  773. 'option' => array
  774. (
  775. 'start' => array('yes-cdate', '>='),
  776. 'end' => array('yes-cdate', '<='),
  777. 'shop_id' => 'yes',
  778. 'status' => array('yes', 'in'),
  779. 'state' => 1,
  780. ),
  781. 'type' => 'count',
  782. 'col' => '*',
  783. ),
  784. ),
  785. );