OrderStatusEnum.php 45 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460
  1. <?php
  2. namespace common\enums;
  3. use common\enums\BaseEnum;
  4. /**
  5. *
  6. * 订单状态
  7. *
  8. * Class OrderStatusEnum
  9. * @package addons\TinyShop\common\enums
  10. * @author qimall
  11. */
  12. class OrderStatusEnum extends BaseEnum
  13. {
  14. /**
  15. * order_status状态说明
  16. * 0 待支付,
  17. * 1 待发货(已付款),
  18. * 2 已发货,
  19. * 3 已收货,
  20. * 4 已完成,
  21. * 6 待自提,
  22. * 7 自提成功,
  23. * -4 已关闭,
  24. * 999 全部,
  25. * ****** 以下状态已删除 ************
  26. * -1 售后申请,
  27. * -2 退款中,
  28. * -3 售后完成,
  29. * -5 撤销申请,
  30. * -6 售后拒绝,
  31. */
  32. const NOT_PAY = 0;
  33. const PAY = 1;
  34. const SHIPMENTS = 2;
  35. const SING = 3;
  36. const ACCOMPLISH = 4;
  37. const REPEAL = -4;
  38. const ALL = 999;
  39. // 自提状态
  40. const TAKE = 6;// 待自提
  41. const TAKE_FINISH = 7;// 自提成功
  42. // 处方药订单 待开方状态(此状态是接口临时状态,数据库不存在此状态)
  43. const PRESCRIPTION_UNOPEN = -20;
  44. // const RETUREN_APPLY = -1;
  45. // const RETUREN_ING = -2;
  46. // const RETUREN = -3;
  47. // const REPEAL_APPLY = -5;
  48. // const RETUREN_REFUSE = -6;
  49. /**
  50. * is_feedback状态说明
  51. * 0 = 未售后
  52. * 1 = 售后中
  53. * 2 = 售后完成
  54. */
  55. const NOT_FEEDBACK = 0;
  56. const FEEDBACKING = 1;
  57. const FEEDBACKED = 2;
  58. /**
  59. * @return array
  60. */
  61. public static function getMap(): array
  62. {
  63. return [
  64. self::NOT_PAY => '待付款',
  65. self::PAY => '待发货', // 已付款
  66. self::SHIPMENTS => '已发货',
  67. self::SING => '已收货',
  68. self::ACCOMPLISH => '已完成',
  69. self::TAKE => '待自提',
  70. self::TAKE_FINISH => '自提成功',
  71. self::REPEAL => '已关闭',
  72. self::ALL => '全部',
  73. ];
  74. }
  75. /**
  76. * @return array
  77. */
  78. public static function getReserveMap($type = ''): array
  79. {
  80. $pay = '已付款';
  81. return [
  82. self::NOT_PAY => '待付款',
  83. self::PAY => $pay, // 已付款
  84. self::SHIPMENTS => '待服务',
  85. self::SING => '待验收',
  86. self::ACCOMPLISH => '已完成',
  87. // self::TAKE => '待自提',
  88. // self::TAKE_FINISH => '自提成功',
  89. self::REPEAL => '已关闭',
  90. self::ALL => '全部',
  91. ];
  92. }
  93. /**
  94. * @return array
  95. */
  96. public static function getFeedbackMap(): array
  97. {
  98. return [
  99. self::NOT_FEEDBACK => '未售后',
  100. self::FEEDBACKING => '售后中',
  101. self::FEEDBACKED => '售后完成',
  102. ];
  103. }
  104. /**
  105. * 开方状态
  106. *
  107. * @return string[]
  108. */
  109. public static function getPrescriptionStatus()
  110. {
  111. return [
  112. self::PRESCRIPTION_UNOPEN => '待开方'
  113. ];
  114. }
  115. /**
  116. * 根据售后步骤维护订单售后状态
  117. * @Author: lun
  118. * @DateTime: 2021/10/12 0012 17:03
  119. * @Copyright: copyright (c) 2021 广东七件事集团
  120. * @param $step_status
  121. * @return int
  122. */
  123. public static function getIsFeedbackStatus($step_status)
  124. {
  125. switch ($step_status) {
  126. case RefundStatusEnum::STEP_4:
  127. case RefundStatusEnum::STEP_6:
  128. case RefundStatusEnum::STEP_11:
  129. $is_feedback = self::FEEDBACKED;
  130. break;
  131. case RefundStatusEnum::STEP_NEGATIVE_1:
  132. $is_feedback = self::NOT_FEEDBACK;
  133. break;
  134. default :
  135. $is_feedback = self::FEEDBACKING;
  136. }
  137. return $is_feedback;
  138. }
  139. /**
  140. * 在售后状态
  141. * @return array
  142. */
  143. public static function refund(): array
  144. {
  145. return [
  146. self::FEEDBACKING,
  147. self::FEEDBACKED,
  148. ];
  149. }
  150. /**
  151. * @return array
  152. */
  153. public static function getBackendMap(): array
  154. {
  155. return [
  156. self::NOT_PAY => '待付款',
  157. self::PAY => '待发货', // 已付款
  158. self::SHIPMENTS => '已发货',
  159. self::SING => '已收货',
  160. self::ACCOMPLISH => '已完成',
  161. self::REPEAL => '已关闭',
  162. // self::RETUREN_ING => '退款中',
  163. ];
  164. }
  165. /**
  166. * 已下单的状态未被关闭的
  167. *
  168. * @return array
  169. */
  170. public static function haveBought()
  171. {
  172. return array_keys([
  173. self::NOT_PAY => '待付款',
  174. self::PAY => '待发货', // 已付款
  175. self::SHIPMENTS => '已发货',
  176. self::SING => '已收货',
  177. self::ACCOMPLISH => '已完成',
  178. ]);
  179. }
  180. public static function common()
  181. {
  182. }
  183. /**
  184. * 获取实物订单所有可能的订单状态
  185. */
  186. public static function getOrderCommonStatus()
  187. {
  188. $status = [
  189. [
  190. 'status_id' => '0',
  191. 'name' => '待付款',
  192. 'is_refund' => 0, // 是否可以申请退款
  193. 'operation' => [
  194. '0' => [
  195. 'no' => 'pay',
  196. 'name' => '线下支付',
  197. 'color' => '#FF9800'
  198. ],
  199. '1' => [
  200. 'no' => 'close',
  201. 'color' => '#E61D1D',
  202. 'name' => '交易关闭'
  203. ],
  204. '2' => [
  205. 'no' => 'adjust_price',
  206. 'color' => '#4CAF50',
  207. 'name' => '修改价格'
  208. ],
  209. '3' => [
  210. 'no' => 'seller_memo',
  211. 'color' => '#666666',
  212. 'name' => '备注'
  213. ]
  214. ],
  215. 'member_operation' => [
  216. '0' => [
  217. 'no' => 'pay',
  218. 'name' => '去支付',
  219. 'color' => '#F15050'
  220. ],
  221. '1' => [
  222. 'no' => 'close',
  223. 'name' => '关闭订单',
  224. 'color' => '#999999'
  225. ]
  226. ]
  227. ],
  228. [
  229. 'status_id' => '1',
  230. 'name' => '待发货',
  231. 'is_refund' => 1,
  232. 'operation' => [
  233. '0' => [
  234. 'no' => 'delivery',
  235. 'color' => 'green',
  236. 'name' => '发货'
  237. ],
  238. '1' => [
  239. 'no' => 'seller_memo',
  240. 'color' => '#666666',
  241. 'name' => '备注'
  242. ],
  243. '2' => [
  244. 'no' => 'update_address',
  245. 'color' => '#51A351',
  246. 'name' => '修改地址'
  247. ]
  248. ],
  249. 'member_operation' => []
  250. ],
  251. [
  252. 'status_id' => '2',
  253. 'name' => '已发货',
  254. 'is_refund' => 1,
  255. 'operation' => [
  256. '0' => [
  257. 'no' => 'seller_memo',
  258. 'color' => '#666666',
  259. 'name' => '备注'
  260. ],
  261. '1' => [
  262. 'no' => 'logistics',
  263. 'color' => '#666666',
  264. 'name' => '查看物流'
  265. ],
  266. '2' => [
  267. 'no' => 'getdelivery',
  268. 'name' => '确认收货',
  269. 'color' => '#FF6600'
  270. ]
  271. ],
  272. 'member_operation' => [
  273. '0' => [
  274. 'no' => 'getdelivery',
  275. 'name' => '确认收货',
  276. 'color' => '#FF6600'
  277. ],
  278. '1' => [
  279. 'no' => 'logistics',
  280. 'color' => '#cccccc',
  281. 'name' => '查看物流'
  282. ]
  283. ]
  284. ],
  285. [
  286. 'status_id' => '3',
  287. 'name' => '已收货',
  288. 'is_refund' => 0,
  289. 'operation' => [
  290. '0' => [
  291. 'no' => 'seller_memo',
  292. 'color' => '#666666',
  293. 'name' => '备注'
  294. ],
  295. '1' => [
  296. 'no' => 'logistics',
  297. 'color' => '#666666',
  298. 'name' => '查看物流'
  299. ]
  300. ],
  301. 'member_operation' => [
  302. '0' => [
  303. 'no' => 'logistics',
  304. 'color' => '#cccccc',
  305. 'name' => '查看物流'
  306. ]
  307. ]
  308. ],
  309. [
  310. 'status_id' => '4',
  311. 'name' => '已完成',
  312. 'is_refund' => 0,
  313. 'operation' => [
  314. '0' => [
  315. 'no' => 'seller_memo',
  316. 'color' => '#666666',
  317. 'name' => '备注'
  318. ],
  319. '1' => [
  320. 'no' => 'logistics',
  321. 'color' => '#666666',
  322. 'name' => '查看物流'
  323. ]
  324. ],
  325. 'member_operation' => [
  326. '0' => [
  327. 'no' => 'logistics',
  328. 'color' => '#cccccc',
  329. 'name' => '查看物流'
  330. ]
  331. ]
  332. ],
  333. [
  334. 'status_id' => '5',
  335. 'name' => '已关闭',
  336. 'is_refund' => 0,
  337. 'operation' => [
  338. '0' => [
  339. 'no' => 'seller_memo',
  340. 'color' => '#666666',
  341. 'name' => '备注'
  342. ],
  343. '1' => [
  344. 'no' => 'delete_order',
  345. 'color' => '#ff0000',
  346. 'name' => '删除订单'
  347. ]
  348. ],
  349. 'member_operation' => [
  350. '0' => [
  351. 'no' => 'delete_order',
  352. 'color' => '#ff0000',
  353. 'name' => '删除订单'
  354. ]
  355. ]
  356. ],
  357. [
  358. 'status_id' => '-1',
  359. 'name' => '退款中',
  360. 'is_refund' => 1,
  361. 'operation' => [
  362. '0' => [
  363. 'no' => 'seller_memo',
  364. 'color' => '#666666',
  365. 'name' => '备注'
  366. ]
  367. ],
  368. 'member_operation' => []
  369. ]
  370. ];
  371. return $status;
  372. }
  373. /**
  374. * 获取实物订单所有可能的订单状态
  375. */
  376. public static function getOrderO2oStatus()
  377. {
  378. $status = [
  379. [
  380. 'status_id' => '0',
  381. 'name' => '待付款',
  382. 'is_refund' => 0, // 是否可以申请退款
  383. 'operation' => [
  384. '0' => [
  385. 'no' => 'pay',
  386. 'name' => '线下支付',
  387. 'color' => '#FF9800'
  388. ],
  389. '1' => [
  390. 'no' => 'close',
  391. 'color' => '#E61D1D',
  392. 'name' => '交易关闭'
  393. ],
  394. '2' => [
  395. 'no' => 'adjust_price',
  396. 'color' => '#4CAF50',
  397. 'name' => '修改价格'
  398. ],
  399. '3' => [
  400. 'no' => 'seller_memo',
  401. 'color' => '#666666',
  402. 'name' => '备注'
  403. ]
  404. ],
  405. 'member_operation' => [
  406. '0' => [
  407. 'no' => 'pay',
  408. 'name' => '去支付',
  409. 'color' => '#F15050'
  410. ],
  411. '1' => [
  412. 'no' => 'close',
  413. 'name' => '关闭订单',
  414. 'color' => '#999999'
  415. ]
  416. ]
  417. ],
  418. [
  419. 'status_id' => '1',
  420. 'name' => '待发货',
  421. 'is_refund' => 1,
  422. 'operation' => [
  423. '0' => [
  424. 'no' => 'o2o_delivery',
  425. 'color' => 'green',
  426. 'name' => '发货'
  427. ],
  428. '1' => [
  429. 'no' => 'seller_memo',
  430. 'color' => '#666666',
  431. 'name' => '备注'
  432. ],
  433. '2' => [
  434. 'no' => 'update_address',
  435. 'color' => '#51A351',
  436. 'name' => '修改地址'
  437. ]
  438. ],
  439. 'member_operation' => []
  440. ],
  441. [
  442. 'status_id' => '2',
  443. 'name' => '已发货',
  444. 'is_refund' => 1,
  445. 'operation' => [
  446. '0' => [
  447. 'no' => 'seller_memo',
  448. 'color' => '#666666',
  449. 'name' => '备注'
  450. ],
  451. '1' => [
  452. 'no' => 'logistics',
  453. 'color' => '#666666',
  454. 'name' => '查看物流'
  455. ],
  456. '2' => [
  457. 'no' => 'getdelivery',
  458. 'name' => '确认收货',
  459. 'color' => '#FF6600'
  460. ]
  461. ],
  462. 'member_operation' => [
  463. '0' => [
  464. 'no' => 'getdelivery',
  465. 'name' => '确认收货',
  466. 'color' => '#FF6600'
  467. ],
  468. '1' => [
  469. 'no' => 'logistics',
  470. 'color' => '#cccccc',
  471. 'name' => '查看物流'
  472. ]
  473. ]
  474. ],
  475. [
  476. 'status_id' => '3',
  477. 'name' => '已收货',
  478. 'is_refund' => 0,
  479. 'operation' => [
  480. '0' => [
  481. 'no' => 'seller_memo',
  482. 'color' => '#666666',
  483. 'name' => '备注'
  484. ],
  485. '1' => [
  486. 'no' => 'logistics',
  487. 'color' => '#666666',
  488. 'name' => '查看物流'
  489. ]
  490. ],
  491. 'member_operation' => [
  492. '0' => [
  493. 'no' => 'logistics',
  494. 'color' => '#cccccc',
  495. 'name' => '查看物流'
  496. ]
  497. ]
  498. ],
  499. [
  500. 'status_id' => '4',
  501. 'name' => '已完成',
  502. 'is_refund' => 0,
  503. 'operation' => [
  504. '0' => [
  505. 'no' => 'seller_memo',
  506. 'color' => '#666666',
  507. 'name' => '备注'
  508. ],
  509. '1' => [
  510. 'no' => 'logistics',
  511. 'color' => '#666666',
  512. 'name' => '查看物流'
  513. ]
  514. ],
  515. 'member_operation' => [
  516. '0' => [
  517. 'no' => 'logistics',
  518. 'color' => '#cccccc',
  519. 'name' => '查看物流'
  520. ]
  521. ]
  522. ],
  523. [
  524. 'status_id' => '5',
  525. 'name' => '已关闭',
  526. 'is_refund' => 0,
  527. 'operation' => [
  528. '0' => [
  529. 'no' => 'seller_memo',
  530. 'color' => '#666666',
  531. 'name' => '备注'
  532. ],
  533. '1' => [
  534. 'no' => 'delete_order',
  535. 'color' => '#ff0000',
  536. 'name' => '删除订单'
  537. ]
  538. ],
  539. 'member_operation' => [
  540. '0' => [
  541. 'no' => 'delete_order',
  542. 'color' => '#ff0000',
  543. 'name' => '删除订单'
  544. ]
  545. ]
  546. ],
  547. [
  548. 'status_id' => '-1',
  549. 'name' => '退款中',
  550. 'is_refund' => 1,
  551. 'operation' => [
  552. '0' => [
  553. 'no' => 'seller_memo',
  554. 'color' => '#666666',
  555. 'name' => '备注'
  556. ]
  557. ],
  558. 'member_operation' => []
  559. ]
  560. ];
  561. return $status;
  562. }
  563. /**
  564. * 获取虚拟订单所有可能的订单状态
  565. */
  566. public static function getVirtualOrderCommonStatus()
  567. {
  568. $status = [
  569. [
  570. 'status_id' => '0',
  571. 'name' => '待付款',
  572. 'is_refund' => 0, // 是否可以申请退款
  573. 'operation' => [
  574. '0' => [
  575. 'no' => 'pay',
  576. 'name' => '线下支付',
  577. 'color' => '#FF9800'
  578. ],
  579. '1' => [
  580. 'no' => 'close',
  581. 'color' => '#E61D1D',
  582. 'name' => '交易关闭'
  583. ],
  584. '2' => [
  585. 'no' => 'adjust_price',
  586. 'color' => '#4CAF50',
  587. 'name' => '修改价格'
  588. ],
  589. '3' => [
  590. 'no' => 'seller_memo',
  591. 'color' => '#666666',
  592. 'name' => '备注'
  593. ]
  594. ],
  595. 'member_operation' => [
  596. '0' => [
  597. 'no' => 'pay',
  598. 'name' => '去支付',
  599. 'color' => '#F15050'
  600. ],
  601. '1' => [
  602. 'no' => 'close',
  603. 'name' => '关闭订单',
  604. 'color' => '#999999'
  605. ]
  606. ]
  607. ],
  608. [
  609. 'status_id' => '6',
  610. 'name' => '已付款',
  611. 'is_refund' => 0,
  612. 'operation' => [
  613. '0' => [
  614. 'no' => 'seller_memo',
  615. 'color' => '#666666',
  616. 'name' => '备注'
  617. ]
  618. ],
  619. 'member_operation' => []
  620. ],
  621. [
  622. 'status_id' => '4',
  623. 'name' => '已完成',
  624. 'is_refund' => 0,
  625. 'operation' => [
  626. '0' => [
  627. 'no' => 'seller_memo',
  628. 'color' => '#666666',
  629. 'name' => '备注'
  630. ]
  631. ],
  632. 'member_operation' => []
  633. ],
  634. [
  635. 'status_id' => '5',
  636. 'name' => '已关闭',
  637. 'is_refund' => 0,
  638. 'operation' => [
  639. '0' => [
  640. 'no' => 'seller_memo',
  641. 'color' => '#666666',
  642. 'name' => '备注'
  643. ],
  644. '1' => [
  645. 'no' => 'delete_order',
  646. 'color' => '#ff0000',
  647. 'name' => '删除订单'
  648. ]
  649. ],
  650. 'member_operation' => [
  651. '0' => [
  652. 'no' => 'delete_order',
  653. 'color' => '#ff0000',
  654. 'name' => '删除订单'
  655. ]
  656. ]
  657. ]
  658. ];
  659. return $status;
  660. }
  661. /**
  662. * 获取自提订单相关状态
  663. */
  664. public static function getSinceOrderStatus()
  665. {
  666. $status = [
  667. [
  668. 'status_id' => '0',
  669. 'name' => '待付款',
  670. 'is_refund' => 0, // 是否可以申请退款
  671. 'operation' => [
  672. '0' => [
  673. 'no' => 'pay',
  674. 'name' => '线下支付',
  675. 'color' => '#FF9800'
  676. ],
  677. '1' => [
  678. 'no' => 'close',
  679. 'color' => '#E61D1D',
  680. 'name' => '交易关闭'
  681. ],
  682. '2' => [
  683. 'no' => 'adjust_price',
  684. 'color' => '#4CAF50',
  685. 'name' => '修改价格'
  686. ],
  687. '3' => [
  688. 'no' => 'seller_memo',
  689. 'color' => '#666666',
  690. 'name' => '备注'
  691. ]
  692. ],
  693. 'member_operation' => [
  694. '0' => [
  695. 'no' => 'pay',
  696. 'name' => '去支付',
  697. 'color' => '#F15050'
  698. ],
  699. '1' => [
  700. 'no' => 'close',
  701. 'name' => '关闭订单',
  702. 'color' => '#999999'
  703. ]
  704. ]
  705. ],
  706. [
  707. 'status_id' => '1',
  708. 'name' => '待提货',
  709. 'is_refund' => 1,
  710. 'operation' => [
  711. '0' => [
  712. 'no' => 'pickup',
  713. 'color' => '#FF9800',
  714. 'name' => '提货'
  715. ],
  716. '1' => [
  717. 'no' => 'seller_memo',
  718. 'color' => '#666666',
  719. 'name' => '备注'
  720. ]
  721. ],
  722. 'member_operation' => [
  723. '0' => [
  724. 'no' => 'member_pickup',
  725. 'color' => '#FF9800',
  726. 'name' => '提货'
  727. ]
  728. ]
  729. ],
  730. [
  731. 'status_id' => '3',
  732. 'name' => '已提货',
  733. 'is_refund' => 0,
  734. 'operation' => [
  735. '0' => [
  736. 'no' => 'seller_memo',
  737. 'color' => '#666666',
  738. 'name' => '备注'
  739. ],
  740. '1' => [
  741. 'no' => 'logistics',
  742. 'color' => '#51A351',
  743. 'name' => '查看物流'
  744. ]
  745. ],
  746. 'member_operation' => []
  747. ],
  748. [
  749. 'status_id' => '4',
  750. 'name' => '已完成',
  751. 'is_refund' => 0,
  752. 'operation' => [
  753. '0' => [
  754. 'no' => 'seller_memo',
  755. 'color' => '#666666',
  756. 'name' => '备注'
  757. ],
  758. '1' => [
  759. 'no' => 'logistics',
  760. 'color' => '#51A351',
  761. 'name' => '查看物流'
  762. ]
  763. ],
  764. 'member_operation' => []
  765. ],
  766. [
  767. 'status_id' => '5',
  768. 'name' => '已关闭',
  769. 'is_refund' => 0,
  770. 'operation' => [
  771. '0' => [
  772. 'no' => 'seller_memo',
  773. 'color' => '#666666',
  774. 'name' => '备注'
  775. ],
  776. '1' => [
  777. 'no' => 'delete_order',
  778. 'color' => '#ff0000',
  779. 'name' => '删除订单'
  780. ]
  781. ],
  782. 'member_operation' => [
  783. '0' => [
  784. 'no' => 'delete_order',
  785. 'color' => '#ff0000',
  786. 'name' => '删除订单'
  787. ]
  788. ]
  789. ],
  790. [
  791. 'status_id' => '-1',
  792. 'name' => '退款中',
  793. 'is_refund' => 1,
  794. 'operation' => [
  795. '0' => [
  796. 'no' => 'seller_memo',
  797. 'color' => '#666666',
  798. 'name' => '备注'
  799. ]
  800. ],
  801. 'member_operation' => []
  802. ]
  803. ];
  804. return $status;
  805. }
  806. /**
  807. * 拼团订单状态
  808. *
  809. * @return array
  810. */
  811. public static function getOrderPintuanStatus()
  812. {
  813. $status = [
  814. [
  815. 'status_id' => '0',
  816. 'name' => '待付款',
  817. 'is_refund' => 0, // 是否可以申请退款
  818. 'operation' => [
  819. '0' => [
  820. 'no' => 'pay',
  821. 'name' => '线下支付',
  822. 'color' => '#FF9800'
  823. ],
  824. '1' => [
  825. 'no' => 'close',
  826. 'color' => '#E61D1D',
  827. 'name' => '交易关闭'
  828. ],
  829. '2' => [
  830. 'no' => 'adjust_price',
  831. 'color' => '#4CAF50',
  832. 'name' => '修改价格'
  833. ],
  834. '3' => [
  835. 'no' => 'seller_memo',
  836. 'color' => '#666666',
  837. 'name' => '备注'
  838. ]
  839. ],
  840. 'member_operation' => [
  841. '0' => [
  842. 'no' => 'pay',
  843. 'name' => '去支付',
  844. 'color' => '#F15050'
  845. ],
  846. '1' => [
  847. 'no' => 'close',
  848. 'name' => '关闭订单',
  849. 'color' => '#999999'
  850. ]
  851. ]
  852. ],
  853. [
  854. 'status_id' => '6',
  855. 'name' => '待成团',
  856. 'is_refund' => 1,
  857. 'operation' => [
  858. '1' => [
  859. 'no' => 'seller_memo',
  860. 'color' => '#666666',
  861. 'name' => '备注'
  862. ],
  863. '2' => [
  864. 'no' => 'update_address',
  865. 'color' => '#51A351',
  866. 'name' => '修改地址'
  867. ]
  868. ],
  869. 'member_operation' => []
  870. ],
  871. [
  872. 'status_id' => '1',
  873. 'name' => '待发货',
  874. 'is_refund' => 1,
  875. 'operation' => [
  876. '0' => [
  877. 'no' => 'delivery',
  878. 'color' => 'green',
  879. 'name' => '发货'
  880. ],
  881. '1' => [
  882. 'no' => 'seller_memo',
  883. 'color' => '#666666',
  884. 'name' => '备注'
  885. ],
  886. '2' => [
  887. 'no' => 'update_address',
  888. 'color' => '#51A351',
  889. 'name' => '修改地址'
  890. ]
  891. ],
  892. 'member_operation' => []
  893. ],
  894. [
  895. 'status_id' => '2',
  896. 'name' => '已发货',
  897. 'is_refund' => 1,
  898. 'operation' => [
  899. '0' => [
  900. 'no' => 'seller_memo',
  901. 'color' => '#666666',
  902. 'name' => '备注'
  903. ],
  904. '1' => [
  905. 'no' => 'logistics',
  906. 'color' => '#666666',
  907. 'name' => '查看物流'
  908. ],
  909. '2' => [
  910. 'no' => 'getdelivery',
  911. 'name' => '确认收货',
  912. 'color' => '#FF6600'
  913. ]
  914. ],
  915. 'member_operation' => [
  916. '0' => [
  917. 'no' => 'getdelivery',
  918. 'name' => '确认收货',
  919. 'color' => '#FF6600'
  920. ],
  921. '1' => [
  922. 'no' => 'logistics',
  923. 'color' => '#cccccc',
  924. 'name' => '查看物流'
  925. ]
  926. ]
  927. ],
  928. [
  929. 'status_id' => '3',
  930. 'name' => '已收货',
  931. 'is_refund' => 0,
  932. 'operation' => [
  933. '0' => [
  934. 'no' => 'seller_memo',
  935. 'color' => '#666666',
  936. 'name' => '备注'
  937. ],
  938. '1' => [
  939. 'no' => 'logistics',
  940. 'color' => '#666666',
  941. 'name' => '查看物流'
  942. ]
  943. ],
  944. 'member_operation' => [
  945. '0' => [
  946. 'no' => 'logistics',
  947. 'color' => '#cccccc',
  948. 'name' => '查看物流'
  949. ]
  950. ]
  951. ],
  952. [
  953. 'status_id' => '4',
  954. 'name' => '已完成',
  955. 'is_refund' => 0,
  956. 'operation' => [
  957. '0' => [
  958. 'no' => 'seller_memo',
  959. 'color' => '#666666',
  960. 'name' => '备注'
  961. ],
  962. '1' => [
  963. 'no' => 'logistics',
  964. 'color' => '#666666',
  965. 'name' => '查看物流'
  966. ]
  967. ],
  968. 'member_operation' => [
  969. '0' => [
  970. 'no' => 'logistics',
  971. 'color' => '#cccccc',
  972. 'name' => '查看物流'
  973. ]
  974. ]
  975. ],
  976. [
  977. 'status_id' => '5',
  978. 'name' => '已关闭',
  979. 'is_refund' => 0,
  980. 'operation' => [
  981. '0' => [
  982. 'no' => 'seller_memo',
  983. 'color' => '#666666',
  984. 'name' => '备注'
  985. ],
  986. '1' => [
  987. 'no' => 'delete_order',
  988. 'color' => '#ff0000',
  989. 'name' => '删除订单'
  990. ]
  991. ],
  992. 'member_operation' => [
  993. '0' => [
  994. 'no' => 'delete_order',
  995. 'color' => '#ff0000',
  996. 'name' => '删除订单'
  997. ]
  998. ]
  999. ],
  1000. [
  1001. 'status_id' => '-1',
  1002. 'name' => '退款中',
  1003. 'is_refund' => 1,
  1004. 'operation' => [
  1005. '0' => [
  1006. 'no' => 'seller_memo',
  1007. 'color' => '#666666',
  1008. 'name' => '备注'
  1009. ]
  1010. ],
  1011. 'member_operation' => []
  1012. ]
  1013. ];
  1014. return $status;
  1015. }
  1016. /**
  1017. * 获取预售操作状态
  1018. */
  1019. public static function getOrderPresellStatus()
  1020. {
  1021. $status = [
  1022. [
  1023. 'status_id' => '6',
  1024. 'name' => '订金待支付',
  1025. 'is_refund' => 0, // 是否可以申请退款
  1026. 'operation' => [
  1027. '0' => [
  1028. 'no' => 'order_presell',
  1029. 'name' => '线下支付',
  1030. 'color' => '#FF9800'
  1031. ],
  1032. '1' => [
  1033. 'no' => 'close',
  1034. 'color' => '#E61D1D',
  1035. 'name' => '交易关闭'
  1036. ],
  1037. ],
  1038. 'member_operation' => [
  1039. '0' => [
  1040. 'no' => 'pay_presell',
  1041. 'name' => '去支付',
  1042. 'color' => '#F15050'
  1043. ],
  1044. '1' => [
  1045. 'no' => 'close',
  1046. 'name' => '关闭订单',
  1047. 'color' => '#999999'
  1048. ]
  1049. ]
  1050. ],
  1051. [
  1052. 'status_id' => '7',
  1053. 'name' => '备货中',
  1054. 'is_refund' => 0, // 是否可以申请退款
  1055. 'operation' => [
  1056. '0' => [
  1057. 'no' => 'stocking_complete',
  1058. 'name' => '备货完成',
  1059. 'color' => '#F15050'
  1060. ],
  1061. ],
  1062. 'member_operation' => [
  1063. ]
  1064. ],
  1065. [
  1066. 'status_id' => '0',
  1067. 'name' => '预售中',
  1068. 'is_refund' => 0, // 是否可以申请退款
  1069. 'operation' => [
  1070. '0' => [
  1071. 'no' => 'pay',
  1072. 'name' => '线下支付',
  1073. 'color' => '#FF9800'
  1074. ],
  1075. '1' => [
  1076. 'no' => 'close',
  1077. 'color' => '#E61D1D',
  1078. 'name' => '交易关闭'
  1079. ],
  1080. '2' => [
  1081. 'no' => 'adjust_price',
  1082. 'color' => '#4CAF50',
  1083. 'name' => '修改价格'
  1084. ],
  1085. '3' => [
  1086. 'no' => 'seller_memo',
  1087. 'color' => '#666666',
  1088. 'name' => '备注'
  1089. ]
  1090. ],
  1091. 'member_operation' => [
  1092. '0' => [
  1093. 'no' => 'pay',
  1094. 'name' => '去支付',
  1095. 'color' => '#F15050'
  1096. ],
  1097. '1' => [
  1098. 'no' => 'close',
  1099. 'name' => '关闭订单',
  1100. 'color' => '#999999'
  1101. ]
  1102. ]
  1103. ],
  1104. [
  1105. 'status_id' => '1',
  1106. 'name' => '待发货',
  1107. 'is_refund' => 1,
  1108. 'operation' => [
  1109. '0' => [
  1110. 'no' => 'delivery',
  1111. 'color' => 'green',
  1112. 'name' => '发货'
  1113. ],
  1114. '1' => [
  1115. 'no' => 'seller_memo',
  1116. 'color' => '#666666',
  1117. 'name' => '备注'
  1118. ],
  1119. '2' => [
  1120. 'no' => 'update_address',
  1121. 'color' => '#51A351',
  1122. 'name' => '修改地址'
  1123. ]
  1124. ],
  1125. 'member_operation' => []
  1126. ],
  1127. [
  1128. 'status_id' => '2',
  1129. 'name' => '已发货',
  1130. 'is_refund' => 1,
  1131. 'operation' => [
  1132. '0' => [
  1133. 'no' => 'seller_memo',
  1134. 'color' => '#666666',
  1135. 'name' => '备注'
  1136. ],
  1137. '1' => [
  1138. 'no' => 'logistics',
  1139. 'color' => '#666666',
  1140. 'name' => '查看物流'
  1141. ],
  1142. '2' => [
  1143. 'no' => 'getdelivery',
  1144. 'name' => '确认收货',
  1145. 'color' => '#FF6600'
  1146. ]
  1147. ],
  1148. 'member_operation' => [
  1149. '0' => [
  1150. 'no' => 'getdelivery',
  1151. 'name' => '确认收货',
  1152. 'color' => '#FF6600'
  1153. ],
  1154. '1' => [
  1155. 'no' => 'logistics',
  1156. 'color' => '#cccccc',
  1157. 'name' => '查看物流'
  1158. ]
  1159. ]
  1160. ],
  1161. [
  1162. 'status_id' => '3',
  1163. 'name' => '已收货',
  1164. 'is_refund' => 0,
  1165. 'operation' => [
  1166. '0' => [
  1167. 'no' => 'seller_memo',
  1168. 'color' => '#666666',
  1169. 'name' => '备注'
  1170. ],
  1171. '1' => [
  1172. 'no' => 'logistics',
  1173. 'color' => '#666666',
  1174. 'name' => '查看物流'
  1175. ]
  1176. ],
  1177. 'member_operation' => [
  1178. '0' => [
  1179. 'no' => 'logistics',
  1180. 'color' => '#cccccc',
  1181. 'name' => '查看物流'
  1182. ]
  1183. ]
  1184. ],
  1185. [
  1186. 'status_id' => '4',
  1187. 'name' => '已完成',
  1188. 'is_refund' => 0,
  1189. 'operation' => [
  1190. '0' => [
  1191. 'no' => 'seller_memo',
  1192. 'color' => '#666666',
  1193. 'name' => '备注'
  1194. ],
  1195. '1' => [
  1196. 'no' => 'logistics',
  1197. 'color' => '#666666',
  1198. 'name' => '查看物流'
  1199. ]
  1200. ],
  1201. 'member_operation' => [
  1202. '0' => [
  1203. 'no' => 'logistics',
  1204. 'color' => '#cccccc',
  1205. 'name' => '查看物流'
  1206. ]
  1207. ]
  1208. ],
  1209. [
  1210. 'status_id' => '5',
  1211. 'name' => '已关闭',
  1212. 'is_refund' => 0,
  1213. 'operation' => [
  1214. '0' => [
  1215. 'no' => 'seller_memo',
  1216. 'color' => '#666666',
  1217. 'name' => '备注'
  1218. ],
  1219. '1' => [
  1220. 'no' => 'delete_order',
  1221. 'color' => '#ff0000',
  1222. 'name' => '删除订单'
  1223. ]
  1224. ],
  1225. 'member_operation' => [
  1226. '0' => [
  1227. 'no' => 'delete_order',
  1228. 'color' => '#ff0000',
  1229. 'name' => '删除订单'
  1230. ]
  1231. ]
  1232. ],
  1233. [
  1234. 'status_id' => '-1',
  1235. 'name' => '退款中',
  1236. 'is_refund' => 1,
  1237. 'operation' => [
  1238. '0' => [
  1239. 'no' => 'seller_memo',
  1240. 'color' => '#666666',
  1241. 'name' => '备注'
  1242. ]
  1243. ],
  1244. 'member_operation' => []
  1245. ]
  1246. ];
  1247. return $status;
  1248. }
  1249. /**
  1250. * 公用未支付状态
  1251. */
  1252. protected function commonNoPayStatus()
  1253. {
  1254. return [
  1255. 'name' => '待付款',
  1256. 'is_refund' => 0, // 是否可以申请退款
  1257. 'operation' => [
  1258. '0' => [
  1259. 'no' => 'pay',
  1260. 'name' => '线下支付',
  1261. 'color' => '#FF9800'
  1262. ],
  1263. '1' => [
  1264. 'no' => 'close',
  1265. 'color' => '#E61D1D',
  1266. 'name' => '交易关闭'
  1267. ],
  1268. '2' => [
  1269. 'no' => 'adjust_price',
  1270. 'color' => '#4CAF50',
  1271. 'name' => '修改价格'
  1272. ],
  1273. '3' => [
  1274. 'no' => 'seller_memo',
  1275. 'color' => '#666666',
  1276. 'name' => '备注'
  1277. ]
  1278. ],
  1279. 'member_operation' => [
  1280. '0' => [
  1281. 'no' => 'pay',
  1282. 'name' => '去支付',
  1283. 'color' => '#F15050'
  1284. ],
  1285. '1' => [
  1286. 'no' => 'close',
  1287. 'name' => '关闭订单',
  1288. 'color' => '#999999'
  1289. ]
  1290. ]
  1291. ];
  1292. }
  1293. /**
  1294. * 订单状态追踪
  1295. * @return \string[][]
  1296. */
  1297. public static function setpArrMap($order_status)
  1298. {
  1299. switch ($order_status) {
  1300. case self::REPEAL :
  1301. $setpArr = [
  1302. [
  1303. 'title' => '买家下单',
  1304. 'field' => 'created_at',
  1305. ],
  1306. [
  1307. 'title' => '交易关闭',
  1308. 'field' => 'close_time',
  1309. ],
  1310. ];
  1311. break;
  1312. case -99:
  1313. $setpArr = [
  1314. [
  1315. 'title' => '买家下单',
  1316. 'field' => 'created_at',
  1317. ],
  1318. [
  1319. 'title' => '买家付款',
  1320. 'field' => 'pay_time',
  1321. ],
  1322. [
  1323. 'title' => '买家支付定金',
  1324. 'field' => 'deposite_pay_time',
  1325. ],
  1326. [
  1327. 'title' => '买家支付尾款',
  1328. 'field' => 'final_payment_time',
  1329. ],
  1330. [
  1331. 'title' => '交易完成',
  1332. 'field' => 'finish_time',
  1333. ],
  1334. ];
  1335. break;
  1336. default :
  1337. $setpArr = [
  1338. [
  1339. 'title' => '买家下单',
  1340. 'field' => 'created_at',
  1341. ],
  1342. [
  1343. 'title' => '买家付款',
  1344. 'field' => 'pay_time',
  1345. ],
  1346. [
  1347. 'title' => '买家支付定金',
  1348. 'field' => 'deposite_pay_time',
  1349. ],
  1350. [
  1351. 'title' => '买家支付尾款',
  1352. 'field' => 'final_payment_time',
  1353. ],
  1354. [
  1355. 'title' => '商家发货',
  1356. 'field' => 'consign_time',
  1357. ],
  1358. [
  1359. 'title' => '交易完成',
  1360. 'field' => 'finish_time',
  1361. ],
  1362. ];
  1363. }
  1364. return $setpArr;
  1365. }
  1366. /**
  1367. * 接口状态文字返回
  1368. * @Author: lun
  1369. * @DateTime: 2022/5/11 0011 10:42
  1370. * @Copyright: copyright (c) 2021 广东七件事集团
  1371. * @param $status
  1372. * @param $shipping_type
  1373. */
  1374. public static function getApiStatus($status, $shipping_type = 1)
  1375. {
  1376. switch ($status) {
  1377. case self::NOT_PAY:
  1378. $title = '待付款';
  1379. $desc = '分钟后订单自动关闭';
  1380. break;
  1381. case self::PAY:
  1382. $title = '待发货';
  1383. $desc = '买家已付款';
  1384. break;
  1385. case self::TAKE:
  1386. $title = '待自提';
  1387. $desc = '门店已备货,建议您尽快提货';
  1388. break;
  1389. case self::SHIPMENTS:
  1390. $title = '已发货';
  1391. $desc = '天后自动收货';
  1392. break;
  1393. case self::SING:
  1394. $title = '已收货';
  1395. $desc = '买家已收货';
  1396. break;
  1397. case self::TAKE_FINISH:
  1398. $title = '提货成功';
  1399. $desc = '订单提货已成功';
  1400. break;
  1401. case self::ACCOMPLISH:
  1402. $title = '已完成';
  1403. $desc = '交易已完成';
  1404. break;
  1405. case self::REPEAL:
  1406. $title = '已关闭';
  1407. $desc = '交易已关闭';
  1408. break;
  1409. }
  1410. return compact('title','desc');
  1411. }
  1412. }