Commit 91cdcec0 by 胡悦

添加默认时间查询最早20170101

1 parent 4286e193
/* /*
* @Author: chenwq * @Author: chenwq
* @Date: 2020-06-16 10:02:28 * @Date: 2020-06-16 10:02:28
* @Last Modified by: chenwq * @Last Modified by: huyue
* @Last Modified time: 2020-06-19 17:26:03 * @Last Modified time: 2020-06-24 16:52:20
* 出货统计 * 出货统计
*/ */
const Service = require("egg").Service; const Service = require("egg").Service;
...@@ -23,6 +23,7 @@ class deliveryServices extends Service { ...@@ -23,6 +23,7 @@ class deliveryServices extends Service {
} = this.app.model.Biz; } = this.app.model.Biz;
this.GBDL = GlsxBizDelivery; this.GBDL = GlsxBizDelivery;
this.MDSM = DjSystemMerchant; this.MDSM = DjSystemMerchant;
this.defaultYear = 2017
} }
/** /**
...@@ -85,6 +86,10 @@ class deliveryServices extends Service { ...@@ -85,6 +86,10 @@ class deliveryServices extends Service {
[Op.lt]: nextDate.getFullYear() + '-' + nextMonth [Op.lt]: nextDate.getFullYear() + '-' + nextMonth
}] }]
} }
} else {
where[item.sqlName] = {
[Op.gte]: this.defaultYear
}
} }
}) })
likeArr.map(item => { likeArr.map(item => {
...@@ -155,6 +160,10 @@ class deliveryServices extends Service { ...@@ -155,6 +160,10 @@ class deliveryServices extends Service {
[Op.lt]: nextDate.getFullYear() + '-' + nextMonth [Op.lt]: nextDate.getFullYear() + '-' + nextMonth
}] }]
} }
} else {
where[item.sqlName] = {
[Op.gte]: this.defaultYear
}
} }
}) })
likeArr.map(item => { likeArr.map(item => {
......
/* /*
* @Author: huyue * @Author: huyue
* @Date: 2020-06-16 15:36:11 * @Date: 2020-06-16 15:36:11
* @Last Modified by: chenwq * @Last Modified by: huyue
* @Last Modified time: 2020-06-19 11:40:03 * @Last Modified time: 2020-06-24 16:54:23
*/ */
const Service = require("egg").Service; const Service = require("egg").Service;
...@@ -23,6 +23,7 @@ class OpportunityService extends Service { ...@@ -23,6 +23,7 @@ class OpportunityService extends Service {
} = this.app.model.Biz; } = this.app.model.Biz;
this.MGBO = GlsxBizOpportunity; this.MGBO = GlsxBizOpportunity;
this.MDSM = DjSystemMerchant; this.MDSM = DjSystemMerchant;
this.defaultYear = 2017
} }
/** /**
...@@ -58,6 +59,10 @@ class OpportunityService extends Service { ...@@ -58,6 +59,10 @@ class OpportunityService extends Service {
let merchantWhere = {} let merchantWhere = {}
if (month) { if (month) {
where.month = month where.month = month
} else {
where.month = {
[Op.gte]: this.defaultYear
}
} }
if (merchantName) { if (merchantName) {
const __like = `%${merchantName}%` const __like = `%${merchantName}%`
...@@ -102,6 +107,10 @@ class OpportunityService extends Service { ...@@ -102,6 +107,10 @@ class OpportunityService extends Service {
let merchantWhere = {} let merchantWhere = {}
if (month) { if (month) {
where.month = month where.month = month
} else {
where.month = {
[Op.gte]: this.defaultYear
}
} }
if (merchantName) { if (merchantName) {
const __like = `%${merchantName}%` const __like = `%${merchantName}%`
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!