Forráskód Böngészése

修改查询好友逻辑 没有店铺 不让查

lutong 2 hónapja
szülő
commit
e176af5dd7

+ 6 - 5
alien-entity/src/main/java/shop/alien/mapper/LifeUserMapper.java

@@ -35,12 +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, " +
-            " IF(store.id IS NULL, USER.account_blurb, store.store_blurb) blurb, " +
-            " IF(store.id IS NULL, USER.nick_name, store.store_name) storeUserName, " +
+            " SELECT USER.id, concat( 'store_', USER.phone ) phoneId, USER.head_img imgUrl, " +
+            " store.store_blurb blurb, " +
+            " 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) " +
+            " FROM store_user USER " +
+            " INNER JOIN store_info store ON USER.store_id = store.id " +
+            " WHERE 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, user_name accountName " +
             " FROM life_user WHERE delete_flag = 0 ) a " +
             " ${ew.customSqlSegment}")