dh_order.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594
  1. <?php
  2. $pay_status = Dever::config('base', 'pay')->pay['status'];
  3. $audit = array
  4. (
  5. //1 => '待审核',
  6. 2 => '审核通过',
  7. 3 => '审核未通过',
  8. );
  9. $type = Dever::db('agent/member_goods')->config['set']['type'];
  10. $dh_type = array
  11. (
  12. 1 => '兑换',
  13. 2 => '自动发放',
  14. );
  15. $mid = Dever::input('search_option_mid');
  16. $button = array();
  17. if ($mid) {
  18. $button = array
  19. (
  20. '返回上一页' => array('location', 'l=project/database/list&project=agent&table=member_area&page_type=1&mid=' . $mid),
  21. );
  22. }
  23. $status = array
  24. (
  25. 1 => '待支付',
  26. 2 => '待审核',
  27. 3 => '已审核(未发货)',
  28. 4 => '已审核(已发货)',
  29. 5 => '已完成',
  30. 6 => '已完成(有退款)',
  31. 7 => '作废',
  32. 8 => '已退款',
  33. 11 => '已过期',
  34. );
  35. $refund_status = array
  36. (
  37. 1 => '未申请',
  38. 2 => '申请中',
  39. 3 => '有退款',
  40. 4 => '已退款',
  41. );
  42. $mid = Dever::input('search_option_mid');
  43. return array
  44. (
  45. # 表名
  46. 'name' => 'dh_order',
  47. # 显示给用户看的名称
  48. 'lang' => '权益订单',
  49. 'order' => 80,
  50. 'status' => $status,
  51. 'end' => array
  52. (
  53. //'insert' => 'agent/lib/manage.sellOrderUpdate',
  54. 'update' => 'agent/lib/manage.sellOrderUpdate',
  55. ),
  56. # 数据结构
  57. 'struct' => array
  58. (
  59. 'id' => array
  60. (
  61. 'type' => 'int-11',
  62. 'name' => 'ID',
  63. 'default' => '',
  64. 'desc' => '',
  65. 'match' => 'is_numeric',
  66. 'search' => 'order',
  67. //'list' => true,
  68. ),
  69. 'shop_id' => array
  70. (
  71. 'type' => 'int-11',
  72. 'name' => '门店名称',
  73. 'default' => '',
  74. 'desc' => '门店名称',
  75. 'match' => 'is_numeric',
  76. 'search' => 'select',
  77. 'update' => 'hidden',
  78. ),
  79. 'mid' => array
  80. (
  81. 'type' => 'int-11',
  82. 'name' => '行权人',
  83. 'default' => '-1',
  84. 'desc' => '代理商',
  85. 'match' => 'is_string',
  86. 'update' => 'text',
  87. 'searchs' => array
  88. (
  89. 'api' => 'agent/member-find',
  90. 'col' => 'mobile',
  91. 'result' => 'id',
  92. ),
  93. 'search' => 'hidden',
  94. 'list' => 'Dever::load("agent/lib/member.getOne", {mid})',
  95. 'list_order' => 3,
  96. ),
  97. 'mobile' => array
  98. (
  99. 'type' => 'varchar-300',
  100. 'name' => '手机号',
  101. 'default' => '',
  102. 'desc' => '手机号',
  103. 'match' => 'option',
  104. 'search' => $mid ? 'hidden' : 'fulltext',
  105. // 'list' => true,
  106. 'list' =>'Dever::load("agent/lib/member.set_mobile", {id})',
  107. 'list_order' => 4,
  108. ),
  109. 'agent-member-mobile'=> array
  110. (
  111. 'name' => '名称',
  112. 'default' => '',
  113. 'desc' => '手机号',
  114. 'match' => 'option',
  115. 'search' => array
  116. (
  117. 'api' => 'agent/member-find',
  118. 'col' => 'name',
  119. 'result' => 'id',
  120. 'search' => 'mid',
  121. ),
  122. # 读取另外表的关联方式
  123. 'sync' => array('mid', 'id'),
  124. ),
  125. 'agent-member-idcard'=> array
  126. (
  127. 'name' => '身份证号',
  128. 'default' => '',
  129. 'desc' => '手机号',
  130. 'match' => 'option',
  131. 'search' => array
  132. (
  133. 'api' => 'agent/member-find',
  134. 'col' => 'idcard',
  135. 'result' => 'id',
  136. 'search' => 'mid',
  137. ),
  138. # 读取另外表的关联方式
  139. 'sync' => array('mid', 'id'),
  140. ),
  141. 'address_id' => array
  142. (
  143. 'type' => 'int-11',
  144. 'name' => '送货地址',
  145. 'default' => '',
  146. 'desc' => '送货地址',
  147. 'match' => 'is_numeric',
  148. ),
  149. 'type' => array
  150. (
  151. 'type' => 'tinyint-1',
  152. 'name' => '类型',
  153. 'default' => '1',
  154. 'desc' => '类型',
  155. 'match' => 'is_numeric',
  156. 'update' => 'radio',
  157. 'option' => $type,
  158. ),
  159. 'type_id' => array
  160. (
  161. 'type' => 'int-11',
  162. 'name' => '类型id',
  163. 'default' => '-1',
  164. 'desc' => '类型id',
  165. 'match' => 'is_numeric',
  166. 'list_name' => '权益名称',
  167. //'list' => 'Dever::load("agent/lib/manage.getGoods#name", "{type}", "{type_id}", "-2")',
  168. ),
  169. 'dh_type' => array
  170. (
  171. 'type' => 'tinyint-1',
  172. 'name' => '行权方式',
  173. 'default' => '1',
  174. 'desc' => '行权方式',
  175. 'match' => 'is_numeric',
  176. 'update' => 'radio',
  177. 'option' => $dh_type,
  178. 'list' => true,
  179. 'list_order' => 5,
  180. ),
  181. 'name' => array
  182. (
  183. 'type' => 'varchar-800',
  184. 'name' => '详情',
  185. 'default' => '',
  186. 'desc' => '订单名称',
  187. 'match' => 'is_string',
  188. 'update' => 'text',
  189. 'list' => true,
  190. 'list_order' => 6,
  191. ),
  192. 'order_num' => array
  193. (
  194. 'type' => 'varchar-100',
  195. 'name' => '订单号',
  196. 'default' => '',
  197. 'desc' => '订单号',
  198. 'match' => 'is_string',
  199. 'update' => 'text',
  200. //'search' => 'fulltext',
  201. //'list' => true,
  202. //'list_order' => 1,
  203. ),
  204. 'price' => array
  205. (
  206. 'type' => 'varchar-50',
  207. 'name' => '订单总金额',
  208. 'default' => '0',
  209. 'desc' => '实付金额',
  210. 'match' => 'option',
  211. 'update' => 'text',
  212. 'list' => false,
  213. 'list_order' => 11,
  214. ),
  215. 'num' => array
  216. (
  217. 'type' => 'int-11',
  218. 'name' => '购买总数量',
  219. 'default' => '',
  220. 'desc' => '购买总数量',
  221. 'match' => 'is_numeric',
  222. 'search' => 'select',
  223. 'list' => false,
  224. 'list_order' => 10,
  225. ),
  226. 'refund_num' => array
  227. (
  228. 'type' => 'int-11',
  229. 'name' => '退款数量',
  230. 'default' => '0',
  231. 'desc' => '退款数量',
  232. 'match' => 'is_numeric',
  233. ),
  234. 'refund_cash' => array
  235. (
  236. 'type' => 'float-11,2',
  237. 'name' => '退款金额',
  238. 'default' => '0',
  239. 'desc' => '已退订单金额',
  240. 'match' => 'option',
  241. 'update' => 'text',
  242. ),
  243. 'refund_status' => array
  244. (
  245. 'type' => 'tinyint-1',
  246. 'name' => '退款状态',
  247. 'default' => '1',
  248. 'desc' => '申请退款状态',
  249. 'match' => 'is_numeric',
  250. 'option' => $refund_status,
  251. ),
  252. 'info' => array
  253. (
  254. 'type' => 'varchar-300',
  255. 'name' => '订单备注',
  256. 'default' => '',
  257. 'desc' => '订单备注',
  258. 'match' => 'option',
  259. 'update' => 'textarea',
  260. ),
  261. 'status' => array
  262. (
  263. 'type' => 'tinyint-1',
  264. 'name' => '订单状态',
  265. 'default' => '1',
  266. 'desc' => '订单状态',
  267. 'match' => 'is_numeric',
  268. 'option' => $status,
  269. 'search' => 'select',
  270. 'list' => true,
  271. 'list_order' => 7,
  272. ),
  273. 'audit' => array
  274. (
  275. 'type' => 'tinyint-1',
  276. 'name' => '审核状态',
  277. 'default' => '2',
  278. 'desc' => '审核状态',
  279. 'match' => 'is_numeric',
  280. 'option' => $audit,
  281. //'search' => 'select',
  282. 'update' => 'radio',
  283. 'control' => 'audit',
  284. ),
  285. 'audit_desc' => array
  286. (
  287. 'type' => 'varchar-500',
  288. 'name' => '审核备注',
  289. 'default' => '',
  290. 'desc' => '审核备注',
  291. 'match' => 'is_string',
  292. 'update' => 'textarea',
  293. 'show' => 'audit=3',
  294. ),
  295. 'fdate' => array
  296. (
  297. 'type' => 'int-11',
  298. 'name' => '完成时间',
  299. 'default' => '',
  300. 'match' => 'is_numeric',
  301. 'desc' => '',
  302. ),
  303. 'operdate' => array
  304. (
  305. 'type' => 'int-11',
  306. 'name' => '操作时间',
  307. 'default' => '',
  308. 'match' => 'is_numeric',
  309. 'desc' => '',
  310. //'list' => '"{operdate}" > 0 ? date("Y-m-d H:i:s", {operdate}) : "-"',
  311. //'list_name' => '发货时间',
  312. //'list_order' => 8,
  313. ),
  314. 'state' => array
  315. (
  316. 'type' => 'tinyint-1',
  317. 'name' => '状态',
  318. 'default' => '1',
  319. 'desc' => '请选择状态',
  320. 'match' => 'is_numeric',
  321. ),
  322. 'cdate' => array
  323. (
  324. 'type' => 'int-11',
  325. 'name' => '行权时间',
  326. 'match' => array('is_numeric', time()),
  327. 'desc' => '',
  328. # 只有insert时才生效
  329. 'insert' => true,
  330. 'search' => 'date',
  331. 'list' => 'date("Y-m-d H:i", {cdate})',
  332. //'list' => 'Dever::load("service/lib/manage.showOrderTime", "{id}")',
  333. 'list_order' => 2,
  334. ),
  335. ),
  336. 'manage' => array
  337. (
  338. 'delete' => false,
  339. 'edit' => false,
  340. 'insert' => false,
  341. 'button' => $button,
  342. 'list_button' => array
  343. (
  344. //fast_list
  345. 'list' => array('查看详情', '"dh_order_goods&project=agent&order_id={id}&page_type=1"', '{type} == 1'),
  346. 'list1' => array('查看采购单', '"buy_order&project=shop&search_option_type=1&search_option_parent_type=3&search_option_parent_order_id={id}&oper_table=dh_order&oper_project=agent"', '{type} == 1 && {status} >= 3 && {audit} == 2'),
  347. // 'fast' => array('审核', '"dh_order&where_id={id}&col=audit,audit_desc&oper_save_jump=dh_order&oper_table=dh_order&oper_parent=dh_order"', '{type} == 1 && {status} == 2'),
  348. 'list2' => array('审核', '"dh_order_goods&project=agent&order_id={id}&audit=1&page_type=1"', '{status} == 2'),
  349. 'oper' => array('确认收货', '"agent/lib/manage.setDhOrderStatus?mid={mid}&order_id={id}"', '{type} == 1 && {status} == 4'),
  350. ),
  351. ),
  352. 'request' => array
  353. (
  354. 'getList' => array
  355. (
  356. # 匹配的正则或函数 选填项
  357. 'option' => array
  358. (
  359. 'mid' => 'yes',
  360. 'status' => 'yes',
  361. 'state' => 1,
  362. ),
  363. 'type' => 'all',
  364. 'order' => array('cdate' => 'desc'),
  365. 'page' => array(5, 'list'),
  366. 'col' => '*',
  367. ),
  368. 'getAll' => array
  369. (
  370. # 匹配的正则或函数 选填项
  371. 'option' => array
  372. (
  373. 'name' => array('yes', 'like'),
  374. 'mid' => 'yes',
  375. 'mobile' => 'yes',
  376. 'start' => array('yes-cdate', '>='),
  377. 'end' => array('yes-cdate', '<='),
  378. 'status' => array('yes', 'in'),
  379. 'state' => 1,
  380. ),
  381. 'type' => 'all',
  382. 'order' => array('cdate' => 'desc'),
  383. 'page' => array(10, 'list'),
  384. 'col' => '*',
  385. ),
  386. 'getYes' => array
  387. (
  388. # 匹配的正则或函数 选填项
  389. 'option' => array
  390. (
  391. 'mid' => 'yes',
  392. 'state' => 1,
  393. ),
  394. 'type' => 'all',
  395. 'order' => array('cdate' => 'desc'),
  396. 'col' => '*',
  397. ),
  398. # 获取提交订单超过12个小时
  399. 'getDataByTime' => array
  400. (
  401. # 匹配的正则或函数 选填项
  402. 'option' => array
  403. (
  404. 'cdate' => array('yes', '<='),
  405. 'status' => array('yes', 'in'),
  406. 'state' => 1,
  407. ),
  408. 'type' => 'all',
  409. 'order' => array('cdate' => 'desc'),
  410. 'col' => '*',
  411. ),
  412. # 获取1,2
  413. 'getBuy' => array
  414. (
  415. # 匹配的正则或函数 选填项
  416. 'option' => array
  417. (
  418. 'status' => 'yes',
  419. 'mid' => 'yes',
  420. 'order_num' => 'yes',
  421. 'uid' => 'yes',
  422. 'state' => 1,
  423. ),
  424. 'type' => 'all',
  425. 'order' => array('id' => 'desc'),
  426. 'col' => '*',
  427. ),
  428. 'getMyAll' => array
  429. (
  430. # 匹配的正则或函数 选填项
  431. 'option' => array
  432. (
  433. 'uid' => 'yes',
  434. 'status' => 'yes',
  435. 'cate_id' => 'yes',
  436. 'state' => 1,
  437. ),
  438. 'type' => 'all',
  439. 'order' => array('id' => 'desc'),
  440. 'page' => array(10, 'list'),
  441. 'col' => 'id,order_num,name,buy_num,cdate,cash,mid,buy_id',
  442. ),
  443. # 删除未支付订单
  444. 'drop' => array
  445. (
  446. # 匹配的正则或函数 选填项
  447. 'where' => array
  448. (
  449. 'time' => array('yes-cdate', '<='),
  450. 'status' => 1,
  451. 'state' => 1,
  452. ),
  453. 'type' => 'delete',
  454. 'col' => 'id,order_num',
  455. ),
  456. # 获取数据
  457. 'getAllByDate' => array
  458. (
  459. # 匹配的正则或函数 选填项
  460. 'where' => array
  461. (
  462. 'start' => array('yes-cdate', '>='),
  463. 'end' => array('yes-cdate', '<='),
  464. 'status' => array('yes', 'in'),
  465. 'state' => 1,
  466. ),
  467. 'type' => 'all',
  468. 'col' => 'id,order_num,mobile,mid,cdate,price-refund_cash as total,num-refund_num as num',
  469. ),
  470. # 获取订单数量
  471. 'getOrderNum' => array
  472. (
  473. # 匹配的正则或函数 选填项
  474. 'option' => array
  475. (
  476. 'start' => array('yes-cdate', '>='),
  477. 'end' => array('yes-cdate', '<='),
  478. 'mid' => 'yes',
  479. 'status' => array('yes', 'in'),
  480. 'state' => 1,
  481. ),
  482. 'type' => 'count',
  483. 'col' => '*',
  484. ),
  485. # 获取总金额
  486. 'getCashNum' => array
  487. (
  488. # 匹配的正则或函数 选填项
  489. 'option' => array
  490. (
  491. 'start' => array('yes-cdate', '>='),
  492. 'end' => array('yes-cdate', '<='),
  493. 'mid' => 'yes',
  494. 'status' => array('yes', 'in'),
  495. 'state' => 1,
  496. ),
  497. 'type' => 'one',
  498. 'col' => 'sum(price-refund_cash) as total',
  499. ),
  500. # 获取商品数量
  501. 'getGoodsNum' => array
  502. (
  503. # 匹配的正则或函数 选填项
  504. 'option' => array
  505. (
  506. 'start' => array('yes-cdate', '>='),
  507. 'end' => array('yes-cdate', '<='),
  508. 'mid' => 'yes',
  509. 'status' => array('yes', 'in'),
  510. 'state' => 1,
  511. ),
  512. 'type' => 'one',
  513. 'col' => 'sum(num-refund_num) as total',
  514. ),
  515. # 获取订单数量
  516. 'getUser' => array
  517. (
  518. # 匹配的正则或函数 选填项
  519. 'option' => array
  520. (
  521. 'start' => array('yes-cdate', '>='),
  522. 'end' => array('yes-cdate', '<='),
  523. 'mid' => 'yes',
  524. 'status' => array('yes', 'in'),
  525. 'state' => 1,
  526. ),
  527. 'type' => 'all',
  528. 'group' => 'mobile',
  529. 'col' => 'count(mobile) as total',
  530. ),
  531. 'getUserNum' => array
  532. (
  533. # 匹配的正则或函数 选填项
  534. 'option' => array
  535. (
  536. 'start' => array('yes-cdate', '>='),
  537. 'end' => array('yes-cdate', '<='),
  538. 'mid' => 'yes',
  539. 'status' => array('yes', 'in'),
  540. 'state' => 1,
  541. ),
  542. 'type' => 'count',
  543. 'col' => '*',
  544. ),
  545. ),
  546. );