小程序主页报错修复

This commit is contained in:
张松
2025-03-10 18:09:34 +08:00
parent 80e958d9ba
commit 6db661acbe

View File

@@ -185,20 +185,24 @@
<if test="distanceType != null"> <if test="distanceType != null">
and ST_Distance_Sphere(POINT(b.lng, b.lat), POINT(#{lng}, #{lat})) &lt;= #{distanceType} and ST_Distance_Sphere(POINT(b.lng, b.lat), POINT(#{lng}, #{lat})) &lt;= #{distanceType}
</if> </if>
<if test="orderType == 0">
ORDER BY distance
</if>
<if test="orderType == 1">
ORDER BY a.real_sales_number desc
</if>
<if test="orderType == 2"> <choose>
ORDER BY a.sale_price <when test="orderType == 0">
</if> ORDER BY discount
</when>
<if test="orderType == 3"> <when test="orderType == 1">
ORDER BY c.create_time desc ORDER BY a.real_sales_number DESC
</if> </when>
<when test="orderType == 2">
ORDER BY a.sale_price
</when>
<when test="orderType == 3">
ORDER BY c.create_time DESC
</when>
<otherwise>
ORDER BY c.create_time DESC <!-- 默认排序,避免 orderType 为空时报错 -->
</otherwise>
</choose>
</select> </select>
<select id="getTodayProInfo" resultType="com.czg.product.vo.RecommendProVO"> <select id="getTodayProInfo" resultType="com.czg.product.vo.RecommendProVO">