|
@@ -222,7 +222,7 @@ func (this *StatisticCompanyMergerController) MergeCompanyList() {
|
|
|
} else {
|
|
|
condition1, pars1 = getQueryParams(condition1, pars1, sysUser, "c.")
|
|
|
}
|
|
|
- condition1 += ` AND a.create_time >= ? AND a.create_time <= ? AND a.operation in ("add","receive") AND b.company_id NOT IN ( SELECT company_id FROM company_operation_record WHERE product_id = 2 AND operation ="loss" GROUP BY company_id ) `
|
|
|
+ condition1 += ` AND a.create_time >= ? AND a.create_time <= ? AND a.operation in ("add","receive") AND b.company_id NOT IN ( SELECT company_id FROM company_operation_record WHERE product_id = 2 AND operation ="loss" GROUP BY company_id ) AND c.status = '试用' `
|
|
|
pars1 = append(pars1, startDate, endDate)
|
|
|
|
|
|
total, err := models.GetIncrementalCompanyCountByOperationRecord(condition1, pars1)
|
|
@@ -2342,7 +2342,7 @@ func init323() {
|
|
|
}
|
|
|
|
|
|
//func init() {
|
|
|
-// init16_1_03()
|
|
|
+// init16_1_05()
|
|
|
//}
|
|
|
|
|
|
func init16_1_01() {
|
|
@@ -2422,6 +2422,56 @@ func init16_1_03() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+func init16_1_04() {
|
|
|
+ var condition string
|
|
|
+ var pars []interface{}
|
|
|
+
|
|
|
+ condition = " AND product_id = 2 AND seller_id_init = 0 "
|
|
|
+
|
|
|
+ CompanyApprovalList, e := company.GetCompanyContracList(condition, pars)
|
|
|
+ if e != nil && e.Error() != utils.ErrNoRow() {
|
|
|
+ fmt.Println(e)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ for _, v := range CompanyApprovalList {
|
|
|
+ productItem, e := company.GetCompanyProductByCompanyIdAndProductId(v.CompanyId, 2)
|
|
|
+ if e != nil && e.Error() != utils.ErrNoRow() {
|
|
|
+ fmt.Println(e)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if productItem == nil {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ e = company.UpdateCompanyContractTypeinit16_1_02(productItem.SellerName, productItem.SellerId, v.CompanyContractId)
|
|
|
+ if e != nil {
|
|
|
+ fmt.Println(e)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+//func init16_1_05() {
|
|
|
+// var condition string
|
|
|
+// var pars []interface{}
|
|
|
+//
|
|
|
+// condition = " AND product_id = 2 "
|
|
|
+//
|
|
|
+// listProduct, e := company.GetCompanyProductList(condition, pars)
|
|
|
+// if e != nil {
|
|
|
+// fmt.Println(e)
|
|
|
+// return
|
|
|
+// }
|
|
|
+// for _, v := range listProduct {
|
|
|
+// e = company.UpdateCompanyProductSellerUnexpiredInitinit16_1_05(v.SellerId, v.SellerName, v.CompanyId)
|
|
|
+// if e != nil {
|
|
|
+// fmt.Println(e)
|
|
|
+// return
|
|
|
+// }
|
|
|
+// }
|
|
|
+// fmt.Println("end")
|
|
|
+//}
|
|
|
+
|
|
|
//更新权益销客户后一个正式的销售为当前销售
|
|
|
//func init(){
|
|
|
// SELECT * FROM company_product WHERE 1= 1 AND product_id =2 AND share_seller_id > 0 ;
|