Jelajahi Sumber

客户启用

chengxiaowen 1 tahun lalu
induk
melakukan
4aa4a60f86
1 mengubah file dengan 3 tambahan dan 2 penghapusan
  1. 3 2
      src/main/resources/mapper/statistics/OrderMapper.xml

+ 3 - 2
src/main/resources/mapper/statistics/OrderMapper.xml

@@ -138,13 +138,14 @@
             CONCAT(',',c.customer_type_id,',') as customerTypeId
         FROM
             ${dbName}_customer.c_customer_subsidy_${operatorId} c
-                LEFT JOIN ${dbName}_order.o_order_${operatorId} o ON o.customer_id = c.customer_id
+            join (select subsidy_customer_id from  c_customer_subsidy_supplier_${operatorId} where yn =0 and enabled = 1 group by subsidy_customer_id) csp
+                on c.subsidy_customer_id = csp.subsidy_customer_id
+               LEFT JOIN ${dbName}_order.o_order_${operatorId} o ON o.customer_id = c.customer_id
         WHERE
             o.order_status = 6
           AND o.order_type = 2
           and c.yn =0
           and o.yn = 0
-          and c.enabled = 1
         GROUP BY c.now_street_id,c.customer_type_id;
     </select>