buy_order.php 24 KB

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