|
|
@@ -1522,9 +1522,12 @@ class ProductClass extends BaseClass
|
|
|
}
|
|
|
$cost = $data['cost'] ?? 0;
|
|
|
$price = $data['price'] ?? 0;
|
|
|
+ $price = floatval($price);
|
|
|
$skPrice = $data['skPrice'] ?? 0;
|
|
|
+ $skPrice = floatval($skPrice);
|
|
|
$hjPrice = $data['hjPrice'] ?? 0;
|
|
|
- if (is_numeric($price) == false || $price <= 0) {
|
|
|
+ $hjPrice = floatval($hjPrice);
|
|
|
+ if (!is_numeric($price) || $price <= 0) {
|
|
|
util::fail('请填写价格');
|
|
|
}
|
|
|
if ($hjPrice > $price) {
|
|
|
@@ -1546,7 +1549,7 @@ class ProductClass extends BaseClass
|
|
|
if ($shop->default == 0 && $shop->join == 0) {
|
|
|
|
|
|
//除了小蔡鲜花的蔡总、郑总,其他人直营分店不能改价格,多处要同步修改,关键词d_price_change
|
|
|
- if(!in_array($adminId,[35725,23659])){
|
|
|
+ if (!in_array($adminId, [35725, 23659])) {
|
|
|
util::fail('直营店不能改价哦');
|
|
|
}
|
|
|
|
|
|
@@ -1650,12 +1653,25 @@ class ProductClass extends BaseClass
|
|
|
$staffName = $data['staffName'] ?? '';
|
|
|
$changeParams = ['staffId' => $staffId, 'staffName' => $staffName];
|
|
|
|
|
|
- if ($price != $product->price || $skPrice != $product->skPrice || $hjPrice != $product->hjPrice) {
|
|
|
- //批发价有变化
|
|
|
+ if ($price != floatval($product->price) || $skPrice != floatval($product->skPrice) || $hjPrice != floatval($product->hjPrice)) {
|
|
|
+
|
|
|
self::changeSinglePrice($shop, $ptItemId, $price, $skPrice, $hjPrice, $changeParams);
|
|
|
unset($upData['price']);
|
|
|
unset($upData['skPrice']);
|
|
|
unset($upData['hjPrice']);
|
|
|
+
|
|
|
+ if (!empty($mainId)) {
|
|
|
+ //提醒零售收银台界面要刷新,多处要修改,关键词 modify_price_remind_cashier
|
|
|
+ $staffList = ShopAdminClass::getAllByCondition(['mainId' => $mainId], null, '*', null, true);
|
|
|
+ if (!empty($staffList)) {
|
|
|
+ foreach ($staffList as $staff) {
|
|
|
+ $staffId = $staff->id ?? 0;
|
|
|
+ Yii::$app->redis->executeCommand('SET', ['cashier_' . $mainId . '_' . $staffId . '_may_refresh', 'yes']);
|
|
|
+ Yii::$app->redis->executeCommand('SET', ['ghs_cashier_' . $mainId . '_' . $staffId . '_may_refresh', 'yes']);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
if ($cost != $product->cost) {
|
|
|
@@ -1979,7 +1995,7 @@ class ProductClass extends BaseClass
|
|
|
//补className
|
|
|
public static function groupClassName($mainId, $data)
|
|
|
{
|
|
|
- $classNameMap = ItemClassClass::getAllByCondition(['mainId'=>$mainId],null,'id,name','id');
|
|
|
+ $classNameMap = ItemClassClass::getAllByCondition(['mainId' => $mainId], null, 'id,name', 'id');
|
|
|
foreach ($data as $k => $v) {
|
|
|
$classId = $v['classId'];
|
|
|
$className = isset($classNameMap[$classId]) && isset($classNameMap[$classId]['name']) ? $classNameMap[$classId]['name'] : '';
|