以前未免也太蠢了.不会解决问题的方式.未免太蠢了
#今日门店销售额 SELECT ROUND(sum(real_pay) / 10000, 2) AS `门店销售额` FROM arm_changsha.goods_sales WHERE create_date >= ‘2019-01-01 00:00:00‘ AND create_date <= ‘2019-01-01 23:59:59‘ AND salesdepart_id = ‘1025‘; #今日线上销售额 SELECT SUM(pay_amount) AS 订单金额 FROM mabao51_dev.mall_trade WHERE order_time >= ‘2019-01-01 00:00:00‘ AND order_time <= ‘2019-01-01 23:59:59‘ AND is_deleted != ‘1‘ AND store_id_arm = ‘1008‘ ; #会员总数 SELECT COUNT(DISTINCT memberId) AS 会员总数 FROM mabao51_dev.member_org_lnk WHERE organizationId = ‘1025‘; #本月有购会员 SELECT COUNT(DISTINCT member_id) AS 有购会员 FROM arm_changsha.goods_sales WHERE create_date >= ‘2019-01-01 00:00:00‘ AND create_date <= ‘2019-01-31 23:59:59‘ AND salesdepart_id = ‘1025‘; #商城订单-待核销 SELECT COUNT(1) AS 待核销订单 FROM mabao51_dev.mall_trade WHERE is_deleted != ‘1‘ AND store_id_arm = ‘1025‘ GROUP BY trade_status;
原文:https://www.cnblogs.com/sakura3/p/10498340.html