wupengfei 2 jaren geleden
bovenliggende
commit
7a4dc9a4dc

+ 19 - 3
application/common/service/PurchaseLogic.php

@@ -181,7 +181,7 @@ class PurchaseLogic
     public static function auditSupplierRefund($order_id,$sh_status,$remark)
     {
         $order_info = SupplierOrder::with('orderItem')->where('id',$order_id)->find()->toArray();
-        if(in_array($order_info['refund_status'],[2])) return ['code'=>201,'订单已退款,请勿重新审核'];
+        if(in_array($order_info['refund_status'],[2])) return ['code'=>201,'msg'=>'订单已退款,请勿重新审核'];
         Db::startTrans();
         try {
             SupplierOrder::where('id',$order_id)->update(['refund_status'=>$sh_status + 1]);// 订单退款状态
@@ -200,7 +200,7 @@ class PurchaseLogic
     public static function depotRefund($order_id)
     {
         $order_info = SupplierOrder::with('orderItem')->where('id',$order_id)->find()->toArray();
-        if(in_array($order_info['refund_status'],[4])) return ['code'=>201,'已出库,请勿重新出库'];
+        if(in_array($order_info['refund_status'],[4])) return ['code'=>201,'msg'=>'已出库,请勿重新出库'];
         Db::startTrans();
         try {
             list($depot_info,$stock_info) = [[],[]];
@@ -313,6 +313,22 @@ class PurchaseLogic
         return $ret;
     }
 
-
+   // 线下订单退款申请审核
+    public static function auditOfflineRefund($order_id,$sh_status,$remark)
+    {
+        $order_info = OfflineOrder::with('orderItem')->where('id',$order_id)->find()->toArray();
+        if(in_array($order_info['refund_status'],[2])) return ['code'=>201,'msg'=>'订单已退款,请勿重新审核'];
+        Db::startTrans();
+        try {
+            OfflineOrder::where('id',$order_id)->update(['refund_status'=>$sh_status + 1]);// 订单退款状态
+            OfflineOrderRefund::where('order_id',$order_id)->update(['sh_status'=>$sh_status,'remark'=>$remark,'sh_time'=>date('Y-m-d H:i:s')]);// 退款记录
+            Db::commit();
+        }catch (\Exception $e){
+            self::$ret['code'] = 201;
+            self::$ret['msg'] = $e->getMessage();
+            Db::rollback();
+        }
+        return  self::$ret;
+    }
 
 }

+ 0 - 2
application/purchase/view/offline_order_refund/index.html

@@ -28,13 +28,11 @@
                 <div class="inline-block">
                     订单ID: {$vo.order_id|default=''}<br/>
                     订单号:{$vo.order_num|default=''}<br/>
-                    供货商:{$supplier[$vo.supplier_id]|default='--'}
                 </div>
             </td>
             <td class='text-left nowrap'>
                 <div class="inline-block">
                     账号:{$admin_arr[$vo.employee_user]|default=''}<br/>
-                    销售:{$supplier[$vo.supplier_id]|default='--'}<br/>
                     电话:{$vo.phone|default='--'}
                 </div>
             </td>