فهرست منبع

已经添加过了

shish 5 سال پیش
والد
کامیت
0394a8cd19
1فایلهای تغییر یافته به همراه5 افزوده شده و 0 حذف شده
  1. 5 0
      biz-ghs/product/classes/ProductClass.php

+ 5 - 0
biz-ghs/product/classes/ProductClass.php

@@ -999,6 +999,11 @@ class ProductClass extends BaseClass
             if (isset($data['itemId']) == false || empty($data['itemId'])) {
                 $ptItemInfo = PtItemClass::addItem($itemData);
                 $data['itemId'] = $ptItemInfo['id'];
+            } else {
+                $has = self::getByCondition(['itemId' => $data['itemId']], true);
+                if (!empty($has)) {
+                    util::fail('已经添加过了');
+                }
             }
 
             $data['price'] = $data['cost'] + $data['addPrice'];