From ee0fc4d9b4412cc1c0365b8ac7dd43b78f98a038 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Tue, 13 Apr 2021 19:56:40 +0800
Subject: [PATCH] Merge branch 'score_shop' of http://120.27.238.55:7000/r/beauty-erp into score_shop

---
 zq-erp/src/main/resources/mybatis/mapper/hive/AchieveNewDao.xml |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/AchieveNewDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/AchieveNewDao.xml
index 442d121..4d98102 100644
--- a/zq-erp/src/main/resources/mybatis/mapper/hive/AchieveNewDao.xml
+++ b/zq-erp/src/main/resources/mybatis/mapper/hive/AchieveNewDao.xml
@@ -1054,21 +1054,23 @@
 		select
 			b.shop_short_name name,
 			b.SHOP_IMAG photo,
-			sum(IFNULL(a.goods_cash,0)) amount
-		from achieve_new a
-		left join sys_shop_info b on a.shop_id=b.ID and shop_type!=1
+			sum(IFNULL(a.amount,0)) amount
+		from sys_order_flow a
+		inner join sys_order c on a.order_id=c.id and c.STATU != '已取消'
+		inner join sys_shop_info b on a.shop_id=b.id and shop_type!=1
 		<where>
+			a.pay_method not in ('储值卡', '欠款')
 			<if test="record.companyId != null">
 				and a.company_id=#{record.companyId}
 			</if>
 			<if test='record.t1 == "1" and record.datatime != null'>
-				and date_format(datatime, '%Y-%m-%d') = date_format(#{record.datatime}, '%Y-%m-%d')
+				and date_format(a.create_time, '%Y-%m-%d') = date_format(#{record.datatime}, '%Y-%m-%d')
 			</if>
 			<if test='record.t1 == "2" and record.datatime != null'>
-				and date_format(datatime, '%Y-%m') = date_format(#{record.datatime}, '%Y-%m')
+				and date_format(a.create_time, '%Y-%m') = date_format(#{record.datatime}, '%Y-%m')
 			</if>
 			<if test='record.t1 == "3" and record.datatime != null'>
-				and date_format(datatime, '%Y') = date_format(#{record.datatime}, '%Y')
+				and date_format(a.create_time, '%Y') = date_format(#{record.datatime}, '%Y')
 			</if>
 		</where>
 		group by a.shop_id

--
Gitblit v1.9.1