|
|
@@ -843,22 +843,19 @@ class ProductController extends BaseController
|
|
|
public function actionGhsProductDetail()
|
|
|
{
|
|
|
$get = Yii::$app->request->get();
|
|
|
- $id = isset($get['id']) ? intval($get['id']) : 0;
|
|
|
- $ghsId = isset($get['ghsId']) ? intval($get['ghsId']) : 0;
|
|
|
- if ($id == 0 || $ghsId == 0) {
|
|
|
- util::fail('请求参数出错');
|
|
|
- }
|
|
|
-
|
|
|
+ $id = $get['id'] ?? 0;
|
|
|
+ $ghsId = $get['ghsId'] ?? 0;
|
|
|
$product = ProductClass::getById($id);
|
|
|
if (empty($product)) {
|
|
|
util::fail('没有花材信息');
|
|
|
}
|
|
|
- $ghsInfo = GhsClass::getById($ghsId, true, 'giveLevel, mainId');
|
|
|
+ $ghsInfo = GhsClass::getById($ghsId, true, 'giveLevel');
|
|
|
$level = isset($ghsInfo->giveLevel) ? $ghsInfo->giveLevel : 1;
|
|
|
$list = ProductClass::groupProductInfo([$product], $level);
|
|
|
$product = current($list);
|
|
|
|
|
|
- $pixTextGoods = PicTextGhsItemClass::getByCondition(['mainId' => $ghsInfo->mainId, 'ghsItemId' => $id], true);
|
|
|
+ $mainId = $product['mainId']??0;
|
|
|
+ $pixTextGoods = PicTextGhsItemClass::getByCondition(['mainId' => $mainId, 'ghsItemId' => $id], true);
|
|
|
$product['picTextGoods'] = $pixTextGoods;
|
|
|
// 封面图与多花材图片的兼容处理
|
|
|
if ($product['images'] == '' && $product['shortCover'] != '') {
|