瀏覽代碼

状态变更时,试用标签需要重置

xiexiaoyuan 2 年之前
父節點
當前提交
7afdc5bc7b
共有 2 個文件被更改,包括 5 次插入5 次删除
  1. 1 1
      models/tables/company/company.go
  2. 4 4
      models/tables/company_approval/company_approval.go

+ 1 - 1
models/tables/company/company.go

@@ -795,7 +795,7 @@ func CompanyFreeze(companyId, productId int) (err error) {
 	freezeEndDate := time.Now().AddDate(0, 3, 0).Format(utils.FormatDate)
 
 	//修改用户产品状态
-	sql := `UPDATE company_product SET status='冻结',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='冻结',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 err

+ 4 - 4
models/tables/company_approval/company_approval.go

@@ -186,7 +186,7 @@ func TryOutToFormal(companyId, productId, sellerId, companyApprovalId, companyCo
 			o.Commit()
 		}
 	}()
-	sql := `UPDATE company_product SET status='正式',renewal_intention=0,is_suspend=0,is_formal=1,approve_status='已审批',start_date=?,end_date=?,package_type=?,modify_time=NOW(),formal_time=NOW() WHERE company_id=? AND product_id=? `
+	sql := `UPDATE company_product SET status='正式',renewal_intention=0,is_suspend=0,is_formal=1,approve_status='已审批',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
@@ -269,7 +269,7 @@ func FreezeToTryOut(companyId, productId, sellerId, companyApprovalId, applyUser
 
 	//更新用户产品状态
 	sql := `UPDATE company_product SET status='试用',approve_status='已审批',freeze_start_date=null,freeze_end_date=null,freeze_time=null,
-            start_date=?,end_date=?,seller_id=?,seller_name=?,group_id=?,department_id=?,modify_time=NOW() WHERE company_id=? AND product_id=? `
+            start_date=?,end_date=?,seller_id=?,seller_name=?,group_id=?,department_id=?,modify_time=NOW(),try_stage=1 WHERE company_id=? AND product_id=? `
 	_, err = o.Raw(sql, startDate, endDate, sellerItem.AdminId, sellerItem.RealName, sellerItem.GroupId, sellerItem.DepartmentId, companyId, productId).Exec()
 	if err != nil {
 		return
@@ -435,7 +435,7 @@ func ApplyReceive(companyId, productId, sysUserId, companyApprovalId, applyUserI
 	endDate := time.Now().AddDate(0, 2, 0).Format(utils.FormatDate)
 
 	//更新用户产品状态
-	sql := `UPDATE company_product SET status='试用',approve_status='已审批', start_date=?,end_date=?,seller_id=?,seller_name=?,group_id=?,department_id=?,modify_time=NOW() WHERE company_id=? AND product_id=? `
+	sql := `UPDATE company_product SET status='试用',approve_status='已审批', start_date=?,end_date=?,seller_id=?,seller_name=?,group_id=?,department_id=?,modify_time=NOW(),try_stage=1 WHERE company_id=? AND product_id=? `
 	_, err = o.Raw(sql, startDate, endDate, sellerItem.AdminId, sellerItem.RealName, sellerItem.GroupId, sellerItem.DepartmentId, companyId, productId).Exec()
 	if err != nil {
 		return
@@ -585,7 +585,7 @@ func ApplyServiceUpdate(companyId, productId, sellerId, companyApprovalId, compa
 	//}
 
 	//更新客户产品信息
-	sql = `UPDATE company_product SET status='正式',is_formal=1,is_suspend=0,approve_status='已审批',start_date=?,end_date=?,package_type=?,modify_time=NOW() WHERE company_id=? AND product_id=? `
+	sql = `UPDATE company_product SET status='正式',is_formal=1,is_suspend=0,approve_status='已审批',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