Parcourir la source

拆单+打印

gorden il y a 5 mois
Parent
commit
86bd1ce90a
1 fichiers modifiés avec 5 ajouts et 4 suppressions
  1. 5 4
      app/admin/controller/order/WholeController.php

+ 5 - 4
app/admin/controller/order/WholeController.php

@@ -3994,10 +3994,6 @@ class WholeController extends Curd
 
             Db::commit();
 
-            // 打印核销小票
-            foreach ($appointmentIds as $id) {
-                $this->doPrinterWriterOff($id);
-            }
 
             _syslog("订单", "核销成功");
             return json_success('核销成功');
@@ -4006,6 +4002,11 @@ class WholeController extends Curd
             Db::rollBack();
             _syslog("订单", "核销失败");
             return json_fail('核销失败');
+        } finally {
+            // 打印核销小票
+            foreach ($appointmentIds as $id) {
+                $this->doPrinterWriterOff($id);
+            }
         }
     }