Commit 80eace4c by 任晓松

需求统计

parent 22c80d0c
...@@ -213,14 +213,14 @@ class NeedinfoService extends ServiceBase { ...@@ -213,14 +213,14 @@ class NeedinfoService extends ServiceBase {
*/ */
async getStatisticsByProduct(pobj){ async getStatisticsByProduct(pobj){
let ac = pobj.actionBody; let ac = pobj.actionBody;
let sql = `select typeCode,status,count(*) count from n_need_info where typeCode is not null `; let sql = `select typeCode,uapp_id,count(*) count from n_need_info where typeCode is not null `;
let whereParams = {}; let whereParams = {};
if(ac.start&&ac.end){ if(ac.start&&ac.end){
sql += ` and created_at >= :start and created_at <= :end `; sql += ` and created_at >= :start and created_at <= :end `;
whereParams.start = ac.start; whereParams.start = ac.start;
whereParams.end = ac.end; whereParams.end = ac.end;
} }
sql += ` GROUP BY typeCode,status`; sql += ` GROUP BY typeCode,uapp_id`;
let result = await this.customQuery(sql,whereParams); let result = await this.customQuery(sql,whereParams);
return system.getResultSuccess(result); 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