Просмотр исходного кода

Merge branch 'dev' into 202511

zhangxin 5 дней назад
Родитель
Сommit
db77b371fa

+ 4 - 4
yami-shop-service/src/main/resources/mapper/SkuMapper.xml

@@ -284,6 +284,9 @@
         <foreach collection="po.channelIds" item="id" open="(" separator="," close=")">
             #{id}
         </foreach>
+        <if test="po.userAttrType != null and po.userAttrType != 0">
+            AND e.user_attr_type=#{po.userAttrType}
+        </if>
         <if test="po.skuId != null or (po.skuName != null and po.skuName != '') or (po.spec != null and po.spec != '')">
             and a.order_number in(SELECT a.order_number FROM tz_order_item a LEFT JOIN tz_sku b on a.sku_id=b.sku_id
             <where>
@@ -298,9 +301,6 @@
                 <if test="po.spec != null and po.spec != ''">
                     AND b.spec like concat('%',#{po.spec} ,'%')
                 </if>
-                <if test="po.userAttrType != null and po.userAttrType != 0">
-                    AND e.user_attr_type=#{po.userAttrType}
-                </if>
             </where>
             )
         </if>
@@ -309,7 +309,7 @@
         (SELECT  IFNULL(SUM( total_offset_points ),0)  FROM (SELECT
         CASE
         WHEN refund_type=1 THEN total_offset_points
-        ELSE total_offset_points+ (freight_amount * 100)
+        ELSE total_offset_points
         END AS total_offset_points
         FROM tz_order_refund a
         LEFT JOIN tz_user e on a.user_id=e.user_id

+ 3 - 3
yami-shop-service/src/main/resources/mapper/UserMapper.xml

@@ -254,7 +254,7 @@
 
     <select id="test" resultType="double">
         SELECT (SELECT SUM(IFNULL(offset_points,0)) FROM tz_order
-        WHERE create_time&gt;= '2025-11-01 00:00:00' and create_time&lt;='2025-12-08 23:59:59' and is_payed=1 and user_id=#{userId}
+        WHERE is_payed=1 and user_id=#{userId}
         ) -
         (
         SELECT  IFNULL(SUM(IFNULL(total_offset_points,0)),0) FROM (SELECT
@@ -265,9 +265,9 @@
         FROM tz_order_refund a
         LEFT JOIN (SELECT SUM(offset_points) total_offset_points ,order_number
         FROM tz_order_refund
-        WHERE apply_time&gt;='2025-11-01 00:00:00' and apply_time&lt;='2025-12-08 23:59:59' and return_money_sts=70 and user_id=#{userId}
+        WHERE  return_money_sts=70 and user_id=#{userId}
         GROUP BY order_number) b on a.order_number=b.order_number
-        WHERE apply_time&gt;='2025-11-01 00:00:00' and apply_time&lt;='2025-12-08 23:59:59' and return_money_sts=70 and user_id=#{userId}
+        WHERE return_money_sts=70 and user_id=#{userId}
         GROUP BY a.order_number) a
         )
     </select>