diff --git a/modules/api/controllers/mall/integral/GoodsController.php b/modules/api/controllers/mall/integral/GoodsController.php index 713755e..7c45f8a 100644 --- a/modules/api/controllers/mall/integral/GoodsController.php +++ b/modules/api/controllers/mall/integral/GoodsController.php @@ -35,7 +35,7 @@ class GoodsController extends Controller 'class' => LoginBehavior::className(), 'ignore' => [ 'api/mall/integral/goods/index', -// 'api/mall/integral/goods/index-one', + 'api/mall/integral/goods/index-one', 'api/mall/integral/goods/index-cat', 'api/mall/integral/goods/tree', @@ -135,7 +135,7 @@ class GoodsController extends Controller $form->cx_mch_id = $this->cx_mch_id; $form->status = Goods::STATUS_ONLINE; $form->plugin_sign = SysConst::$cxPluginSceneIntegralMall; - $form->setFields('g.id,g.price,g.date,g.sort,gh.subtitle,gh.banner_urls,g.created_at,gh.name,gh.cover_pic,gh.video_url,gh.pic_urls'); + $form->setFields('g.id,g.price,g.date,g.sort,gh.subtitle,gh.banner_urls,g.created_at,gh.name,gh.cover_pic,gh.video_url,gh.pic_urls,gh.video_banner_urls'); $data = $form->search(); foreach ($data['data'] as $key => $value) { @@ -143,7 +143,6 @@ class GoodsController extends Controller $data['data'][$key]['pic_arr'] = []; if ($value['pic_urls'] != null) { $pic_arr = json_decode($value['pic_urls'], true); - if (is_array($pic_arr)) { foreach ($pic_arr as $index => $item) { // $item = SiteHelper::getFullUrl($item); @@ -152,16 +151,17 @@ class GoodsController extends Controller $data['data'][$key]['pic_arr'] = $pic_arr; } } - + $data['data'][$key]['video_arr'] = []; if ($value['video_url'] != null) { $video_arr = json_decode($value['video_url'], true); - if (is_array($video_arr)) { - foreach ($video_arr as $index => $item) { -// $item = SiteHelper::getFullUrl($item); - $video_arr[$index] = $item; - } - $data['data'][$key]['video_arr'] = $video_arr; + $video_banner_urls = json_decode($value['video_banner_urls'], true); + + $video = []; + foreach ($video_arr as $key1 => $value1) { + $video[$key1]['img'] = $video_banner_urls[$key1] ?? ''; + $video[$key1]['video_url'] = $value1 ?? ''; } + $data['data'][$key]['video_arr'] = $video; } } $goods_id = \Yii::$app->request->get('goods_id');