@@ -148,25 +148,25 @@ class NeedinfoService extends ServiceBase {
* @param pobj
* @returns {Promise<void>}
*/
asyncgetStatisticsByUappId(pobj){
asyncgetStatisticsByUappId(pobj){
letac=pobj.actionBody;
letsql=`SELECT uapp_id,count(*) count,DATE_FORMAT(DATE_ADD(created_at,INTERVAL 8 HOUR),'%Y-%m-%d') time FROM n_need_info WHERE deleted_at is null AND (channelTypeName <> "商标交易" or channelTypeName is not null)`;
letwhereParam={};
if(ac.start&&ac.end){
if(ac.start&&ac.end){
sql+=` AND created_at >= :start AND created_at <= :end`;
@@ -216,17 +216,17 @@ class NeedinfoService extends ServiceBase {
* @param pobj
* @returns {Promise<void>}
*/
asyncgetStatisticsByProduct(pobj){
asyncgetStatisticsByProduct(pobj){
letac=pobj.actionBody;
letsql=`select typeName typeCode,uapp_id,count(*) count from n_need_info where typeName is not null AND (channelTypeName <> "商标交易" or channelTypeName is not null) `;
letwhereParams={};
if(ac.start&&ac.end){
if(ac.start&&ac.end){
sql+=` and created_at >= :start and created_at <= :end `;
@@ -235,17 +235,17 @@ class NeedinfoService extends ServiceBase {
* @param pobj
* @returns {Promise<void>}
*/
asyncgetStatisticsByChannel(pobj){
asyncgetStatisticsByChannel(pobj){
letac=pobj.actionBody;
letsql=`select typeName typeCode,uapp_id,count(*) count from n_need_info where typeName is not null AND (channelTypeName <> "商标交易" or channelTypeName is not null) `;
letwhereParams={};
if(ac.start&&ac.end){
if(ac.start&&ac.end){
sql+=` and created_at >= :start and created_at <= :end `;
@@ -254,10 +254,10 @@ class NeedinfoService extends ServiceBase {
* @param pobj
* @returns {Promise<void>}
*/
asyncgetNeedProductType(pobj){
asyncgetNeedProductType(pobj){
letsql=`select typeName,count(*) count from n_need_info where typeName is not null AND (channelTypeName <> "商标交易" or channelTypeName is not null) GROUP BY typeName`;
letresult=awaitthis.customQuery(sql);
lettypeNames=result.map(item=>{
lettypeNames=result.map(item=>{
returnitem.typeName;
})
returnsystem.getResultSuccess(typeNames);
...
...
@@ -268,25 +268,25 @@ class NeedinfoService extends ServiceBase {
* @param pobj
* @returns {Promise<void>}
*/
asyncgetStatisticsByCity(pobj){
asyncgetStatisticsByCity(pobj){
letac=pobj.actionBody;
letsql=`select typeName typeCode,province,count(*) count from n_need_info where province is not null and typeCode is not null AND (channelTypeName <> "商标交易" or channelTypeName is not null) `;
letwhereParams={};
if(ac.start&&ac.end){
if(ac.start&&ac.end){
sql+=` and created_at >= :start and created_at <= :end `;
@@ -295,43 +295,43 @@ class NeedinfoService extends ServiceBase {
* @param pobj
* @returns {Promise<void>}
*/
asyncgetNeedComparison(pobj){
letab=pobj.actionBody;
asyncgetNeedComparison(pobj){
letab=pobj.actionBody;
letsql1=`select count(DISTINCT(channelNeedNo)) count from n_need_info where deleted_at is null AND (channelTypeName <> "商标交易" or channelTypeName is not null) `;
letsql2=`select count(DISTINCT(b.channelNeedNo)) count from n_need_info b where b.deleted_at is null and b.status = 'ycd' AND (b.channelTypeName <> "商标交易" or b.channelTypeName is not null)`;
letwhereParams={};
if(ab.startNow&&ab.endNow){
if(ab.startNow&&ab.endNow){
sql1+=` and created_at >= :start and created_at <= :end`;
sql2+=` and b.created_at >= :start and b.created_at <= :end`;
@@ -360,7 +360,7 @@ class NeedinfoService extends ServiceBase {
//需求成单总数
letneedToOrderTotalSql=`select count(DISTINCT(b.channelNeedNo)) count from n_need_info b where b.deleted_at is null and b.status = 'ycd' AND (b.channelTypeName <> "商标交易" or b.channelTypeName is not null) `;
letwhereParams={};
if(actionBody.start&&actionBody.end){
if(actionBody.start&&actionBody.end){
needSql+=` and a.created_at >= :start and a.created_at <= :end`;
needTotalSql+=` and a.created_at >= :start and a.created_at <= :end`;
needToOrderSql+=` and b.created_at >= :start and b.created_at <= :end`;
...
...
@@ -369,52 +369,52 @@ class NeedinfoService extends ServiceBase {