修改接口

This commit is contained in:
wangxiaowei 2024-08-09 04:56:15 +08:00
parent a0ebd8e0a1
commit b18fe1c8ac

@ -84,6 +84,7 @@ class MallNewsLogic extends Logic
private static function content(&$arg)
{
foreach ($arg as &$v) {
if ($v['mall_type'] == 0) {
if ($v['shop_id'] > 0) {
$v['shop'] = Goods::field('name, image, min_price')->find($v['shop_id']);
}
@ -97,6 +98,17 @@ class MallNewsLogic extends Logic
}
}
}
} else if ($v['mall_type'] == 1) {
$ids = explode(',', $v['mall_news_goods_id']);
foreach ($ids as $k => &$v2) {
$res = MallNewsFile::where('mall_news_shop_id', $v2)->field('mall_news_shop_id, src')->select()->toArray();
foreach ($res as &$v3) {
$v3['image'] = UrlServer::getFileUrl('uploads/images/' . $v3['src']);
}
$arr[$k] = $res;
}
$v['shop'] = $arr;
}
}
}
}