Commit 82afa6cf by 任晓松

update

parent 9722869c
......@@ -1239,14 +1239,14 @@ class OrderInfoService extends ServiceBase {
*/
async getOrdersStatisticsByProduct(pobj){
let ac = pobj.actionBody;
let sql = `SELECT b.itemCode 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.itemName 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 whereParams = {};
if(ac.start&&ac.end){
sql += ` and a.created_at >= :start and a.created_at <= :end `;
whereParams.start = ac.start;
whereParams.end = ac.end;
}
sql += ` GROUP BY b.itemCode,a.uapp_id`;
sql += ` GROUP BY b.itemName,a.uapp_id`;
let result = await this.customQuery(sql,whereParams);
return system.getResultSuccess(result);
}
......
......@@ -214,14 +214,14 @@ class NeedinfoService extends ServiceBase {
*/
async getStatisticsByProduct(pobj){
let ac = pobj.actionBody;
let sql = `select typeCode,uapp_id,count(*) count from n_need_info where typeCode is not null `;
let sql = `select typeName typeCode,uapp_id,count(*) count from n_need_info where typeCode is not null `;
let whereParams = {};
if(ac.start&&ac.end){
sql += ` and created_at >= :start and created_at <= :end `;
whereParams.start = ac.start;
whereParams.end = ac.end;
}
sql += ` GROUP BY typeCode,uapp_id`;
sql += ` GROUP BY typeName,uapp_id`;
let result = await this.customQuery(sql,whereParams);
return system.getResultSuccess(result);
}
......
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