|
|
@@ -196,6 +196,19 @@ class PurchaseOrderClass extends BaseClass
|
|
|
$product->cost = $unitCost;
|
|
|
$product->priceLabel = ProductClass::PRICE_LABEL_AUTO;
|
|
|
$product->save();
|
|
|
+
|
|
|
+ //其它门店的成本价也要一起改掉
|
|
|
+ $allShop = ShopClass::getAllByCondition(['sjId' => $sjId], null, '*', null, true);
|
|
|
+ if (!empty($allShop)) {
|
|
|
+ $currentItemId = $product->itemId ?? 0;
|
|
|
+ foreach ($allShop as $currentShop) {
|
|
|
+ $currentId = $currentShop->id ?? 0;
|
|
|
+ if ($currentId == $shopId) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ ProductClass::updateByCondition(['shopId' => $currentId, 'itemId' => $currentItemId], ['cost' => $unitCost]);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//写入详情表
|