@@ -1255,7 +1255,7 @@ class OrderInfoService extends ServiceBase {
*/
asyncgetOrdersStatisticsByProduct(pobj){
letac=pobj.actionBody;
letsql=`SELECT b.channelItemName typeCode,a.uapp_id,count( * ) count FROM c_order_info a left join c_order_product b on a.orderNo = b.sourceOrderNo WHERE b.itemCode is not null `;
letsql=`SELECT b.channelItemName typeCode,a.uapp_id,count( DISTINCT(a.orderNo)) count FROM c_order_info a left join c_order_product b on a.orderNo = b.sourceOrderNo WHERE a.deleted_at is null and b.itemCode is not null `;
letwhereParams={};
if(ac.start&&ac.end){
sql+=` and a.created_at >= :start and a.created_at <= :end `;
...
...
@@ -1273,7 +1273,7 @@ class OrderInfoService extends ServiceBase {
*/
asyncgetOrdersComparison(pobj){
letab=pobj.actionBody;
letsql1=`select count(*) count from c_order_info a left join c_order_product b on a.orderNo = b.sourceOrderNo where a.deleted_at is null `;
letsql1=`select count(DISTINCT(a.orderNo)) count from c_order_info a left join c_order_product b on a.orderNo = b.sourceOrderNo where a.deleted_at is null `;
letwhereParams={};
if(ab.startNow&&ab.endNow){
sql1+=` and a.created_at >= :start and a.created_at <= :end`;