Przeglądaj źródła

bugfix:981 添加好友页,输入商户昵称(该商户未入驻店铺),查询不到该商户

penghao 3 miesięcy temu
rodzic
commit
88515f37eb

+ 3 - 0
alien-entity/src/main/java/shop/alien/entity/store/vo/LifeUserVo.java

@@ -62,6 +62,9 @@ public class LifeUserVo extends LifeUser {
     @ApiModelProperty(value = "简介")
     private String blurb;
 
+    @ApiModelProperty(value = "账户名称(商户昵称或用户名称)")
+    private String accountName;
+
     @ApiModelProperty(value = "验证码")
     private String verificationCode;
 }

+ 7 - 4
alien-entity/src/main/java/shop/alien/mapper/LifeUserMapper.java

@@ -35,10 +35,13 @@ public interface LifeUserMapper extends BaseMapper<LifeUser> {
     LifeFansVo getUserInfoByPhoneIdList(@Param("phoneId") String phoneId);
 
     @Select("SELECT * FROM ( " +
-            " SELECT store.id, concat( 'store_', USER.phone ) phoneId, USER.head_img imgUrl, store_blurb blurb, " +
-            " if(store.id is null,USER.name ,store.store_name) storeUserName " +
-            " FROM store_user USER LEFT JOIN store_info store ON USER.store_id = store.id  and USER.delete_flag = 0 and  store.delete_flag = 0  " +
-            " UNION ALL SELECT id, concat( 'user_', user_phone ) phoneId, user_image imgUrl, jianjie blurb, user_name NAME " +
+            " SELECT store.id, concat( 'store_', USER.phone ) phoneId, USER.head_img imgUrl, " +
+            " IF(store.id IS NULL, USER.account_blurb, store.store_blurb) blurb, " +
+            " IF(store.id IS NULL, USER.nick_name, store.store_name) storeUserName, " +
+            " USER.nick_name accountName " +
+            " FROM store_user USER LEFT JOIN store_info store ON USER.store_id = store.id " +
+            " WHERE USER.delete_flag = 0 AND (store.id IS NULL OR store.delete_flag = 0) " +
+            " UNION ALL SELECT id, concat( 'user_', user_phone ) phoneId, user_image imgUrl, jianjie blurb, user_name NAME, user_name accountName " +
             " FROM life_user WHERE delete_flag = 0 ) a " +
             " ${ew.customSqlSegment}")
     IPage<LifeUserVo> getStoreAndUserByName(IPage<LifeUserVo> iPage, @Param(Constants.WRAPPER) QueryWrapper<LifeUserVo> wrapper);

+ 2 - 0
alien-store/src/main/java/shop/alien/store/service/LifeUserService.java

@@ -145,6 +145,8 @@ public class LifeUserService extends ServiceImpl<LifeUserMapper, LifeUser> {
                 .like("a.storeUserName", vo.getSearchName())
                 .or()
                 .like("a.phoneId", vo.getSearchName())
+                .or()
+                .like("a.accountName", vo.getSearchName())
             );
         }
         IPage<LifeUserVo> voList = lifeUserMapper.getStoreAndUserByName(new Page<>(vo.getPage(), vo.getSize()), queryWrapper);