|
|
@@ -382,39 +382,16 @@ class ProductController extends BaseController
|
|
|
util::complete();
|
|
|
}
|
|
|
|
|
|
- //供货商产品的详情 ssh 20210903
|
|
|
+ //供货商产品的详情 ssh 20230111
|
|
|
public function actionGhsProductDetail()
|
|
|
{
|
|
|
$id = Yii::$app->request->get('id', 0);
|
|
|
- $ghsId = Yii::$app->request->get('ghsId', 0);
|
|
|
- $ghs = GhsClass::getById($ghsId, true);
|
|
|
- GhsClass::valid($ghs, $this->shopId);
|
|
|
- $mainId = $ghs->mainId ?? 0;
|
|
|
- $product = ProductClass::getItemInfo($id, $ghs);
|
|
|
- if (isset($product['mainId']) == false || $product['mainId'] != $mainId) {
|
|
|
- Yii::info(json_encode($product));
|
|
|
- Yii::info('mainId: ' . $mainId);
|
|
|
- util::fail('没有权限访问');
|
|
|
- }
|
|
|
- $original = ProductClass::getById($id);
|
|
|
- if (isset($original['discountPrice']) && $original['discountPrice'] > 0) {
|
|
|
- $discountPrice = $original['discountPrice'];
|
|
|
- $original['price'] = floatval($discountPrice);
|
|
|
-
|
|
|
- $skAddPrice = $original['skAddPrice'] ?? 0;
|
|
|
- $addPrice = $original['addPrice'] ?? 0;
|
|
|
- $hjAddPrice = $original['hjAddPrice'] ?? 0;
|
|
|
- $zsAddPrice = $original['zsAddPrice'] ?? 0;
|
|
|
-
|
|
|
- $sk = bcsub($addPrice, $skAddPrice, 2);
|
|
|
- $hj = bcsub($addPrice, $hjAddPrice, 2);
|
|
|
- $zs = bcsub($addPrice, $zsAddPrice, 2);
|
|
|
-
|
|
|
- $original['skPrice'] = floatval(bcsub($discountPrice, $sk, 2));
|
|
|
- $original['hjPrice'] = floatval(bcsub($discountPrice, $hj, 2));
|
|
|
- $original['zsPrice'] = floatval(bcsub($discountPrice, $zs, 2));
|
|
|
- }
|
|
|
- $product['originalInfo'] = $original;
|
|
|
+ $product = ProductClass::getById($id);
|
|
|
+ if (!empty($product)) {
|
|
|
+ $level = 1;
|
|
|
+ $list = ProductClass::groupProductInfo([$product], $level);
|
|
|
+ $product = current($list);
|
|
|
+ }
|
|
|
util::success($product);
|
|
|
}
|
|
|
|