xieruidong 2 vuotta sitten
vanhempi
commit
866038261b
3 muutettua tiedostoa jossa 265 lisäystä ja 425 poistoa
  1. 35 0
      application/api/controller/mall/OrderRefund.php
  2. 17 0
      application/common/model/Refund.php
  3. 213 425
      public/api.html

+ 35 - 0
application/api/controller/mall/OrderRefund.php

@@ -0,0 +1,35 @@
+<?php
+
+namespace app\api\controller\mall;
+
+use app\common\controller\Api;
+use app\common\model\OrderInfo;
+use app\common\model\OrderVoucher;
+use app\common\model\Refund;
+use app\common\service\OrderService;
+use fast\Arr;
+use think\Db;
+use app\common\model\Orders as Order;
+
+/**
+ * 订单退款
+ * @inheritdoc
+ */
+class OrderRefund extends Api
+{
+    protected $noNeedRight = "*";
+
+    /**
+     * 退款退货配置
+     * @ApiMethod (POST)
+     * @ApiReturnParams (name=reason,description=)
+     */
+    public function config()
+    {
+        $info=[
+            'reason'=>array_values(Refund::getReasons()),
+            'type'=>1
+        ];
+        $this->success('', $info);
+    }
+}

+ 17 - 0
application/common/model/Refund.php

@@ -43,6 +43,23 @@ class Refund Extends Model
     ];
     public static $refundTypeGoods=[self::REFUND_TYPE_ALL,self::REFUND_TYPE_GOODS];
     public static $refundTypeMoney=[self::REFUND_TYPE_MONEY,self::REFUND_TYPE_ALL];
+    public static $reasons=[
+        1=>'质量问题',
+        2=>'卖家发错货',
+    ];
+
+    /**
+     * @return string[]
+     */
+    public static function getReasons(): array
+    {
+        $reasons=self::$reasons;
+        $arr=[];
+        foreach ($reasons as $key=>$value){
+            $arr[$key]=compact('key','value');
+        }
+        return $arr;
+    }
 
     /**
      * @return string[]

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 213 - 425
public/api.html


Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä