@@ -149,7 +149,7 @@ class NeedinfoService extends ServiceBase {
...
@@ -149,7 +149,7 @@ class NeedinfoService extends ServiceBase {
*/
*/
asyncgetStatisticsByUappId(pobj){
asyncgetStatisticsByUappId(pobj){
letac=pobj.actionBody;
letac=pobj.actionBody;
letsql=`SELECT uapp_id,count(*) count,DATE_FORMAT(created_at,'%Y-%m-%d') time FROM n_need_info WHERE deleted_at is null AND (channelTypeName <> "商标交易" or channelTypeName is null)`;
letsql=`SELECT uapp_id,count(*) count,DATE_FORMAT(created_at,'%Y-%m-%d') time FROM n_need_info WHERE deleted_at is null AND (channelTypeName <> "商标交易" or channelTypeName is not null)`;
letwhereParam={};
letwhereParam={};
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`;
...
@@ -176,7 +176,7 @@ class NeedinfoService extends ServiceBase {
...
@@ -176,7 +176,7 @@ class NeedinfoService extends ServiceBase {
*/
*/
asyncgetNeedFunnelStatistics(pobj){
asyncgetNeedFunnelStatistics(pobj){
letac=pobj.actionBody;
letac=pobj.actionBody;
letsql=`select count(*) count from n_need_info where deleted_at is null AND (channelTypeName <> "商标交易" or channelTypeName is null) `;
letsql=`select count(*) count from n_need_info where deleted_at is null AND (channelTypeName <> "商标交易" or channelTypeName is not null) `;
letsql2=sql+` and status in('ygj','ygb','ycd')`;
letsql2=sql+` and status in('ygj','ygb','ycd')`;
letsql3=sql+` and status = 'ycd'`;
letsql3=sql+` and status = 'ycd'`;
letwhereParams={};
letwhereParams={};
...
@@ -217,7 +217,7 @@ class NeedinfoService extends ServiceBase {
...
@@ -217,7 +217,7 @@ class NeedinfoService extends ServiceBase {
*/
*/
asyncgetStatisticsByProduct(pobj){
asyncgetStatisticsByProduct(pobj){
letac=pobj.actionBody;
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 null) `;
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={};
letwhereParams={};
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 `;
...
@@ -235,7 +235,7 @@ class NeedinfoService extends ServiceBase {
...
@@ -235,7 +235,7 @@ class NeedinfoService extends ServiceBase {
* @returns {Promise<void>}
* @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 null) GROUP BY typeName`;
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);
letresult=awaitthis.customQuery(sql);
lettypeNames=result.map(item=>{
lettypeNames=result.map(item=>{
returnitem.typeName;
returnitem.typeName;
...
@@ -250,7 +250,7 @@ class NeedinfoService extends ServiceBase {
...
@@ -250,7 +250,7 @@ class NeedinfoService extends ServiceBase {
*/
*/
asyncgetStatisticsByCity(pobj){
asyncgetStatisticsByCity(pobj){
letac=pobj.actionBody;
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 null) `;
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={};
letwhereParams={};
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 `;
...
@@ -277,8 +277,8 @@ class NeedinfoService extends ServiceBase {
...
@@ -277,8 +277,8 @@ class NeedinfoService extends ServiceBase {
*/
*/
asyncgetNeedComparison(pobj){
asyncgetNeedComparison(pobj){
letab=pobj.actionBody;
letab=pobj.actionBody;
letsql1=`select count(DISTINCT(channelNeedNo)) count from n_need_info where deleted_at is null AND (channelTypeName <> "商标交易" or channelTypeName is null) `;
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_solution a left join n_need_info b on a.needNo = b.needNo where a.deleted_at is null and b.status = 'ycd' AND (b.channelTypeName <> "商标交易" or b.channelTypeName is 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={};
letwhereParams={};
if(ab.startNow&&ab.endNow){
if(ab.startNow&&ab.endNow){
sql1+=` and created_at >= :start and created_at <= :end`;
sql1+=` and created_at >= :start and created_at <= :end`;
...
@@ -332,13 +332,13 @@ class NeedinfoService extends ServiceBase {
...
@@ -332,13 +332,13 @@ class NeedinfoService extends ServiceBase {
}
}
lettag=actionBody.tag;
lettag=actionBody.tag;
//需求列表
//需求列表
letneedSql=`select DISTINCT(a.channelNeedNo),b.app_name,a.needNo,a.typeName,a.province,a.city,a.publishContent,a.publishName,a.publishMobile,a.statusName,a.created_at from center_order.n_need_info a left join center_app.p_app b on a.uapp_id = b.uapp_id where a.deleted_at is null AND (a.channelTypeName <> "商标交易" or a.channelTypeName is null) `;
letneedSql=`select DISTINCT(a.channelNeedNo),b.app_name,a.needNo,a.typeName,a.province,a.city,a.publishContent,a.publishName,a.publishMobile,a.statusName,a.created_at from center_order.n_need_info a left join center_app.p_app b on a.uapp_id = b.uapp_id where a.deleted_at is null AND (a.channelTypeName <> "商标交易" or a.channelTypeName is not null) `;
//需求总数
//需求总数
letneedTotalSql=`select count(DISTINCT(a.channelNeedNo)) count from center_order.n_need_info a left join center_app.p_app b on a.uapp_id = b.uapp_id where a.deleted_at is null AND (a.channelTypeName <> "商标交易" or a.channelTypeName is null) `;
letneedTotalSql=`select count(DISTINCT(a.channelNeedNo)) count from center_order.n_need_info a left join center_app.p_app b on a.uapp_id = b.uapp_id where a.deleted_at is null AND (a.channelTypeName <> "商标交易" or a.channelTypeName is not null) `;
//需求成单
//需求成单
letneedToOrderSql=`select DISTINCT(b.channelNeedNo),c.app_name,b.channelNeedNo,b.province,b.city,b.typeName,b.publishContent,b.publishName,b.publishMobile,b.statusName,b.created_at from center_order.n_need_solution a left join center_order.n_need_info b on a.needNo = b.needNo left join center_app.p_app c on b.uapp_id = c.uapp_id where a.deleted_at is null and b.status = 'ycd' AND (b.channelTypeName <> "商标交易" or b.channelTypeName is null) `;
letneedToOrderSql=`select DISTINCT(b.channelNeedNo),c.app_name,b.channelNeedNo,b.province,b.city,b.typeName,b.publishContent,b.publishName,b.publishMobile,b.statusName,b.created_at from center_order.n_need_info b inner join center_app.p_app c on b.uapp_id = c.uapp_id where b.deleted_at is null and b.status = 'ycd' AND (b.channelTypeName <> "商标交易" or b.channelTypeName is not null) `;
//需求成单总数
//需求成单总数
letneedToOrderTotalSql=`select count(DISTINCT(a.channelNeedNo)) count from n_need_solution a left join n_need_info b on a.needNo = b.needNo where a.deleted_at is null and b.status = 'ycd' AND (b.channelTypeName <> "商标交易" or b.channelTypeName is null) `;
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={};
letwhereParams={};
if(actionBody.start&&actionBody.end){
if(actionBody.start&&actionBody.end){
needSql+=` and a.created_at >= :start and a.created_at <= :end`;
needSql+=` and a.created_at >= :start and a.created_at <= :end`;