zhangchen 1 сар өмнө
parent
commit
a815f05df3

+ 5 - 12
alien-entity/src/main/resources/mapper/ManagementInfoMapper.xml

@@ -285,21 +285,14 @@
     </select>
 
     <select id="getPlatformNetProfit" resultType="shop.alien.entity.store.vo.ManagementInfoVo">
-        select IFNULL(ROUND(sum(all_data.platform_profit),2), 0) AS profit from
-        (SELECT
-        ROUND(SUM(final_price) * (IFNULL(store.commission_rate, 3)/100),2) AS platform_profit
-        FROM
-        life_user_order `order`
-        LEFT JOIN store_info store ON store.id = `order`.store_id
-        left join order_coupon_middle ocm on ocm.order_id  = `order`.id
-        WHERE
-        `order`.`status` = 2
+
+        select IFNULL(ROUND(sum(sidr.commission)/100,2), 0) AS profit
+        from store_income_details_record sidr
+        where 1=1
         <if test="dataTime != null and dataTime != ''">
             AND
-            ocm.used_time > #{dataTime}
+            sidr.created_time > #{dataTime}
         </if>
-        GROUP BY
-        store.id) all_data
     </select>
     <select id="getOrderQuantity" resultType="shop.alien.entity.store.vo.ManagementInfoVo">
         select count(*) count from (