From 72e9102961d55a1be9d9f702409f30ec8f39fa64 Mon Sep 17 00:00:00 2001 From: xuhy <3313886187@qq.com> Date: 星期五, 01 十一月 2024 17:42:18 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TGoodsMapper.xml | 24 +++++++++++++++++++----- 1 files changed, 19 insertions(+), 5 deletions(-) diff --git a/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TGoodsMapper.xml b/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TGoodsMapper.xml index 4351904..610e7a8 100644 --- a/ruoyi-service/ruoyi-other/src/main/resources/mapper/other/TGoodsMapper.xml +++ b/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> -- Gitblit v1.7.1