更新转售商品详情

This commit is contained in:
yaooo 2023-08-22 16:02:00 +08:00
parent 84d6c47f66
commit f84bc9e7f1

View File

@ -580,27 +580,7 @@ class Community extends BaseController
if (!$communityInfo) {
return app('json')->fail('转售商品不存在');
}
if (!empty($communityInfo['image'])) {
$communityInfo['image'] = explode(',', $communityInfo['image']);
}
$merInfo = Db::name('StoreService')->alias('ss')->leftJoin('Merchant m','ss.mer_id = M.mer_id')->where('ss.uid', $this->request->uid())->field('m.mer_avatar, m.mer_name')->find();
$communityInfo['mer_name'] = $merInfo['mer_name'] ?? '';
$communityInfo['mer_avatar'] = $merInfo['mer_avatar'] ?? '';
$resaleList = Db::name('resale')->alias('r')->leftJoin('store_product_attr_value s','r.product_attr_unique = s.unique')->where('r.community_id', $id)->where('r.is_del', 0)->field(['r.product_id', 'r.product_attr_unique', 'r.number', 'r.price', 'r.float_rate', 'r.deliver_method', 'r.resale_type', 's.detail', 's.sku', 's.image'])->select();
if ($resaleList) $resaleList = $resaleList->toArray();
foreach($resaleList as $k=>$v) {
$resaleList[$k]['detail'] = json_decode($v['detail'], true);
if (empty($v['image'])) {
$prodImage = Db::name('store_product')->where('product_id', $v['product_id'])->value('image');
$prodImageList = explode(',', $prodImage);
if (count($prodImageList) > 0) {
$resaleList[$k]['image'] = $prodImageList[0];
}
}
}
$communityInfo['resale'] = $resaleList;
return app('json')->success($communityInfo);
return app('json')->success($this->repository->show($id, $this->user));
}
/**