|
|
@@ -12,6 +12,7 @@ use bizGhs\product\services\ProductService;
|
|
|
use bizHd\admin\classes\ShopAdminClass;
|
|
|
use bizHd\purchase\classes\PurchaseClass;
|
|
|
use bizHd\purchase\classes\PurchaseItemClass;
|
|
|
+use bizHd\pictext\classes\PicTextGhsItemClass;
|
|
|
use common\components\printUtil;
|
|
|
use common\components\stringUtil;
|
|
|
use common\components\util;
|
|
|
@@ -828,16 +829,24 @@ class ProductController extends BaseController
|
|
|
public function actionGhsProductDetail()
|
|
|
{
|
|
|
$get = Yii::$app->request->get();
|
|
|
- $id = $get['id'] ?? 0;
|
|
|
- $ghsId = $get['ghsId'] ?? 0;
|
|
|
+ $id = isset($get['id']) ? intval($get['id']) : 0;
|
|
|
+ $ghsId = isset($get['ghsId']) ? intval($get['ghsId']) : 0;
|
|
|
+ if ($id == 0 || $ghsId == 0) {
|
|
|
+ util::fail('请求参数出错');
|
|
|
+ }
|
|
|
+
|
|
|
$product = ProductClass::getById($id);
|
|
|
if (empty($product)) {
|
|
|
util::fail('没有花材信息');
|
|
|
}
|
|
|
- $ghsInfo = GhsClass::getById($ghsId, true);
|
|
|
+ $ghsInfo = GhsClass::getById($ghsId, true, 'giveLevel, mainId');
|
|
|
$level = isset($ghsInfo->giveLevel) ? $ghsInfo->giveLevel : 1;
|
|
|
$list = ProductClass::groupProductInfo([$product], $level);
|
|
|
$product = current($list);
|
|
|
+
|
|
|
+ $pixTextGoods = PicTextGhsItemClass::getByCondition(['mainId' => $ghsInfo->mainId, 'ghsItemId' => $id], true);
|
|
|
+ $product['picTextGoods'] = $pixTextGoods;
|
|
|
+
|
|
|
util::success($product);
|
|
|
}
|
|
|
|