xieruidong il y a 2 ans
Parent
commit
eefea63ad0

+ 1 - 1
application/api/controller/mall/OrderRefund.php

@@ -28,7 +28,7 @@ class OrderRefund extends Api
     {
         $info=[
             'reason'=>array_values(Refund::getReasons()),
-            'type'=>1
+            'type'=>array_values(Refund::getGoodsTypes()),
         ];
         $this->success('', $info);
     }

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

@@ -47,6 +47,10 @@ class Refund Extends Model
         1=>'质量问题',
         2=>'卖家发错货',
     ];
+    public static $goodsTypes=[
+        1=>'质量问题',
+        2=>'卖家发错货',
+    ];
 
     /**
      * @return string[]
@@ -60,6 +64,18 @@ class Refund Extends Model
         }
         return $arr;
     }
+    /**
+     * @return string[]
+     */
+    public static function getGoodsTypes(): array
+    {
+        $obj=self::$goodsTypes;
+        $arr=[];
+        foreach ($obj as $key=>$value){
+            $arr[$key]=compact('key','value');
+        }
+        return $arr;
+    }
 
     /**
      * @return string[]