Parcourir la source

fix bug: 添加花材接口报错修复

shizhongqi il y a 5 mois
Parent
commit
96752580c6
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      biz-ghs/product/classes/ProductClass.php

+ 1 - 1
biz-ghs/product/classes/ProductClass.php

@@ -2410,7 +2410,7 @@ class ProductClass extends BaseClass
             $smallUnitId = $data['smallUnitId'] ?? 0;
 
             $changeUnit = 0;
-            if ($ptItemInfo->bigUnitId != $bigUnitId || $ptItemInfo->smallUnitId != $smallUnitId || $ptItemInfo->ratio != $ratio) {
+            if ($ptItemInfo !== null && ($ptItemInfo->bigUnitId != $bigUnitId || $ptItemInfo->smallUnitId != $smallUnitId || $ptItemInfo->ratio != $ratio)) {
                 //如果被修改了单位,则重新创建花材
                 $changeUnit = 1;
             }