diff --git a/app/api/logic/LocalStoreLogic.php b/app/api/logic/LocalStoreLogic.php index ac0145cd..a7b7820e 100644 --- a/app/api/logic/LocalStoreLogic.php +++ b/app/api/logic/LocalStoreLogic.php @@ -7,7 +7,7 @@ use app\common\model\LocalStore; use app\common\model\localstore\LocalGoodsStore; use app\common\model\LocalStoreOrder; use think\facade\Db; - +use think\facade\Config; class LocalStoreLogic extends Logic { public function getLocalList($data) @@ -227,7 +227,12 @@ class LocalStoreLogic extends Logic ->toArray(); foreach($list as $key=>$value){ $goods = Db::name("local_store_goods")->where("id",$value['goods_id'])->find(); + $image = Db::name("local_store_goods_pic")->where("id",$value['lsg_id'])->select(); + foreach($image as $k=>$v){ + $image[$k]['url'] = Config::get('aliyunoss.domain').$v['url']; + } $list[$key]['goods_msg'] = $goods; + $list[$key]['goods_image'] = $image; $local = Db::name("local_store")->field("shopName,shopLogo")->where("lstore_id",$value['lstore_id'])->find(); $list[$key]['local_msg'] = $local; } @@ -261,7 +266,12 @@ class LocalStoreLogic extends Logic ->toArray(); foreach($list as $key=>$value){ $goods = Db::name("local_store_goods")->where("id",$value['goods_id'])->find(); + $image = Db::name("local_store_goods_pic")->where("id",$value['lsg_id'])->select(); + foreach($image as $k=>$v){ + $image[$k]['url'] = Config::get('aliyunoss.domain').$v['url']; + } $list[$key]['goods_msg'] = $goods; + $list[$key]['goods_image'] = $image; $local = Db::name("local_store")->field("shopName,shopLogo")->where("lstore_id",$value['lstore_id'])->find(); $list[$key]['local_msg'] = $local; }