buy_order.php 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982
  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. 'record_cash' => array
  253. (
  254. 'type' => 'varchar-50',
  255. 'name' => '资金账户抵扣金额',
  256. 'default' => '0',
  257. 'desc' => '资金账户抵扣金额',
  258. 'match' => 'option',
  259. 'update' => 'text',
  260. ),
  261. 'refund_num' => array
  262. (
  263. 'type' => 'int-11',
  264. 'name' => '退款数量',
  265. 'default' => '0',
  266. 'desc' => '退款数量',
  267. 'match' => 'is_numeric',
  268. ),
  269. 'refund_cash' => array
  270. (
  271. 'type' => 'varchar-50',
  272. 'name' => '退款合计金额-采购价格',
  273. 'default' => '0',
  274. 'desc' => '退款合计金额',
  275. 'match' => 'option',
  276. 'update' => 'text',
  277. 'list_name' => '退款金额',
  278. 'list_order' => 11,
  279. ),
  280. 'refund_p_cash' => array
  281. (
  282. 'type' => 'varchar-50',
  283. 'name' => '退款合计金额-出厂价格',
  284. 'default' => '0',
  285. 'desc' => '退款合计金额',
  286. 'match' => 'option',
  287. 'update' => 'text',
  288. 'list_name' => '已退商品数量',
  289. 'list_order' => 11,
  290. ),
  291. 'refund_status' => array
  292. (
  293. 'type' => 'tinyint-1',
  294. 'name' => '退款状态',
  295. 'default' => '1',
  296. 'desc' => '申请退款状态',
  297. 'match' => 'is_numeric',
  298. 'option' => $refund_status,
  299. //'search' => 'select',
  300. 'list_name' => '退款状态',
  301. 'list_order' => 10,
  302. ),
  303. 'info' => array
  304. (
  305. 'type' => 'varchar-300',
  306. 'name' => '订单备注',
  307. 'default' => '',
  308. 'desc' => '订单备注',
  309. 'match' => 'option',
  310. 'update' => 'textarea',
  311. ),
  312. 'status' => array
  313. (
  314. 'type' => 'tinyint-1',
  315. 'name' => '状态',
  316. 'default' => '1',
  317. 'desc' => '状态',
  318. 'match' => 'is_numeric',
  319. 'option' => $status,
  320. 'search' => 'select',
  321. 'list' => 'Dever::load("mshop/lib/buy.orderStatus", "{id}")',
  322. 'list_name' => '订货单状态',
  323. 'list_order' => 9,
  324. ),
  325. '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. 'out_date' => array
  335. (
  336. 'type' => 'int-11',
  337. 'name' => '导出时间',
  338. 'default' => '',
  339. 'match' => 'is_numeric',
  340. 'desc' => '',
  341. ),
  342. 'source_out_status' => array
  343. (
  344. 'type' => 'tinyint-1',
  345. 'name' => '导出状态',
  346. 'default' => '1',
  347. 'desc' => '导出状态',
  348. 'match' => 'is_numeric',
  349. 'option' => $out_status,
  350. ),
  351. 'source_out_date' => array
  352. (
  353. 'type' => 'int-11',
  354. 'name' => '导出时间',
  355. 'default' => '',
  356. 'match' => 'is_numeric',
  357. 'desc' => '',
  358. ),
  359. 'audit' => array
  360. (
  361. 'type' => 'tinyint-1',
  362. 'name' => '审核状态',
  363. 'default' => '2',
  364. 'desc' => '审核状态',
  365. 'match' => 'is_numeric',
  366. 'option' => $audit,
  367. //'search' => 'select',
  368. 'update' => 'radio',
  369. ),
  370. 'audit_desc' => array
  371. (
  372. 'type' => 'varchar-500',
  373. 'name' => '审核备注',
  374. 'default' => '',
  375. 'desc' => '审核备注',
  376. 'match' => 'option',
  377. 'update' => 'textarea',
  378. ),
  379. 'state' => array
  380. (
  381. 'type' => 'tinyint-1',
  382. 'name' => '状态',
  383. 'default' => '1',
  384. 'desc' => '请选择状态',
  385. 'match' => 'is_numeric',
  386. ),
  387. 'fdate' => array
  388. (
  389. 'type' => 'int-11',
  390. 'name' => '完成时间',
  391. 'default' => '',
  392. 'match' => 'is_numeric',
  393. 'desc' => '',
  394. 'search' => 'date',
  395. ),
  396. 'operdate' => array
  397. (
  398. 'type' => 'int-11',
  399. 'name' => '审核时间',
  400. 'default' => '',
  401. 'match' => 'is_numeric',
  402. 'desc' => '',
  403. ),
  404. 'shop-buy_order_ps-cdate'=> array
  405. (
  406. 'name' => '发货日期',
  407. 'default' => '',
  408. 'desc' => '发货日期',
  409. 'match' => 'option',
  410. # 读取另外表的关联方式
  411. 'sync' => array('id', 'order_id'),
  412. 'list_order' => 9,
  413. ),
  414. 'shop-buy_order_ps-ydate'=> array
  415. (
  416. 'name' => '收货日期',
  417. 'default' => '',
  418. 'desc' => '收货日期',
  419. 'match' => 'option',
  420. # 读取另外表的关联方式
  421. 'sync' => array('id', 'order_id'),
  422. 'list_order' => 9,
  423. ),
  424. 'cdate' => array
  425. (
  426. 'type' => 'int-11',
  427. 'name' => '下单时间',
  428. 'match' => array('is_numeric', time()),
  429. 'desc' => '',
  430. # 只有insert时才生效
  431. 'insert' => true,
  432. 'search' => 'sdate',
  433. 'list' => 'date("Y-m-d H:i", {cdate})',
  434. 'list_name' => '订货日期',
  435. 'list_order' => 8,
  436. //'list' => 'Dever::load("service/lib/manage.showOrderTime", "{id}")',
  437. ),
  438. );
  439. $struct['refund_p_cash']['list'] = 'Dever::load("shop/lib/manage.buyInfoRefundNum", "{id}")';
  440. $struct['shop-buy_order_ps-cdate']['list'] = '"{shop-buy_order_ps-cdate}" ? date("Y-m-d H:i", {shop-buy_order_ps-cdate}) : "-"';
  441. $button = array();
  442. if ($search_option_type) {
  443. $struct['source_id']['name'] = '供货商';
  444. $struct['source_id']['list_order'] = 4;
  445. $struct['type_id']['search'] = 'select';
  446. if ($search_option_type == 1) {
  447. # 门店采购查询
  448. $excel = array
  449. (
  450. array('导出订单', '门店采购订单', ''),
  451. array('导出订单明细', '门店采购订单明细', 'shop/excel.buy_order'),
  452. );
  453. $struct['area']['option'] = Dever::url('lib/area.get', 'shop');
  454. $struct['area']['search'] = 'linkage';
  455. $struct['refund_p_cash']['list'] = false;
  456. $struct['shop-buy_order_ps-cdate']['list'] = false;
  457. $struct['type_id']['name'] = '门店名称';
  458. $struct['type_id']['search'] = array
  459. (
  460. 'api' => 'shop/info-like',
  461. 'col' => 'name',
  462. 'result' => 'id',
  463. );
  464. $struct['shop-info-sid']['search'] = array
  465. (
  466. 'api' => 'shop/info-like',
  467. 'col' => 'sid',
  468. 'result' => 'id',
  469. 'search' => 'type_id',//本表的字段,默认为当前的字段
  470. );
  471. $struct['shop-info-sid']['list'] = true;
  472. $struct['shop-info-type']['list'] = 'Dever::load("shop/lib/manage.shopInfoType", {shop-info-type})';
  473. $struct['source_id']['search'] = array
  474. (
  475. 'api' => 'shop/lib/manage.searchFName',
  476. 'col' => 'name',
  477. 'result' => 'id',
  478. );
  479. $struct['price']['list'] = true;
  480. $struct['refund_cash']['list'] = true;
  481. $struct['refund_status']['list'] = 'Dever::load("shop/lib/manage.buyInfoRefundStatus", "{id}")';
  482. $struct['refund_status']['search'] = 'select';
  483. } elseif ($search_option_type == 2) {
  484. $excel = array
  485. (
  486. array('导出订单', '仓库入库订单', ''),
  487. array('导出订单明细', '仓库入库订单明细', 'shop/excel.store_buy_order'),
  488. );
  489. $search_table = 'store';
  490. $struct['type_id']['name'] = '仓库名称';
  491. $struct['type_id']['option'] = $store;
  492. $struct['shop-buy_order_ps-ydate']['list'] = '"{shop-buy_order_ps-ydate}" ? date("Y-m-d H:i", {shop-buy_order_ps-ydate}) : "-"';
  493. $struct['source_type']['search'] = 'select';
  494. $struct['source_type']['option'] = array(2 => '仓库', 3 => '工厂');
  495. $struct['source_id']['search'] = array
  496. (
  497. 'api' => 'shop/lib/manage.searchFName',
  498. 'col' => 'name',
  499. 'result' => 'id',
  500. );
  501. $noprice = 1;
  502. } elseif ($search_option_type == 3) {
  503. $struct['refund_p_cash']['list'] = false;
  504. $struct['type_id']['option'] = $factory;
  505. }
  506. }
  507. if ($search_option_source_type) {
  508. $struct['source_id']['name'] = '供货商';
  509. $struct['source_id']['list_order'] = -1;
  510. if ($search_option_source_type == 2) {
  511. $noprice = 1;
  512. if ($search_option_type == 2) {
  513. $button = array
  514. (
  515. '新建库存调拨单' => array('location', 'store/lib/manage.cashier'),
  516. );
  517. $struct['source_id']['name'] = '发货仓库';
  518. $struct['source_id']['search'] = 'select';
  519. $struct['source_id']['option'] = $store_list;
  520. $struct['type_id']['name'] = '收货仓库';
  521. $struct['type_id']['search'] = 'select';
  522. $struct['type_id']['option'] = $store_list;
  523. $excel = array
  524. (
  525. array('导出订单', '仓库调拨订单', ''),
  526. array('导出订单明细', '仓库调拨订单明细', 'shop/excel.store_buy_order_diao'),
  527. );
  528. } else {
  529. $struct['source_id']['name'] = '仓库名称';
  530. $struct['source_id']['search'] = 'select';
  531. $struct['source_id']['option'] = $store;
  532. $excel = array
  533. (
  534. array('导出订单', '仓库发货订单', ''),
  535. array('导出订单明细', '仓库发货订单明细', 'shop/excel.store_buy_order_fa'),
  536. );
  537. $struct['refund_status']['search'] = 'select';
  538. }
  539. } elseif ($search_option_source_type == 3) {
  540. $struct['type']['search'] = 'select';
  541. $struct['type']['list'] = true;
  542. $struct['source_id']['name'] = '工厂名称';
  543. $struct['source_id']['search'] = 'select';
  544. $struct['source_id']['option'] = $factory;
  545. $struct['type_id']['name'] = '收件人名称';
  546. $struct['type_id']['search'] = array
  547. (
  548. 'api' => 'shop/lib/manage.searchName',
  549. 'col' => 'name',
  550. 'result' => 'id',
  551. );
  552. $struct['source_id']['list_order'] = -1;
  553. $struct['p_price']['list'] = true;
  554. $struct['type_id']['option'] = $factory;
  555. $excel = array
  556. (
  557. array('导出订单', '工厂发货订单', ''),
  558. array('导出订单明细', '工厂发货订单明细', 'shop/excel.factory_buy_order_fa'),
  559. );
  560. if ($search_option_type == 2) {
  561. $struct['type']['list'] = false;
  562. $struct['type']['search'] = 'hidden';
  563. $struct['source_type']['search'] = 'hidden';
  564. $struct['type_id']['name'] = '仓库名称';
  565. $struct['type_id']['search'] = 'select';
  566. $struct['type_id']['option'] = $store;
  567. $button = array
  568. (
  569. '新建平台订货单' => array('location', 'factory/lib/manage.cashier'),
  570. );
  571. }
  572. }
  573. }
  574. $config = array
  575. (
  576. # 表名
  577. 'name' => 'buy_order',
  578. # 显示给用户看的名称
  579. 'lang' => '采购订单',
  580. 'order' => 99,
  581. 'status' => $status,
  582. 'refund_status' => $refund_status,
  583. 'config_type' => $type,
  584. 'out_status' => $out_status,
  585. 'end' => array
  586. (
  587. 'insert' => 'shop/lib/manage.buyOrderUpdate',
  588. 'update' => 'shop/lib/manage.buyOrderUpdate',
  589. ),
  590. # 数据结构
  591. 'struct' => $struct,
  592. 'manage' => array
  593. (
  594. 'list_table' => 'html',
  595. 'delete' => false,
  596. 'edit' => false,
  597. 'insert' => false,
  598. 'excel' => $excel,
  599. 'button' => $button,
  600. 'list_button' => array(
  601. //'edit' => array('退款', 'status,tk_time,tk_pic,tk_desc,tk_admin', '{status} == 2'),
  602. //'delete' => array('删除', '', '{status} == 1'),
  603. 'list' => array('查看详情', '"buy_order_goods&project=shop&order_id={id}&page_type=1&type='.$stype.'&noprice='.$noprice.'"'),
  604. //'oper' => array('审核', '"mshop/lib/manage.audit?order_id={id}"', '{status} == 2'),
  605. //'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'),
  606. 'list1' => array('审核', '"buy_order_goods&project=shop&order_id={id}&audit=1&page_type=1&type='.$stype.'&noprice='.$noprice.'"', '{status} == 2'),
  607. //'oper1' => array('发货', '"mshop/lib/manage.send?order_id={id}"', '{status} == 3'),
  608. //'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'),
  609. ),
  610. ),
  611. 'alter' => array
  612. (
  613. 2 => array
  614. (
  615. array('update', 'parent_order_id', 'parent_order_id', 'int-11 0 原订单id'),
  616. ),
  617. 3 => array
  618. (
  619. array('update', 'refund_num', 'refund_num', 'float-11,2 0 退款数量'),
  620. array('update', 'num', 'num', 'float-11,2 0 购买数量'),
  621. ),
  622. 'version' => 3,
  623. ),
  624. 'request' => array
  625. (
  626. 'getAll' => array
  627. (
  628. # 匹配的正则或函数 选填项
  629. 'option' => array
  630. (
  631. 'name' => array('yes', 'like'),
  632. 'order_num' => array('yes', 'like'),
  633. 'type' => 'yes',
  634. 'type_id' => 'yes',
  635. 'source_type' => 'yes',
  636. 'source_id' => 'yes',
  637. 'parent_type' => array('yes', 'in'),
  638. 'out_status' => 'yes',
  639. 'source_out_status' => 'yes',
  640. 'start' => array('yes-cdate', '>='),
  641. 'end' => array('yes-cdate', '<='),
  642. 'start_o' => array('yes-operdate', '>='),
  643. 'end_o' => array('yes-operdate', '<='),
  644. 'start_f' => array('yes-fdate', '>='),
  645. 'end_f' => array('yes-fdate', '<='),
  646. 'status' => array('yes', 'in'),
  647. 'refund_status' => 'yes',
  648. 'state' => 1,
  649. ),
  650. 'type' => 'all',
  651. 'order' => array('cdate' => 'desc'),
  652. 'page' => array(20, 'list'),
  653. 'col' => '*',
  654. ),
  655. 'getData' => array
  656. (
  657. # 匹配的正则或函数 选填项
  658. 'option' => array
  659. (
  660. 'name' => array('yes', 'like'),
  661. 'order_num' => array('yes', 'like'),
  662. 'type' => 'yes',
  663. 'type_id' => 'yes',
  664. 'source_type' => 'yes',
  665. 'source_id' => 'yes',
  666. 'parent_type' => array('yes', 'in'),
  667. 'out_status' => 'yes',
  668. 'source_out_status' => 'yes',
  669. 'start' => array('yes-cdate', '>='),
  670. 'end' => array('yes-cdate', '<='),
  671. 'start_o' => array('yes-operdate', '>='),
  672. 'end_o' => array('yes-operdate', '<='),
  673. 'start_f' => array('yes-fdate', '>='),
  674. 'end_f' => array('yes-fdate', '<='),
  675. 'status' => array('yes', 'in'),
  676. 'refund_status' => 'yes',
  677. 'state' => 1,
  678. ),
  679. 'type' => 'all',
  680. 'order' => array('cdate' => 'desc'),
  681. 'col' => '*',
  682. ),
  683. # 获取订单数量
  684. 'getOrderNum' => array
  685. (
  686. # 匹配的正则或函数 选填项
  687. 'option' => array
  688. (
  689. 'start' => array('yes-cdate', '>='),
  690. 'end' => array('yes-cdate', '<='),
  691. 'start_o' => array('yes-operdate', '>='),
  692. 'end_o' => array('yes-operdate', '<='),
  693. 'type' => 'yes',
  694. 'type_id' => 'yes',
  695. 'source_type' => 'yes',
  696. 'source_id' => 'yes',
  697. 'status' => array('yes', 'in'),
  698. 'state' => 1,
  699. ),
  700. 'type' => 'count',
  701. 'col' => '*',
  702. ),
  703. # 获取总金额
  704. 'getCashNum' => array
  705. (
  706. # 匹配的正则或函数 选填项
  707. 'option' => array
  708. (
  709. 'start' => array('yes-cdate', '>='),
  710. 'end' => array('yes-cdate', '<='),
  711. 'start_o' => array('yes-operdate', '>='),
  712. 'end_o' => array('yes-operdate', '<='),
  713. 'type' => 'yes',
  714. 'type_id' => 'yes',
  715. 'source_type' => 'yes',
  716. 'source_id' => 'yes',
  717. 'status' => array('yes', 'in'),
  718. 'state' => 1,
  719. ),
  720. 'type' => 'one',
  721. 'col' => 'sum(price-refund_cash) as total',
  722. ),
  723. # 获取总金额
  724. 'getPCashNum' => array
  725. (
  726. # 匹配的正则或函数 选填项
  727. 'option' => array
  728. (
  729. 'start' => array('yes-cdate', '>='),
  730. 'end' => array('yes-cdate', '<='),
  731. 'start_o' => array('yes-operdate', '>='),
  732. 'end_o' => array('yes-operdate', '<='),
  733. 'type' => 'yes',
  734. 'type_id' => 'yes',
  735. 'source_type' => 'yes',
  736. 'source_id' => 'yes',
  737. 'status' => array('yes', 'in'),
  738. 'state' => 1,
  739. ),
  740. 'type' => 'one',
  741. 'col' => 'sum(p_price-refund_p_cash) as total',
  742. ),
  743. # 获取商品数量
  744. 'getGoodsNum' => array
  745. (
  746. # 匹配的正则或函数 选填项
  747. 'option' => array
  748. (
  749. 'start' => array('yes-cdate', '>='),
  750. 'end' => array('yes-cdate', '<='),
  751. 'start_o' => array('yes-operdate', '>='),
  752. 'end_o' => array('yes-operdate', '<='),
  753. 'type' => 'yes',
  754. 'type_id' => 'yes',
  755. 'source_type' => 'yes',
  756. 'source_id' => 'yes',
  757. 'status' => array('yes', 'in'),
  758. 'state' => 1,
  759. ),
  760. 'type' => 'one',
  761. 'col' => 'sum(num-refund_num) as total',
  762. ),
  763. # 获取提交订单超过12个小时
  764. 'getDataByTime' => array
  765. (
  766. # 匹配的正则或函数 选填项
  767. 'option' => array
  768. (
  769. 'cdate' => array('yes', '<='),
  770. 'status' => 'yes',
  771. 'notice' => 'yes',
  772. 'state' => 1,
  773. ),
  774. 'type' => 'all',
  775. 'order' => array('cdate' => 'desc'),
  776. 'col' => '*',
  777. ),
  778. # 获取商品数量
  779. 'getGoodsTotal' => array
  780. (
  781. # 匹配的正则或函数 选填项
  782. 'option' => array
  783. (
  784. 'type' => 'yes',
  785. 'type_id' => 'yes',
  786. 'status' => array('yes', 'in'),
  787. 'state' => 1,
  788. ),
  789. 'type' => 'one',
  790. 'col' => 'sum(num-refund_num) as total',
  791. ),
  792. 'getDataToId' => array
  793. (
  794. # 匹配的正则或函数 选填项
  795. 'option' => array
  796. (
  797. 'type' => 'yes',
  798. 'type_id' => 'yes',
  799. 'source_type' => 'yes',
  800. 'source_id' => 'yes',
  801. 'parent_type' => array('yes', 'in'),
  802. 'parent_order_id' => 'yes',
  803. 'status' => array('yes', 'in'),
  804. 'state' => 1,
  805. ),
  806. 'type' => 'all',
  807. 'order' => array('cdate' => 'desc'),
  808. 'col' => '*|id',
  809. ),
  810. # 按月结算区域利润
  811. 'getArea' => array
  812. (
  813. # 匹配的正则或函数 选填项
  814. 'option' => array
  815. (
  816. 'start' => array('yes-cdate', '>='),
  817. 'end' => array('yes-cdate', '>='),
  818. 'area' => array('yes', 'like'),
  819. 'type' => 1,
  820. 'status' => array('yes', 'in'),
  821. 'state' => 1,
  822. ),
  823. 'type' => 'all',
  824. 'order' => array('cdate' => 'desc'),
  825. 'col' => '*',
  826. ),
  827. # 区域查询
  828. 'getSerachMoney' => array
  829. (
  830. # 匹配的正则或函数 选填项
  831. 'option' => array
  832. (
  833. 'start' => array('yes-fdate', '>='),
  834. 'end' => array('yes-fdate', '<='),
  835. 'area' => array('yes', 'like'),
  836. 'type' => 1,
  837. 'status' => array('yes', 'in'),
  838. 'state' => 1,
  839. ),
  840. 'type' => 'one',
  841. 'col' => 'sum(price) as total',
  842. ),
  843. 'getSerachTMoney' => array
  844. (
  845. # 匹配的正则或函数 选填项
  846. 'option' => array
  847. (
  848. 'start' => array('yes-fdate', '>='),
  849. 'end' => array('yes-fdate', '<='),
  850. 'area' => array('yes', 'like'),
  851. 'type' => 1,
  852. 'type_id' => array('yes','in'),
  853. 'status' => array('yes', 'in'),
  854. 'state' => 1,
  855. ),
  856. 'type' => 'one',
  857. 'col' => 'sum(price) as total',
  858. ),
  859. 'getNewAll' => array
  860. (
  861. # 匹配的正则或函数 选填项
  862. 'option' => array
  863. (
  864. 'start' => array('yes-fdate', '>='),
  865. 'end' => array('yes-fdate', '<='),
  866. 'area' => array('yes', 'like'),
  867. 'type' => 1,
  868. 'status' => array('yes', 'in'),
  869. 'state' => 1,
  870. ),
  871. 'type' => 'all',
  872. 'col' => 'id,price',
  873. ),
  874. ),
  875. );
  876. $search_option_parent_order_id = Dever::input('search_option_parent_order_id');
  877. if ($search_option_parent_order_id) {
  878. $config['search'] = false;
  879. }
  880. return $config;