Pārlūkot izejas kodu

订单逻辑中的事物回滚未加

whitefang 1 gadu atpakaļ
vecāks
revīzija
dffb8b6384
1 mainītis faili ar 6 papildinājumiem un 0 dzēšanām
  1. 6 0
      app/api/logic/ServiceOrderLogic.php

+ 6 - 0
app/api/logic/ServiceOrderLogic.php

@@ -758,6 +758,7 @@ class ServiceOrderLogic extends BaseLogic
             }
             }
         }
         }
         catch (\Exception $e) {
         catch (\Exception $e) {
+            Db::rollback();
             self::setError($e->getMessage());
             self::setError($e->getMessage());
             return false;
             return false;
         }
         }
@@ -799,6 +800,7 @@ class ServiceOrderLogic extends BaseLogic
             Db::commit();
             Db::commit();
         }
         }
         catch (\Exception $e) {
         catch (\Exception $e) {
+            Db::rollback();
             self::setError($e->getMessage());
             self::setError($e->getMessage());
             return false;
             return false;
         }
         }
@@ -854,6 +856,7 @@ class ServiceOrderLogic extends BaseLogic
             Db::commit();
             Db::commit();
         }
         }
         catch (\Exception $e) {
         catch (\Exception $e) {
+            Db::rollback();
             self::setError($e->getMessage());
             self::setError($e->getMessage());
             return false;
             return false;
         }
         }
@@ -878,6 +881,7 @@ class ServiceOrderLogic extends BaseLogic
             Db::commit();
             Db::commit();
         }
         }
         catch (\Exception $e) {
         catch (\Exception $e) {
+            Db::rollback();
             self::setError($e->getMessage());
             self::setError($e->getMessage());
             return false;
             return false;
         }
         }
@@ -913,6 +917,7 @@ class ServiceOrderLogic extends BaseLogic
             Db::commit();
             Db::commit();
         }
         }
         catch (\Exception $e) {
         catch (\Exception $e) {
+            Db::rollback();
             self::setError($e->getMessage());
             self::setError($e->getMessage());
             return false;
             return false;
         }
         }
@@ -971,6 +976,7 @@ class ServiceOrderLogic extends BaseLogic
             Db::commit();
             Db::commit();
         }
         }
         catch (\Exception $e) {
         catch (\Exception $e) {
+            Db::rollback();
             self::setError($e->getMessage());
             self::setError($e->getMessage());
             return false;
             return false;
         }
         }