buy_order.php 24 KB

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