Răsfoiți Sursa

Merge branch 'crm7.6user_try_stage' of hongze/hongze_task into master

xyxie 2 ani în urmă
părinte
comite
c2aa0628ad
2 a modificat fișierele cu 6 adăugiri și 6 ștergeri
  1. 3 3
      models/company/company.go
  2. 3 3
      models/company_product.go

+ 3 - 3
models/company/company.go

@@ -19,7 +19,7 @@ func TryOutToFormal(companyId, productId, sellerId, companyContractId int, start
 			o.Commit()
 		}
 	}()
-	sql := `UPDATE company_product SET status='正式',is_suspend=0,start_date=?,end_date=?,package_type=?,modify_time=NOW(),formal_time=NOW() WHERE company_id=? AND product_id=? `
+	sql := `UPDATE company_product SET status='正式',is_suspend=0,start_date=?,end_date=?,package_type=?,modify_time=NOW(),formal_time=NOW(),try_stage=1 WHERE company_id=? AND product_id=? `
 	_, err = o.Raw(sql, startDate, endDate, packageType, companyId, productId).Exec()
 	if err != nil {
 		return
@@ -82,7 +82,7 @@ func ApplyServiceUpdateOld(companyId, productId, sellerId, companyContractId int
 		}
 	}()
 
-	sql := `UPDATE company_product SET status='正式',start_date=?,end_date=?,modify_time=NOW() WHERE company_id=? AND product_id=? `
+	sql := `UPDATE company_product SET status='正式',start_date=?,end_date=?,modify_time=NOW(),try_stage=1 WHERE company_id=? AND product_id=? `
 	_, err = o.Raw(sql, startDate, endDate, companyId, productId).Exec()
 	if err != nil {
 		return
@@ -210,7 +210,7 @@ func ApplyServiceUpdate(companyId, productId, sellerId, companyContractId int, s
 	//}
 
 	//更新客户产品信息
-	sql = `UPDATE company_product SET status='正式',is_suspend=0,start_date=?,end_date=?,package_type=?,modify_time=NOW() WHERE company_id=? AND product_id=? `
+	sql = `UPDATE company_product SET status='正式',is_suspend=0,start_date=?,end_date=?,package_type=?,modify_time=NOW(),try_stage=1 WHERE company_id=? AND product_id=? `
 	_, err = o.Raw(sql, updateStartDateTime, updateEndDateTime, packageType, companyId, productId).Exec()
 	if err != nil {
 		return

+ 3 - 3
models/company_product.go

@@ -42,7 +42,7 @@ func CompanyFreeze(companyId, productId int) (companyReportPermissionList []*Com
 	}
 
 	//客户产品 状态 变更
-	sql := `UPDATE company_product SET status='冻结',is_formal=0,is_suspend=0,freeze_time=NOW(),modify_time=NOW(),start_date=?,end_date=?,freeze_start_date=?,freeze_end_date=? WHERE company_id=? AND product_id=? `
+	sql := `UPDATE company_product SET status='冻结',is_formal=0,is_suspend=0,freeze_time=NOW(),modify_time=NOW(),start_date=?,end_date=?,freeze_start_date=?,freeze_end_date=?,try_stage=1 WHERE company_id=? AND product_id=? `
 	_, err = o.Raw(sql, freezeStartDate, freezeEndDate, freezeStartDate, freezeEndDate, companyId, productId).Exec()
 	if err != nil {
 		return
@@ -77,7 +77,7 @@ func CompanyFreeze(companyId, productId int) (companyReportPermissionList []*Com
 func CompanyLoss(companyId, productId int) (err error) {
 	o := orm.NewOrm()
 	//客户产品状态变更
-	sql := `UPDATE company_product SET status='流失',is_formal=0,loss_time=NOW(),modify_time=NOW(),lose_reason='冻结到期系统自动流失' WHERE company_id=? AND product_id=? `
+	sql := `UPDATE company_product SET status='流失',is_formal=0,loss_time=NOW(),modify_time=NOW(),lose_reason='冻结到期系统自动流失',try_stage=1 WHERE company_id=? AND product_id=? `
 	_, err = o.Raw(sql, companyId, productId).Exec()
 	if err != nil {
 		return
@@ -99,7 +99,7 @@ func CompanyTryOut(companyId, productId int) (companyReportPermissionList []*Com
 	endDate := time.Now().AddDate(0, 2, 0).Format(utils.FormatDate)
 
 	//客户产品 状态 变更
-	sql := `UPDATE company_product SET status='试用',start_date=?,end_date=?,modify_time=NOW(),try_out_time=NOW(),renewal_reason="",package_type=0 WHERE company_id=? AND product_id=? `
+	sql := `UPDATE company_product SET status='试用',start_date=?,end_date=?,modify_time=NOW(),try_out_time=NOW(),renewal_reason="",package_type=0,try_stage=1 WHERE company_id=? AND product_id=? `
 	_, err = o.Raw(sql, startDate, endDate, companyId, productId).Exec()
 	if err != nil {
 		return