Jelajahi Sumber

Merge branch 'redesign‌-260706' into dev

shish 2 hari lalu
induk
melakukan
cc5a75194f
1 mengubah file dengan 2 tambahan dan 7 penghapusan
  1. 2 7
      biz-hd/custom/observers/BuyAmountObserver.php

+ 2 - 7
biz-hd/custom/observers/BuyAmountObserver.php

@@ -91,14 +91,9 @@ class BuyAmountObserver extends Behavior
             if (empty($mainId)) {
                 throw new \Exception('mainId is required');
             }
-            $model->mainId = $mainId;
-            $model->save();
+            $model::updateAll(['mainId' => $mainId], ['id' => $model->getPrimaryKey()]);
             $hdId = $model->hdId ?? 0;
-            $hdInfo = HdClass::getById($hdId, true);
-            if(!empty($hdInfo)){
-                $hdInfo->mainId = $mainId;
-                $hdInfo->save();
-            }
+            HdClass::updateById($hdId, ['mainId' => $mainId]);
         }
 
         $memberData = CustomClass::getCustomExpenseLevel($newGrowth, $mainId); // 设置等级多处需要同步修改的,请搜索:getCustomExpenseLevel