wupengfei %!s(int64=2) %!d(string=hai) anos
pai
achega
4c33dd0189

+ 4 - 1
application/common/model/OfflineOrder.php

@@ -5,5 +5,8 @@ use think\Model;
 class OfflineOrder extends Model
 {
 
-
+    public function orderItem()
+    {
+        return  $this->hasMany('OfflineOrderItem','order_id');
+    }
 }

+ 1 - 4
application/common/model/OfflineOrderRefund.php

@@ -5,8 +5,5 @@ use think\Model;
 class OfflineOrderRefund extends Model
 {
 
-    public function orderItem()
-    {
-        return  $this->hasMany('OfflineOrderItem','order_id');
-    }
+
 }

+ 1 - 2
application/common/service/PurchaseLogic.php

@@ -290,8 +290,7 @@ class PurchaseLogic
     public static function offlineOrderRefund($order_id,$reason)
     {
         $ret = ['code'=>200,'msg'=>'ok'];
-        $order_info = OfflineOrderRefund::with('orderItem')->where('id',$order_id)->find()->toArray();
-        var_dump($order_info);
+        $order_info = OfflineOrder::with('orderItem')->where('id',$order_id)->find()->toArray();
         if(in_array($order_info['refund_status'],[1,2])) return ['code'=>201,'订单已申请退款'];
         Db::startTrans();
         try {