Browse Source

20231007101703添加企业全称

hu 1 year ago
parent
commit
6029017a8a

+ 1 - 1
src/custom/restcontroller/webmanage/sale/promotion/SQL/促销方案销售排行查询(经销商).sql

@@ -1,3 +1,3 @@
-select t2.agentnum,t3.abbreviation,t1.amount from (select t1.* from  (select  t1.sys_enterpriseid,sum(if(t1.status='手工关闭',ifnull(t2.deliedqty,0)*t2.price,t2.amount)) amount from sa_order t1
+select t2.agentnum,t3.abbreviation,t3.enterprisename,t1.amount from (select t1.* from  (select  t1.sys_enterpriseid,sum(if(t1.status='手工关闭',ifnull(t2.deliedqty,0)*t2.price,t2.amount)) amount from sa_order t1
      inner join sa_orderitems t2 on t1.sa_orderid=t2.sa_orderid and t1.siteid=t2.siteid where t1.sa_promotionid=$sa_promotionid$ and t1.siteid=$siteid$ and t1.status in('提交','审核','关闭','手工关闭') group by t1.sys_enterpriseid) t1
 ) t1 inner join sa_agents t2 on t1.sys_enterpriseid=t2.sys_enterpriseid inner join sys_enterprise t3 on t1.sys_enterpriseid=t3.sys_enterpriseid where $where$ and $tablefilter$