yujian
2019-01-09 b14e82cb4d7a6a7a43174a922f10157e4b21567c
奖金统计计算调整
2个文件已修改
18 ■■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/client/UserOrderController.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/order/CommonOrderMapper.xml 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/UserOrderController.java
@@ -307,10 +307,13 @@
            JSONObject data = new JSONObject();
            // 分享统计
            BigDecimal sharemoney = commonOrderService.countOrderMoney(uid,2, dateType);
            data.put("shareCount", commonOrderService.countOrder(uid, 2, dateType));
            data.put("sharemoney", sharemoney.setScale(2, BigDecimal.ROUND_DOWN).toString());
            // 邀请统计
            BigDecimal inviteMoney = commonOrderService.countOrderMoney(uid,3, dateType);
            data.put("inviteCount", commonOrderService.countOrder(uid, 3, dateType));
            data.put("inviteMoney", inviteMoney.setScale(2, BigDecimal.ROUND_DOWN).toString());
            
fanli/src/main/java/com/yeshi/fanli/mapping/order/CommonOrderMapper.xml
@@ -341,7 +341,10 @@
            <if test="day != null and day == 4">  <!-- 上月 -->
                AND PERIOD_DIFF( DATE_FORMAT(NOW(), '%Y%m'),
                DATE_FORMAT(tc.`co_create_time`, '%Y%m')) = 1
                <!-- 统计已收货 -->
                AND tc.`co_state` = 2
            </if>
            GROUP BY tc.`co_order_no`,tc.co_source_type)A
    </select>
@@ -660,10 +663,7 @@
        LEFT JOIN yeshi_ec_hongbao_v2 th ON
        (tr.`ho_hongbao_id` = th.`hb_id` OR
        th.`hb_pid` = tr.`ho_hongbao_id` )
        WHERE <![CDATA[tc.`co_state` <> 4]]>
        <if test="uid != null">
            AND th.`hb_uid` = ${uid}
        </if>
        WHERE th.`hb_uid` = ${uid}
        <if test="type != null and type == 1"> <!-- 自购订单 -->
            AND (th.hb_type =1 or th.hb_type =2)
        </if>
@@ -674,7 +674,7 @@
            AND (th.`hb_type` = 5 OR th.`hb_type` = 6 OR th.`hb_type` = 7 OR th.`hb_type` = 21 OR th.`hb_type` = 22)
        </if>
        <if test="day != null and day == 1"> <!-- 今天 -->
            AND TO_DAYS(tc.`co_create_time`) = TO_DAYS(NOW())
            AND TO_DAYS(tc.`co_create_time`) = TO_DAYS(NOW())
        </if>
        <if test="day != null and day == 2">  <!-- 昨天 -->
            AND TO_DAYS(NOW()) - TO_DAYS(tc.`co_create_time`) = 1
@@ -685,7 +685,10 @@
        </if>
        <if test="day != null and day == 4">  <!-- 上月 -->
            AND PERIOD_DIFF( DATE_FORMAT(NOW(), '%Y%m'),
            DATE_FORMAT(tc.`co_create_time`, '%Y%m')) = 1
            DATE_FORMAT(tc.`co_create_time`, '%Y%m')) = 1
            <!-- 统计已收货 -->
            AND tc.`co_state` = 2
        </if>
    </select>