Procházet zdrojové kódy

fix: 修复查询门店bug

pangqijun před 3 měsíci
rodič
revize
35bad67484

+ 4 - 4
src/main/java/org/springblade/modules/api/controller/ApiShopController.java

@@ -87,12 +87,12 @@ public class ApiShopController extends BaseController {
     @GetMapping("/page")
     @ApiOperationSupport(order = 3)
     @ApiOperation(value = "分页查询门店列表", notes = "传入shop")
-    public R<IPage<ShopVO>> page(ShopVO shop, Query query) {
+    public R<IPage<ShopVO>> page(Query query) {
         LambdaQueryWrapper<Shop> wrapper = Wrappers.lambdaQuery(Shop.class);
-        wrapper.eq(Shop::getMerchantId, AuthUtil.getUserId());
-        shop.setMerchantId(AuthUtil.getUserId());
         if (!isMerchant()) {
-            wrapper.in(BaseEntity::getId, iUserMerchantService.getByUserId(AuthUtil.getUserId()));
+            wrapper.in(BaseEntity::getId, iUserMerchantService.getAuthShopId(AuthUtil.getUserId()));
+        } else {
+            wrapper.eq(Shop::getMerchantId, AuthUtil.getUserId());
         }
         IPage<Shop> pages = iShopService.page(Condition.getPage(query), wrapper);
         return R.data(ShopWrapper.build().pageVO(pages));