rk
10 小时以前 bd491c37218b0b3d9b518e4814967d814e781c02
server/dmmall_service/src/main/java/com/doumee/service/business/impl/ShopServiceImpl.java
@@ -318,24 +318,25 @@
        queryWrapper.eq(Shop::getId,id);
        queryWrapper.select("(select AVG(SCORE) from shop_comment where ISDELETED=0 and OBJ_ID=t.id) as score");//门店评分
        /** ----------------start店铺访问数据----------------*/
        queryWrapper.select("(select count(id) from shop_scan where ISDELETED=0 and SHOP_ID=t.id) as shopTotalVisits");//主页总访问量
        queryWrapper.select("(select count(id) from shop_scan where ISDELETED=0 and SHOP_ID=t.id and to_days(CREATE_DATE)=to_days(now()) ) as shopNowVisits");//今日访问量
        queryWrapper.select("(select count(id) from shop_scan where ISDELETED=0 and SHOP_ID=t.id and to_days(CREATE_DATE)=to_days(DATE_SUB(CURDATE(), INTERVAL 1 DAY)) ) as shopYesterdayVisits");//昨日日访问量
        queryWrapper.select("(select count(s.MEMBER_ID) from (select MEMBER_ID,SHOP_ID from shop_scan where ISDELETED=0   group by MEMBER_ID) as s where   s.SHOP_ID = t.id) as shopMemberVisits");//访问总用户数
//        queryWrapper.select("(select count(id) from shop_scan where ISDELETED=0 and SHOP_ID=t.id) as shopTotalVisits");//主页总访问量
//        queryWrapper.select("(select count(id) from shop_scan where ISDELETED=0 and SHOP_ID=t.id and to_days(CREATE_DATE)=to_days(now()) ) as shopNowVisits");//今日访问量
//        queryWrapper.select("(select count(id) from shop_scan where ISDELETED=0 and SHOP_ID=t.id and to_days(CREATE_DATE)=to_days(DATE_SUB(CURDATE(), INTERVAL 1 DAY)) ) as shopYesterdayVisits");//昨日日访问量
//        queryWrapper.select("(select count(s.MEMBER_ID) from (select MEMBER_ID,SHOP_ID from shop_scan where ISDELETED=0   group by MEMBER_ID) as s where   s.SHOP_ID = t.id) as shopMemberVisits");//访问总用户数
        /** ----------------end店铺访问数据----------------*/
        /** ----------------start店铺互动数据----------------*/
        queryWrapper.select("(select count(id) from shop_follow where ISDELETED=0 and OBJ_ID=t.id and OBJ_TYPE=0) as shopFollower");//粉丝数
        queryWrapper.select("(select count(id) from shop_menu where ISDELETED=0 and SHOP_ID=t.id ) as shopMenu");//菜品数
        queryWrapper.select("(select count(id) from shop_comment where ISDELETED=0 and OBJ_ID=t.id ) as shopComment");//评论数
        queryWrapper.select("(select count(id) from shop_news where ISDELETED=0 and SHOP_ID=t.id ) as shopNews");//新鲜事
//        queryWrapper.select("(select count(id) from shop_follow where ISDELETED=0 and OBJ_ID=t.id and OBJ_TYPE=0) as shopFollower");//粉丝数
//        queryWrapper.select("(select count(id) from shop_menu where ISDELETED=0 and SHOP_ID=t.id ) as shopMenu");//菜品数
//        queryWrapper.select("(select count(id) from shop_comment where ISDELETED=0 and OBJ_ID=t.id ) as shopComment");//评论数
//        queryWrapper.select("(select count(id) from shop_news where ISDELETED=0 and SHOP_ID=t.id ) as shopNews");//新鲜事
        /** ----------------end店铺互动数据----------------*/
        /** ----------------start优惠券数据----------------*/
        queryWrapper.select("(select count(id) from coupon where ISDELETED=0 and SHOP_ID=t.id and type=0) as couponCount");//优惠券发放总数(张)
        queryWrapper.select("(select count(id) from member_coupon where ISDELETED=0 and SHOP_ID=t.id and type=0) as couponDrawCount");//优惠券领取总数(张)
        queryWrapper.select("(select count(id) from member_coupon where ISDELETED=0 and SHOP_ID=t.id and type=0 and STATUS=1 ) as couponUserComment");//优惠券使用总数(张)
        queryWrapper.select("(select sum(LIMIT_PRICE) from member_coupon where ISDELETED=0 and SHOP_ID=t.id and type=0 and STATUS=1 ) as couponUserMoney");//优惠券使用金额(元)
//        queryWrapper.select("(select count(id) from coupon where ISDELETED=0 and SHOP_ID=t.id and type=0) as couponCount");//优惠券发放总数(张)
//        queryWrapper.select("(select count(id) from member_coupon where ISDELETED=0 and SHOP_ID=t.id and type=0) as couponDrawCount");//优惠券领取总数(张)
//        queryWrapper.select("(select count(id) from member_coupon where ISDELETED=0 and SHOP_ID=t.id and type=0 and STATUS=1 ) as couponUserComment");//优惠券使用总数(张)
//        queryWrapper.select("(select sum(LIMIT_PRICE) from member_coupon where ISDELETED=0 and SHOP_ID=t.id and type=0 and STATUS=1 ) as couponUserMoney");//优惠券使用金额(元)
        /** ----------------end店铺优惠券数据----------------*/
        queryWrapper.select("(select count(g.id) from goodsorder where g.ISDELETED=0 and  g.DISTRIBUTION_SHOP_ID=t.id ) as totalOrderNUm");//优惠券使用金额(元)
       Shop shop= shopJoinMapper.selectJoinOne(Shop.class,queryWrapper);
        String path = systemDictDataBiz.queryByCode(Constants.OSS, Constants.RESOURCE_PATH).getCode()
                + systemDictDataBiz.queryByCode(Constants.OSS, Constants.SHOP_FILE).getCode();
@@ -803,7 +804,7 @@
    @Override
    public SaleReportResponse saleReport(SaleReportRequest request,String shopId){
    public SaleReportResponse saleReport(SaleReportRequest request,Integer shopId){
        SaleReportResponse saleReportResponse = new SaleReportResponse();
        saleReportResponse.setSaleTotal(BigDecimal.ZERO);
        saleReportResponse.setOrderNum(Constants.ZERO);
@@ -814,7 +815,6 @@
                        .selectAll(Goodsorder.class)
                        .selectAs(Member::getPhone,Goodsorder::getPhone)
                        .selectAs(Member::getNickname,Goodsorder::getNickName)
                        .select(" select ifnull(sum(g.SHOP_SETTLEMENT),0) from goodsorder_detail g where t.id = g.ORDER_ID   ",Goodsorder::getShopSettlement)
                        .leftJoin(Member.class,Member::getId,Goodsorder::getMemberId)
                        .eq(Goodsorder::getIsdeleted,Constants.ZERO)
                        .eq(Goodsorder::getDistributionShopId,shopId)