luodangjia
2024-11-01 915684f43f51f9a08ca8c91d585be1c5a2d0cfc5
merge
1个文件已修改
24 ■■■■ 已修改文件
ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TGoodsMapper.xml 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TGoodsMapper.xml
@@ -61,15 +61,29 @@
        WHERE `status` = 1 and del_flag = 0 and type = #{appGoodQuery.type}
        UNION ALL
        SELECT
            id,name,redeem_points  as redeemPoints,inventory_quantity as inventory,payment_amount as originalPrice,payment_amount as preferentiaPrice,vip_payment_amount as vipPrice,2 as goodType,cover_picture as coverPicture,0 as underlyingSales
            id,
            NAME,
            redeem_points AS redeemPoints,
            inventory_quantity AS inventory,
            payment_amount AS originalPrice,
            payment_amount AS preferentiaPrice,
            vip_payment_amount AS vipPrice,
            2 AS goodType,
            cover_picture AS coverPicture,
            0 AS underlyingSales
        FROM
            t_coupon
        WHERE `status`= 1 and del_flag = 0 and ways_to_obtain != #{appGoodQuery.type}
        WHERE
            `status` = 1
          AND del_flag = 0 and ways_to_obtain != #{appGoodQuery.type}
          AND (
            validity_period_mode != 1
        OR (validity_period_mode = 1 AND end_time >= NOW())
            )
        ORDER BY
            CASE
                WHEN `inventory` = 0 THEN
                    0 ELSE 1
                WHEN `inventory` = 0 THEN 0
                ELSE 1
                END DESC,
            `redeemPoints` ASC
    </select>