|
|
@@ -10,6 +10,7 @@ use biz\shop\services\ShopService;
|
|
|
use bizGhs\base\classes\BaseClass;
|
|
|
use bizGhs\item\classes\ItemClass;
|
|
|
use bizGhs\item\classes\ItemClassClass;
|
|
|
+use bizGhs\merchant\classes\ShopClass;
|
|
|
use bizGhs\order\traits\OrderTrait;
|
|
|
use common\components\imgUtil;
|
|
|
use common\components\stringUtil;
|
|
|
@@ -499,7 +500,25 @@ class ProductClass extends BaseClass
|
|
|
//修改价格 linqh 2021.1.28
|
|
|
public static function changePrice($id, $shopId, $price, $priceLabel)
|
|
|
{
|
|
|
+ //2021.7.6 linqh 首店改价,暂时同步到各个分店
|
|
|
+ //判断是否首店
|
|
|
+ $shopInfo = ShopClass::getById($shopId);
|
|
|
$res = ProductClass::updateByCondition(['id' => $id, 'shopId' => $shopId], ['price' => $price, 'priceLabel' => $priceLabel]);
|
|
|
+ $productData = ProductClass::getById($id);
|
|
|
+ $itemId = $productData['itemId'];
|
|
|
+ if($shopInfo['default']==1){
|
|
|
+ //首店
|
|
|
+ $sjId = $shopInfo['sjId'];
|
|
|
+ $shopAll = ShopClass::getAllShop($sjId);
|
|
|
+ if($shopAll){
|
|
|
+ foreach ($shopAll as $s){
|
|
|
+ if($s['id'] != $shopId){
|
|
|
+ ProductClass::updateByCondition(['itemId' => $itemId, 'shopId' => $s['id']], ['price' => $price, 'priceLabel' => $priceLabel]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
return $res;
|
|
|
}
|
|
|
|