|
|
@@ -17,6 +17,7 @@ use bizGhs\merchant\classes\ShopClass;
|
|
|
use bizGhs\order\classes\CheckOrderClass;
|
|
|
use bizGhs\order\classes\CheckOrderItemClass;
|
|
|
use bizGhs\order\traits\OrderTrait;
|
|
|
+use bizGhs\shop\classes\ShopAdminClass;
|
|
|
use bizGhs\stock\classes\StockRecordClass;
|
|
|
use bizGhs\stock\services\StockRecordService;
|
|
|
use common\components\dict;
|
|
|
@@ -905,14 +906,19 @@ class ProductClass extends BaseClass
|
|
|
$currentSkPrice = bcadd($price, $data['skMore'], 2);
|
|
|
}
|
|
|
|
|
|
+ $staffId = $data['staffId'] ?? 0;
|
|
|
+ $staffName = $data['staffName'] ?? '';
|
|
|
+ $adminId = $data['adminId'] ?? 0;
|
|
|
+ $changeParams = ['staffId' => $staffId, 'staffName' => $staffName];
|
|
|
+
|
|
|
if ($price != $product->price) {
|
|
|
//花店价有变化
|
|
|
- self::changeSinglePrice($shop, $ptItemId, $price, $currentSkPrice);
|
|
|
+ self::changeSinglePrice($shop, $ptItemId, $price, $currentSkPrice, $changeParams);
|
|
|
unset($upData['price']);
|
|
|
} else {
|
|
|
//花店价没有变化,但散客价比花店价贵多少有修改时,也要改价
|
|
|
if (isset($data['skMore']) && is_numeric($data['skMore']) && $data['skMore'] != $product->skMore) {
|
|
|
- self::changeSinglePrice($shop, $ptItemId, $price, $currentSkPrice);
|
|
|
+ self::changeSinglePrice($shop, $ptItemId, $price, $currentSkPrice, $changeParams);
|
|
|
unset($upData['price']);
|
|
|
}
|
|
|
}
|
|
|
@@ -938,6 +944,11 @@ class ProductClass extends BaseClass
|
|
|
unset($params['status']);
|
|
|
unset($params['delStatus']);
|
|
|
|
|
|
+ $staff = ShopAdminClass::getByCondition(['mainId' => $chainMainId, 'adminId' => $adminId], true);
|
|
|
+ $staffId = $staff->id ?? 0;
|
|
|
+ $staffName = $staff->name ?? '';
|
|
|
+ $changeParams = ['staffId' => $staffId, 'staffName' => $staffName];
|
|
|
+
|
|
|
//如果有同步分类则移动,没有则不移动
|
|
|
if (isset($params['classId'])) {
|
|
|
$masterClassId = $params['classId'];
|
|
|
@@ -960,12 +971,12 @@ class ProductClass extends BaseClass
|
|
|
}
|
|
|
if ($price != $chainProduct->price) {
|
|
|
//花店价有变化
|
|
|
- self::changeSinglePrice($chainShop, $ptItemId, $price, $currentSkPrice);
|
|
|
+ self::changeSinglePrice($chainShop, $ptItemId, $price, $currentSkPrice, $changeParams);
|
|
|
unset($params['price']);
|
|
|
} else {
|
|
|
//花店价没有变化,但散客价比花店价贵多少有修改时,也要改价
|
|
|
if (isset($data['skMore']) && is_numeric($data['skMore']) && $data['skMore'] != $chainProduct->skMore) {
|
|
|
- self::changeSinglePrice($chainShop, $ptItemId, $price, $currentSkPrice);
|
|
|
+ self::changeSinglePrice($chainShop, $ptItemId, $price, $currentSkPrice, $changeParams);
|
|
|
unset($params['price']);
|
|
|
}
|
|
|
}
|