|
@@ -1,15 +1,15 @@
|
|
|
package company
|
|
|
|
|
|
import (
|
|
|
+ "github.com/rdlucklib/rdluck_tools/orm"
|
|
|
"hongze/hongze_task/models"
|
|
|
"hongze/hongze_task/models/company_contract"
|
|
|
"hongze/hongze_task/utils"
|
|
|
- "github.com/rdlucklib/rdluck_tools/orm"
|
|
|
"time"
|
|
|
)
|
|
|
|
|
|
-//试用转正式
|
|
|
-func TryOutToFormal(companyId, productId, sellerId, companyContractId int, startDate, endDate, sellerName, productName string) (err error) {
|
|
|
+// TryOutToFormal 试用转正式
|
|
|
+func TryOutToFormal(companyId, productId, sellerId, companyContractId int, startDate, endDate, sellerName, productName string, packageType int) (err error) {
|
|
|
o := orm.NewOrm()
|
|
|
o.Begin()
|
|
|
defer func() {
|
|
@@ -19,8 +19,8 @@ func TryOutToFormal(companyId, productId, sellerId, companyContractId int, start
|
|
|
o.Commit()
|
|
|
}
|
|
|
}()
|
|
|
- sql := `UPDATE company_product SET status='正式',is_suspend=0,start_date=?,end_date=?,modify_time=NOW(),formal_time=NOW() WHERE company_id=? AND product_id=? `
|
|
|
- _, err = o.Raw(sql, startDate, endDate, companyId, productId).Exec()
|
|
|
+ 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=? `
|
|
|
+ _, err = o.Raw(sql, startDate, endDate, packageType, companyId, productId).Exec()
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
@@ -132,7 +132,7 @@ func ApplyServiceUpdateOld(companyId, productId, sellerId, companyContractId int
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-func ApplyServiceUpdate(companyId, productId, sellerId, companyContractId int, startDate, endDate, sellerName, productName string) (err error) {
|
|
|
+func ApplyServiceUpdate(companyId, productId, sellerId, companyContractId int, startDate, endDate, sellerName, productName string, packageType int) (err error) {
|
|
|
o := orm.NewOrm()
|
|
|
o.Begin()
|
|
|
defer func() {
|
|
@@ -210,8 +210,8 @@ func ApplyServiceUpdate(companyId, productId, sellerId, companyContractId int, s
|
|
|
//}
|
|
|
|
|
|
//更新客户产品信息
|
|
|
- sql = `UPDATE company_product SET status='正式',is_suspend=0,start_date=?,end_date=?,modify_time=NOW() WHERE company_id=? AND product_id=? `
|
|
|
- _, err = o.Raw(sql, updateStartDateTime, updateEndDateTime, companyId, productId).Exec()
|
|
|
+ sql = `UPDATE company_product SET status='正式',is_suspend=0,start_date=?,end_date=?,package_type=?,modify_time=NOW() WHERE company_id=? AND product_id=? `
|
|
|
+ _, err = o.Raw(sql, updateStartDateTime, updateEndDateTime, packageType, companyId, productId).Exec()
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|