buy_order.php 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794
  1. <?php
  2. $status = array
  3. (
  4. 1 => '待支付',
  5. 2 => '待审核',
  6. 3 => '待发货',
  7. 4 => '待收货确认',
  8. 5 => '已完成',
  9. 6 => '已完成(有退款)',
  10. 7 => '已取消',
  11. 8 => '已退款',
  12. 11 => '已过期',
  13. );
  14. $out_status = array
  15. (
  16. 1 => '未导出',
  17. 2 => '已导出',
  18. );
  19. $audit = array
  20. (
  21. //1 => '待审核',
  22. 2 => '审核通过',
  23. 3 => '审核未通过',
  24. );
  25. $refund_status = array
  26. (
  27. 1 => '未申请',
  28. 2 => '已申请',
  29. );
  30. $parent_type = array
  31. (
  32. 1 => '直接下单',
  33. 2 => '平台店订单',
  34. 3 => '代理商订单',
  35. );
  36. $type = Dever::config('base')->source;
  37. unset($type[3]);
  38. $shop = function()
  39. {
  40. $array = array();
  41. $info = Dever::db('shop/info')->select();
  42. if($info)
  43. {
  44. $array += $info;
  45. }
  46. return $array;
  47. };
  48. $store = function()
  49. {
  50. $array = array();
  51. $info = Dever::db('store/info')->select();
  52. if($info)
  53. {
  54. $array += $info;
  55. }
  56. return $array;
  57. };
  58. $factory = function()
  59. {
  60. $array = array();
  61. $info = Dever::db('factory/info')->select();
  62. if($info)
  63. {
  64. $array += $info;
  65. }
  66. return $array;
  67. };
  68. $stype = 1;
  69. $noprice = 2;
  70. $search_option_type = Dever::input('search_option_type', 1);
  71. if ($search_option_type == 1) {
  72. $search_name = '门店名称';
  73. $search_option = $shop;
  74. $search_url = 'shop/lib/manage.search';
  75. $search_table = 'shop';
  76. $search = $search_table . '/info-like';
  77. $excel = array
  78. (
  79. array('导出订单', '门店采购订单', ''),
  80. array('导出订单明细', '门店采购订单明细', 'shop/excel.buy_order'),
  81. );
  82. $source_name = '供货商';
  83. $source_order = 4;
  84. } elseif ($search_option_type == 2) {
  85. $search_name = '仓库名称';
  86. $search_option = $store;
  87. $search_url = 'store/lib/manage.search';
  88. $search_table = 'store';
  89. $search = $search_table . '/info-like';
  90. $excel = array
  91. (
  92. array('导出订单', '仓库入库订单', ''),
  93. array('导出订单明细', '仓库入库订单明细', 'shop/excel.store_buy_order'),
  94. );
  95. $source_name = '供货商';
  96. $source_order = 4;
  97. $noprice = 1;
  98. }
  99. $search_option_source_type = Dever::input('search_option_source_type');
  100. if ($search_option_source_type == 2) {
  101. $noprice = 1;
  102. if ($search_option_type == 2) {
  103. $source_name = '发货仓库';
  104. $search_name = '收货仓库';
  105. $source_order = -1;
  106. $excel = array
  107. (
  108. array('导出订单', '仓库调拨订单', ''),
  109. array('导出订单明细', '仓库调拨订单明细', 'shop/excel.store_buy_order_diao'),
  110. );
  111. } else {
  112. $source_name = '仓库名称';
  113. $source_order = -1;
  114. $excel = array
  115. (
  116. array('导出订单', '仓库发货订单', ''),
  117. array('导出订单明细', '仓库发货订单明细', 'shop/excel.store_buy_order_fa'),
  118. );
  119. }
  120. } elseif ($search_option_source_type == 3) {
  121. $search_option_type = 3;
  122. $search_name = '收件人名称';
  123. $search_table = 'store';
  124. $search = $search_table . '/info-like';
  125. $source_name = '工厂名称';
  126. $source_order = -1;
  127. $search_option = $factory;
  128. $excel = array
  129. (
  130. array('导出订单', '工厂发货订单', ''),
  131. array('导出订单明细', '工厂发货订单明细', 'shop/excel.factory_buy_order_fa'),
  132. );
  133. }
  134. return array
  135. (
  136. # 表名
  137. 'name' => 'buy_order',
  138. # 显示给用户看的名称
  139. 'lang' => '采购订单',
  140. 'order' => 99,
  141. 'status' => $status,
  142. 'refund_status' => $refund_status,
  143. 'config_type' => $type,
  144. 'out_status' => $out_status,
  145. 'end' => array
  146. (
  147. 'insert' => 'shop/lib/manage.buyOrderUpdate',
  148. 'update' => 'shop/lib/manage.buyOrderUpdate',
  149. ),
  150. # 数据结构
  151. 'struct' => array
  152. (
  153. 'id' => array
  154. (
  155. 'type' => 'int-11',
  156. 'name' => 'ID',
  157. 'default' => '',
  158. 'desc' => '',
  159. 'match' => 'is_numeric',
  160. 'search' => 'order',
  161. //'list' => true,
  162. ),
  163. 'type' => array
  164. (
  165. 'type' => 'int-11',
  166. 'name' => '收件人类型',
  167. 'default' => '',
  168. 'desc' => '收件人类型',
  169. 'match' => 'is_numeric',
  170. 'search' => $search_option_source_type == 3 ? 'select' : 'hidden',
  171. 'option' => $type,
  172. 'list' => $search_option_source_type == 3 ? true : false,
  173. 'list_order' => 3,
  174. ),
  175. 'type_id' => array
  176. (
  177. 'type' => 'int-11',
  178. 'name' => $search_name,
  179. 'default' => '',
  180. 'desc' => '拥有人',
  181. 'match' => 'is_numeric',
  182. //'search' => $search_option_type == 3 ? '' : 'select',
  183. 'search' => $search_option_type == 3 ? '' : array
  184. (
  185. 'api' => $search,
  186. 'col' => 'name',
  187. 'result' => 'id',
  188. ),
  189. 'search' => $search_option_type == 3 ? '' : 'select',
  190. 'option' => $search_option,
  191. //'update_search' => $search_url,
  192. 'list' => 'Dever::load("shop/lib/manage.buyInfo", "{type}", "{type_id}")',
  193. 'list_order' => 2,
  194. ),
  195. 'shop-info-sid'=> array
  196. (
  197. 'name' => '门店编号',
  198. 'default' => '',
  199. 'desc' => '门店编号',
  200. 'match' => 'option',
  201. # 读取另外表的关联方式
  202. 'sync' => array('type_id', 'id'),
  203. 'search' => $search_option_type == 1 ? array
  204. (
  205. 'api' => 'shop/info-like',
  206. 'col' => 'sid',
  207. 'result' => 'id',
  208. 'search' => 'type_id',//本表的字段,默认为当前的字段
  209. ) : false,
  210. 'list' => $search_option_type == 1 ? true : false,
  211. 'list_order' => 1,
  212. ),
  213. 'shop-info-type'=> array
  214. (
  215. 'name' => '门店类型',
  216. 'default' => '',
  217. 'desc' => '门店类型',
  218. 'match' => 'option',
  219. # 读取另外表的关联方式
  220. 'sync' => array('type_id', 'id'),
  221. 'list' => $search_option_type == 1 ? 'Dever::load("shop/lib/manage.shopInfoType", {shop-info-type})' : false,
  222. 'list_order' => 3,
  223. ),
  224. 'area' => array
  225. (
  226. 'type' => 'varchar-500',
  227. 'name' => '所在街道',
  228. 'default' => '',
  229. 'desc' => '所在街道',
  230. 'match' => 'option',
  231. 'search' => $search_option_type == 1 && !$search_option_source_type ? 'linkage' : false,
  232. 'update' => 'linkage',
  233. 'option' => Dever::url('lib/area.get', $search_table),
  234. //'list' => 'Dever::load("area/api.string", "{area}")',
  235. ),
  236. 'source_type' => array
  237. (
  238. 'type' => 'int-11',
  239. 'name' => '供货商类型',
  240. 'default' => '',
  241. 'desc' => '供货商类型',
  242. 'match' => 'is_numeric',
  243. 'search' => 'hidden',
  244. 'value' => $search_option_source_type,
  245. ),
  246. 'source_id' => array
  247. (
  248. 'type' => 'int-11',
  249. 'name' => $source_name,
  250. 'default' => '',
  251. 'desc' => '供货商',
  252. 'match' => 'is_numeric',
  253. 'searchs' => $search_option_source_type == 2 ? array
  254. (
  255. 'api' => 'store/info-like',
  256. 'col' => 'name',
  257. 'result' => 'id',
  258. ) : array
  259. (
  260. 'api' => 'factory/info-like',
  261. 'col' => 'name',
  262. 'result' => 'id',
  263. ),
  264. //'search' => $search_option_type != 1 ? 'select' : false,
  265. 'option' => $search_option,
  266. 'list' => 'Dever::load("shop/lib/manage.buyInfo", "{source_type}", "{source_id}")',
  267. 'list_order' => $source_order,
  268. ),
  269. 'name' => array
  270. (
  271. 'type' => 'varchar-800',
  272. 'name' => '订单名称',
  273. 'default' => '',
  274. 'desc' => '订单名称',
  275. 'match' => 'is_string',
  276. 'update' => 'text',
  277. ),
  278. 'parent_type' => array
  279. (
  280. 'type' => 'int-11',
  281. 'name' => '原订单类型',
  282. 'default' => '1',
  283. 'desc' => '原订单类型',
  284. 'match' => 'is_numeric',
  285. 'option' => $parent_type,
  286. ),
  287. 'parent_order_id' => array
  288. (
  289. 'type' => 'int-11',
  290. 'name' => '原订单id',
  291. 'default' => '',
  292. 'desc' => '原订单id',
  293. 'match' => 'is_numeric',
  294. ),
  295. 'order_num' => array
  296. (
  297. 'type' => 'varchar-100',
  298. 'name' => '订货单号',
  299. 'default' => '',
  300. 'desc' => '订货单号',
  301. 'match' => 'is_string',
  302. 'update' => 'text',
  303. 'search' => 'fulltext',
  304. 'list' => true,
  305. 'list_order' => 5,
  306. ),
  307. 'price' => array
  308. (
  309. 'type' => 'varchar-50',
  310. 'name' => '购买价格-采购价',
  311. 'default' => '0',
  312. 'desc' => '购买价格',
  313. 'match' => 'option',
  314. 'update' => 'text',
  315. 'list' => $search_option_type == 1 ? true : false,
  316. 'list_name' => '订货单总金额',
  317. 'list_order' => 7,
  318. ),
  319. 'p_price' => array
  320. (
  321. 'type' => 'varchar-50',
  322. 'name' => '购买价格-出厂价,给厂家看的',
  323. 'default' => '0',
  324. 'desc' => '购买价格',
  325. 'match' => 'option',
  326. 'update' => 'text',
  327. 'list' => $search_option_source_type == 3 ? true : false,
  328. 'list_name' => '订货单总金额',
  329. 'list_order' => 7,
  330. ),
  331. 'num' => array
  332. (
  333. 'type' => 'int-11',
  334. 'name' => '购买数量',
  335. 'default' => '',
  336. 'desc' => '购买数量',
  337. 'match' => 'is_numeric',
  338. 'search' => 'select',
  339. 'list' => true,
  340. 'list_name' => '订货总数量',
  341. 'list_order' => 6,
  342. ),
  343. 'refund_cash' => array
  344. (
  345. 'type' => 'varchar-50',
  346. 'name' => '退款合计金额-采购价格',
  347. 'default' => '0',
  348. 'desc' => '退款合计金额',
  349. 'match' => 'option',
  350. 'update' => 'text',
  351. 'list' => ($search_option_type == 1 || $search_option_source_type == 3) ? true : false,
  352. 'list_name' => '退款金额',
  353. 'list_order' => 11,
  354. ),
  355. 'refund_p_cash' => array
  356. (
  357. 'type' => 'varchar-50',
  358. 'name' => '退款合计金额-出厂价格',
  359. 'default' => '0',
  360. 'desc' => '退款合计金额',
  361. 'match' => 'option',
  362. 'update' => 'text',
  363. 'list' => ($search_option_type == 2 || $search_option_source_type == 2 || $search_option_source_type == 3) ? 'Dever::load("shop/lib/manage.buyInfoRefundNum", "{id}")' : false,
  364. 'list_name' => '已退商品数量',
  365. 'list_order' => 11,
  366. ),
  367. 'refund_status' => array
  368. (
  369. 'type' => 'tinyint-1',
  370. 'name' => '退款状态',
  371. 'default' => '1',
  372. 'desc' => '退款状态',
  373. 'match' => 'is_numeric',
  374. 'option' => $refund_status,
  375. //'search' => 'select',
  376. 'list' => $search_option_type == 1 ? 'Dever::load("shop/lib/manage.buyInfoRefundStatus", "{id}")' : false,
  377. 'list_name' => '退款状态',
  378. 'list_order' => 10,
  379. ),
  380. 'info' => array
  381. (
  382. 'type' => 'varchar-300',
  383. 'name' => '订单备注',
  384. 'default' => '',
  385. 'desc' => '订单备注',
  386. 'match' => 'option',
  387. 'update' => 'textarea',
  388. ),
  389. 'status' => array
  390. (
  391. 'type' => 'tinyint-1',
  392. 'name' => '状态',
  393. 'default' => '1',
  394. 'desc' => '状态',
  395. 'match' => 'is_numeric',
  396. 'option' => $status,
  397. 'search' => 'select',
  398. 'list' => 'Dever::load("mshop/lib/buy.orderStatus", "{id}")',
  399. 'list_name' => '订货单状态',
  400. 'list_order' => 9,
  401. ),
  402. 'out_status' => array
  403. (
  404. 'type' => 'tinyint-1',
  405. 'name' => '导出状态',
  406. 'default' => '1',
  407. 'desc' => '导出状态',
  408. 'match' => 'is_numeric',
  409. 'option' => $out_status,
  410. ),
  411. 'out_date' => array
  412. (
  413. 'type' => 'int-11',
  414. 'name' => '导出时间',
  415. 'default' => '',
  416. 'match' => 'is_numeric',
  417. 'desc' => '',
  418. ),
  419. 'source_out_status' => array
  420. (
  421. 'type' => 'tinyint-1',
  422. 'name' => '导出状态',
  423. 'default' => '1',
  424. 'desc' => '导出状态',
  425. 'match' => 'is_numeric',
  426. 'option' => $out_status,
  427. ),
  428. 'source_out_date' => array
  429. (
  430. 'type' => 'int-11',
  431. 'name' => '导出时间',
  432. 'default' => '',
  433. 'match' => 'is_numeric',
  434. 'desc' => '',
  435. ),
  436. 'audit' => array
  437. (
  438. 'type' => 'tinyint-1',
  439. 'name' => '审核状态',
  440. 'default' => '2',
  441. 'desc' => '审核状态',
  442. 'match' => 'is_numeric',
  443. 'option' => $audit,
  444. //'search' => 'select',
  445. 'update' => 'radio',
  446. ),
  447. 'audit_desc' => array
  448. (
  449. 'type' => 'varchar-500',
  450. 'name' => '未通过原因',
  451. 'default' => '',
  452. 'desc' => '未通过原因',
  453. 'match' => 'option',
  454. 'update' => 'textarea',
  455. ),
  456. 'state' => array
  457. (
  458. 'type' => 'tinyint-1',
  459. 'name' => '状态',
  460. 'default' => '1',
  461. 'desc' => '请选择状态',
  462. 'match' => 'is_numeric',
  463. ),
  464. 'fdate' => array
  465. (
  466. 'type' => 'int-11',
  467. 'name' => '完成时间',
  468. 'default' => '',
  469. 'match' => 'is_numeric',
  470. 'desc' => '',
  471. ),
  472. 'operdate' => array
  473. (
  474. 'type' => 'int-11',
  475. 'name' => '审核时间',
  476. 'default' => '',
  477. 'match' => 'is_numeric',
  478. 'desc' => '',
  479. ),
  480. 'shop-buy_order_ps-cdate'=> array
  481. (
  482. 'name' => '发货日期',
  483. 'default' => '',
  484. 'desc' => '发货日期',
  485. 'match' => 'option',
  486. # 读取另外表的关联方式
  487. 'sync' => array('id', 'order_id'),
  488. 'list' => ($search_option_type == 2 || $search_option_source_type == 2 || $search_option_source_type == 3) ? '"{shop-buy_order_ps-cdate}" ? date("Y-m-d H:i", {shop-buy_order_ps-cdate}) : "-"' : false,
  489. 'list_order' => 9,
  490. ),
  491. 'shop-buy_order_ps-ydate'=> array
  492. (
  493. 'name' => '收货日期',
  494. 'default' => '',
  495. 'desc' => '收货日期',
  496. 'match' => 'option',
  497. # 读取另外表的关联方式
  498. 'sync' => array('id', 'order_id'),
  499. 'list' => $search_option_type == 2 ? '"{shop-buy_order_ps-ydate}" ? date("Y-m-d H:i", {shop-buy_order_ps-ydate}) : "-"': false,
  500. 'list_order' => 9,
  501. ),
  502. 'cdate' => array
  503. (
  504. 'type' => 'int-11',
  505. 'name' => '下单时间',
  506. 'match' => array('is_numeric', time()),
  507. 'desc' => '',
  508. # 只有insert时才生效
  509. 'insert' => true,
  510. 'search' => 'sdate',
  511. 'list' => 'date("Y-m-d H:i", {cdate})',
  512. 'list_name' => '订货日期',
  513. 'list_order' => 8,
  514. //'list' => 'Dever::load("service/lib/manage.showOrderTime", "{id}")',
  515. ),
  516. ),
  517. 'manage' => array
  518. (
  519. 'delete' => false,
  520. 'edit' => false,
  521. 'insert' => false,
  522. 'excel' => $excel,
  523. 'button' => array
  524. (
  525. //'导出订单' => array('location', 'user/lib/manage.out'),
  526. ),
  527. 'list_button' => array(
  528. //'edit' => array('退款', 'status,tk_time,tk_pic,tk_desc,tk_admin', '{status} == 2'),
  529. //'delete' => array('删除', '', '{status} == 1'),
  530. 'list' => array('查看详情', '"buy_order_goods&project=shop&order_id={id}&page_type=1&type='.$stype.'&noprice='.$noprice.'"'),
  531. //'oper' => array('审核', '"mshop/lib/manage.audit?order_id={id}"', '{status} == 2'),
  532. 'fast' => array('审核', '"buy_order&where_id={id}&col=audit,audit_desc&oper_save_jump=buy_order&oper_table=buy_order&oper_parent=buy_order"', '{status} == 2'),
  533. //'oper1' => array('发货', '"mshop/lib/manage.send?order_id={id}"', '{status} == 3'),
  534. //'fast1' => array('发货', '"buy_order_ps&where_id={id}&search_option_order_id={id}&oper_save_jump=buy_order&oper_table=buy_order&oper_parent=buy_order"', '{status} == 3'),
  535. ),
  536. ),
  537. 'alter' => array
  538. (
  539. 2 => array
  540. (
  541. array('update', 'parent_order_id', 'parent_order_id', 'int-11 0 原订单id'),
  542. ),
  543. 'version' => 2,
  544. ),
  545. 'request' => array
  546. (
  547. 'getAll' => array
  548. (
  549. # 匹配的正则或函数 选填项
  550. 'option' => array
  551. (
  552. 'name' => array('yes', 'like'),
  553. 'order_num' => array('yes', 'like'),
  554. 'type' => 'yes',
  555. 'type_id' => 'yes',
  556. 'source_type' => 'yes',
  557. 'source_id' => 'yes',
  558. 'parent_type' => 'yes',
  559. 'out_status' => 'yes',
  560. 'source_out_status' => 'yes',
  561. 'start' => array('yes-cdate', '>='),
  562. 'end' => array('yes-cdate', '<='),
  563. 'start_o' => array('yes-operdate', '>='),
  564. 'end_o' => array('yes-operdate', '<='),
  565. 'start_f' => array('yes-fdate', '>='),
  566. 'end_f' => array('yes-fdate', '<='),
  567. 'status' => array('yes', 'in'),
  568. 'refund_status' => 'yes',
  569. 'state' => 1,
  570. ),
  571. 'type' => 'all',
  572. 'order' => array('cdate' => 'desc'),
  573. 'page' => array(20, 'list'),
  574. 'col' => '*',
  575. ),
  576. 'getData' => array
  577. (
  578. # 匹配的正则或函数 选填项
  579. 'option' => array
  580. (
  581. 'name' => array('yes', 'like'),
  582. 'order_num' => array('yes', 'like'),
  583. 'type' => 'yes',
  584. 'type_id' => 'yes',
  585. 'source_type' => 'yes',
  586. 'source_id' => 'yes',
  587. 'parent_type' => 'yes',
  588. 'out_status' => 'yes',
  589. 'source_out_status' => 'yes',
  590. 'start' => array('yes-cdate', '>='),
  591. 'end' => array('yes-cdate', '<='),
  592. 'start_o' => array('yes-operdate', '>='),
  593. 'end_o' => array('yes-operdate', '<='),
  594. 'start_f' => array('yes-fdate', '>='),
  595. 'end_f' => array('yes-fdate', '<='),
  596. 'status' => array('yes', 'in'),
  597. 'refund_status' => 'yes',
  598. 'state' => 1,
  599. ),
  600. 'type' => 'all',
  601. 'order' => array('cdate' => 'desc'),
  602. 'col' => '*',
  603. ),
  604. # 获取订单数量
  605. 'getOrderNum' => array
  606. (
  607. # 匹配的正则或函数 选填项
  608. 'option' => array
  609. (
  610. 'start' => array('yes-cdate', '>='),
  611. 'end' => array('yes-cdate', '<='),
  612. 'start_o' => array('yes-operdate', '>='),
  613. 'end_o' => array('yes-operdate', '<='),
  614. 'type' => 'yes',
  615. 'type_id' => 'yes',
  616. 'source_type' => 'yes',
  617. 'source_id' => 'yes',
  618. 'status' => array('yes', 'in'),
  619. 'state' => 1,
  620. ),
  621. 'type' => 'count',
  622. 'col' => '*',
  623. ),
  624. # 获取总金额
  625. 'getCashNum' => array
  626. (
  627. # 匹配的正则或函数 选填项
  628. 'option' => array
  629. (
  630. 'start' => array('yes-cdate', '>='),
  631. 'end' => array('yes-cdate', '<='),
  632. 'start_o' => array('yes-operdate', '>='),
  633. 'end_o' => array('yes-operdate', '<='),
  634. 'type' => 'yes',
  635. 'type_id' => 'yes',
  636. 'source_type' => 'yes',
  637. 'source_id' => 'yes',
  638. 'status' => array('yes', 'in'),
  639. 'state' => 1,
  640. ),
  641. 'type' => 'one',
  642. 'col' => 'sum(price-refund_cash) as total',
  643. ),
  644. # 获取总金额
  645. 'getPCashNum' => array
  646. (
  647. # 匹配的正则或函数 选填项
  648. 'option' => array
  649. (
  650. 'start' => array('yes-cdate', '>='),
  651. 'end' => array('yes-cdate', '<='),
  652. 'start_o' => array('yes-operdate', '>='),
  653. 'end_o' => array('yes-operdate', '<='),
  654. 'type' => 'yes',
  655. 'type_id' => 'yes',
  656. 'source_type' => 'yes',
  657. 'source_id' => 'yes',
  658. 'status' => array('yes', 'in'),
  659. 'state' => 1,
  660. ),
  661. 'type' => 'one',
  662. 'col' => 'sum(p_price-refund_p_cash) as total',
  663. ),
  664. # 获取商品数量
  665. 'getGoodsNum' => array
  666. (
  667. # 匹配的正则或函数 选填项
  668. 'option' => array
  669. (
  670. 'start' => array('yes-cdate', '>='),
  671. 'end' => array('yes-cdate', '<='),
  672. 'start_o' => array('yes-operdate', '>='),
  673. 'end_o' => array('yes-operdate', '<='),
  674. 'type' => 'yes',
  675. 'type_id' => 'yes',
  676. 'source_type' => 'yes',
  677. 'source_id' => 'yes',
  678. 'status' => array('yes', 'in'),
  679. 'state' => 1,
  680. ),
  681. 'type' => 'one',
  682. 'col' => 'sum(num) as total',
  683. ),
  684. # 获取提交订单超过12个小时
  685. 'getDataByTime' => array
  686. (
  687. # 匹配的正则或函数 选填项
  688. 'option' => array
  689. (
  690. 'cdate' => array('yes', '<='),
  691. 'status' => 'yes',
  692. 'notice' => 'yes',
  693. 'state' => 1,
  694. ),
  695. 'type' => 'all',
  696. 'order' => array('cdate' => 'desc'),
  697. 'col' => '*',
  698. ),
  699. # 获取商品数量
  700. 'getGoodsTotal' => array
  701. (
  702. # 匹配的正则或函数 选填项
  703. 'option' => array
  704. (
  705. 'type' => 'yes',
  706. 'type_id' => 'yes',
  707. 'status' => array('yes', 'in'),
  708. 'state' => 1,
  709. ),
  710. 'type' => 'one',
  711. 'col' => 'sum(num) as total',
  712. ),
  713. 'getDataToId' => array
  714. (
  715. # 匹配的正则或函数 选填项
  716. 'option' => array
  717. (
  718. 'type' => 'yes',
  719. 'type_id' => 'yes',
  720. 'source_type' => 'yes',
  721. 'source_id' => 'yes',
  722. 'parent_type' => 'yes',
  723. 'parent_order_id' => 'yes',
  724. 'status' => array('yes', 'in'),
  725. 'state' => 1,
  726. ),
  727. 'type' => 'all',
  728. 'order' => array('cdate' => 'desc'),
  729. 'col' => '*|id',
  730. ),
  731. ),
  732. );