Commit 16e43bc7 by 任晓松

update

parent dc428cc6
......@@ -1255,7 +1255,7 @@ class OrderInfoService extends ServiceBase {
*/
async getOrdersStatisticsByProduct(pobj){
let ac = pobj.actionBody;
let sql = `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 `;
let sql = `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 `;
let whereParams = {};
if(ac.start&&ac.end){
sql += ` and a.created_at >= :start and a.created_at <= :end `;
......@@ -1273,7 +1273,7 @@ class OrderInfoService extends ServiceBase {
*/
async getOrdersComparison(pobj){
let ab =pobj.actionBody;
let sql1 = `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 `;
let sql1 = `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 `;
let whereParams = {};
if(ab.startNow&&ab.endNow){
sql1 += ` and a.created_at >= :start and a.created_at <= :end`;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment