|
@@ -303,7 +303,9 @@ func TryOutToFormalXClassRai(companyId, productId, sellerId, companyApprovalId,
|
|
|
_ = tx.Commit()
|
|
|
}
|
|
|
}()
|
|
|
-
|
|
|
+ //123月份申请转正通过时,将试用期限延长(更新)至4.30。456月份申请转正通过时,将试用期限延长至7.31。789月份申请转正通过时,将试用期限延长至10.31。101112月份申请转正通过时,将试用期限延长至次年1.31。
|
|
|
+ endDate = utils.GetLastDayOfQuarter(time.Now()).Format(utils.FormatDate)
|
|
|
+
|
|
|
// 当套餐类型为0时, 不更新套餐类型
|
|
|
sql := `UPDATE company_product SET status='永续',try_out_time=NULL,last_description_time=NULL,freeze_time=NULL,renewal_intention=0,is_suspend=0,is_formal=1,approve_status='已审批',end_date=?,rai_package_type=?,modify_time=NOW(),formal_time=NOW(),try_stage=1 WHERE company_id=? `
|
|
|
_, err = tx.Raw(sql, endDate, raiPackageType, companyId).Exec()
|
|
@@ -338,8 +340,8 @@ func TryOutToFormalXClassRai(companyId, productId, sellerId, companyApprovalId,
|
|
|
go company_permission_log.AddCompanyPermissionLog(cpLog)
|
|
|
}
|
|
|
|
|
|
- sql = `UPDATE company_report_permission SET status='永续', end_date=? WHERE company_id=? ` // 更改权限的开始时间结束时间
|
|
|
- _, err = tx.Raw(sql, endDate, companyId).Exec()
|
|
|
+ sql = `DELETE FROM company_report_permission WHERE company_id=? AND product_id=?`
|
|
|
+ _, err = tx.Raw(sql, companyId, productId).Exec()
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
@@ -368,8 +370,21 @@ func TryOutToFormalXClassRai(companyId, productId, sellerId, companyApprovalId,
|
|
|
IsUpgrade: pv.IsUpgrade,
|
|
|
ExpensiveYx: pv.ExpensiveYx,
|
|
|
}
|
|
|
+ newId, tmpErr := tx.Insert(tmpCompanyReportPermission)
|
|
|
+ if tmpErr != nil {
|
|
|
+ err = tmpErr
|
|
|
+ return
|
|
|
+ }
|
|
|
+ tmpCompanyReportPermission.CompanyReportPermissionId = newId
|
|
|
newCompanyReportPermissionList = append(newCompanyReportPermissionList, tmpCompanyReportPermission)
|
|
|
}
|
|
|
+
|
|
|
+ sql = `UPDATE company_report_permission SET status='永续', end_date=? WHERE company_id=? ` // 更改权限的开始时间结束时间
|
|
|
+ _, err = tx.Raw(sql, endDate, companyId).Exec()
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
sql = `UPDATE company_contract SET status=1 WHERE company_contract_id=? AND company_id=? AND product_id=? `
|
|
|
_, err = tx.Raw(sql, companyContractId, companyId, productId).Exec()
|
|
|
if err != nil {
|