buy_order.php 29 KB

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