|
|
@@ -200,7 +200,27 @@ class ProductController extends BaseController
|
|
|
if (isset($product['shopId']) == false || $product['shopId'] != $shopId) {
|
|
|
util::fail('没有权限访问');
|
|
|
}
|
|
|
- $original = ProductClass::getById($id, true);
|
|
|
+ $original = ProductClass::getById($id);
|
|
|
+ if (isset($original['discountPrice']) && $original['discountPrice'] > 0) {
|
|
|
+ $discountPrice = $original['discountPrice'];
|
|
|
+ $original['price'] = floatval($discountPrice);
|
|
|
+
|
|
|
+ $addPrice = $original['addPrice'] ?? 0;
|
|
|
+ $qtAddPrice = $original['qtAddPrice'] ?? 0;
|
|
|
+ $byAddPrice = $original['byAddPrice'] ?? 0;
|
|
|
+ $hjAddPrice = $original['hjAddPrice'] ?? 0;
|
|
|
+ $zsAddPrice = $original['zsAddPrice'] ?? 0;
|
|
|
+
|
|
|
+ $qt = bcsub($addPrice, $qtAddPrice, 2);
|
|
|
+ $by = bcsub($addPrice, $byAddPrice, 2);
|
|
|
+ $hj = bcsub($addPrice, $hjAddPrice, 2);
|
|
|
+ $zs = bcsub($addPrice, $zsAddPrice, 2);
|
|
|
+
|
|
|
+ $original['qtPrice'] = floatval(bcsub($discountPrice, $qt, 2));
|
|
|
+ $original['byPrice'] = floatval(bcsub($discountPrice, $by, 2));
|
|
|
+ $original['hjPrice'] = floatval(bcsub($discountPrice, $hj, 2));
|
|
|
+ $original['zsPrice'] = floatval(bcsub($discountPrice, $zs, 2));
|
|
|
+ }
|
|
|
$product['originalInfo'] = $original;
|
|
|
util::success($product);
|
|
|
}
|