Browse Source

机构排序调整

Aslee 2 years ago
parent
commit
352b505f98
1 changed files with 4 additions and 1 deletions
  1. 4 1
      src/main/resources/mapper/ClubMapper.xml

+ 4 - 1
src/main/resources/mapper/ClubMapper.xml

@@ -82,6 +82,9 @@
         left join province p on a.provinceId = p.provinceID
         left join city c on a.cityId = c.cityID
         left join town t on a.townId = t.townID
+        left join (select cbap.authId as authId, count(*) as productCount
+        from cm_brand_auth_product cbap where cbap.status = 1
+        group by cbap.authId) pc on a.id = pc.authId
         where au.authUserId = #{authUserId}
         and a.status = 1
         and a.auditStatus = 1
@@ -99,7 +102,7 @@
         <if test="townId != null">
             and a.townId = #{townId}
         </if>
-        order by if(a.authImage is not null,1,0) desc, distance
+        order by pc.productCount desc, distance
     </select>
     <select id="checkMobile" resultType="java.lang.Integer">
         select cu.id as clubUserId from cm_brand_club_user cu