|
@@ -67,7 +67,7 @@ func GetCompany() (items []*Company, err error) {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
-//待冻结客户
|
|
|
|
|
|
+// 待冻结客户
|
|
type CompanyNeedFreeze struct {
|
|
type CompanyNeedFreeze struct {
|
|
CompanyId int
|
|
CompanyId int
|
|
CompanyProductId int
|
|
CompanyProductId int
|
|
@@ -94,19 +94,19 @@ func GetCompanyNeedLoss(endDate string) (items []*CompanyNeedFreeze, err error)
|
|
FROM company AS a
|
|
FROM company AS a
|
|
INNER JOIN company_product AS b ON a.company_id=b.company_id
|
|
INNER JOIN company_product AS b ON a.company_id=b.company_id
|
|
WHERE b.status='冻结'
|
|
WHERE b.status='冻结'
|
|
- AND b.freeze_end_date<=? `
|
|
|
|
|
|
+ AND b.freeze_end_date<=? AND b.init_status != '永续' ` // 权益的永续客户冻结不转流失
|
|
_, err = o.Raw(sql, endDate).QueryRows(&items)
|
|
_, err = o.Raw(sql, endDate).QueryRows(&items)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
-//正式
|
|
|
|
|
|
+// 正式
|
|
func GetCompanyNeedTryOut(endDate string) (items []*CompanyNeedFreeze, err error) {
|
|
func GetCompanyNeedTryOut(endDate string) (items []*CompanyNeedFreeze, err error) {
|
|
o := orm.NewOrm()
|
|
o := orm.NewOrm()
|
|
sql := `SELECT a.company_id,b.company_product_id,b.product_id,a.company_name,b.product_name,b.status
|
|
sql := `SELECT a.company_id,b.company_product_id,b.product_id,a.company_name,b.product_name,b.status
|
|
FROM company AS a
|
|
FROM company AS a
|
|
INNER JOIN company_product AS b ON a.company_id=b.company_id
|
|
INNER JOIN company_product AS b ON a.company_id=b.company_id
|
|
WHERE b.status='正式'
|
|
WHERE b.status='正式'
|
|
- AND b.end_date<=? `
|
|
|
|
|
|
+ AND b.end_date<=? AND b.init_status != '永续' ` //权益的永续客户正式不转试用
|
|
_, err = o.Raw(sql, endDate).QueryRows(&items)
|
|
_, err = o.Raw(sql, endDate).QueryRows(&items)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -138,3 +138,15 @@ func ModifyCompanyIndustry(industryId, companyId int, industryName string) (err
|
|
_, err = o.Raw(sql, industryId, industryName, companyId).Exec()
|
|
_, err = o.Raw(sql, industryId, industryName, companyId).Exec()
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+// 正式
|
|
|
|
+func GetCompanyNeedTryOutXClassRai(endDate string) (items []*CompanyNeedFreeze, err error) {
|
|
|
|
+ o := orm.NewOrm()
|
|
|
|
+ sql := `SELECT a.company_id,b.company_product_id,b.product_id,a.company_name,b.product_name,b.status
|
|
|
|
+ FROM company AS a
|
|
|
|
+ INNER JOIN company_product AS b ON a.company_id=b.company_id
|
|
|
|
+ WHERE b.status='正式'
|
|
|
|
+ AND b.end_date<=? AND b.init_status = '永续' ` //权益的永续客户正式不转试用
|
|
|
|
+ _, err = o.Raw(sql, endDate).QueryRows(&items)
|
|
|
|
+ return
|
|
|
|
+}
|