|
@@ -277,7 +277,7 @@ func InitCompanyContractMerge() {
|
|
|
//}
|
|
|
|
|
|
//func init() {
|
|
|
-// AddCompanyContractMergeByCompanyContractId(1214)
|
|
|
+// AddCompanyContractMergeByCompanyContractId(1219)
|
|
|
//}
|
|
|
|
|
|
// AddCompanyContractMergeByCompanyContractId 通过合同ID对合同进行合并
|
|
@@ -348,18 +348,22 @@ func AddCompanyContractMergeByCompanyContractId(companyContractId int) {
|
|
|
condition = " AND company_id = ? AND company_contract_merge_id != ? ORDER BY start_date DESC LIMIT 1 "
|
|
|
pars = append(pars, contractMergeInfo.CompanyId, contractMergeInfo.CompanyContractMergeId)
|
|
|
detailPrevious, e := company.GetCompanyContractMergeDetail(condition, pars)
|
|
|
- if e != nil {
|
|
|
+ if e != nil && e.Error() != utils.ErrNoRow() {
|
|
|
err = errors.New("GetCompanyContractMergeDetail-Update, Err: " + e.Error())
|
|
|
return
|
|
|
}
|
|
|
- if item.Money > detailPrevious.Money {
|
|
|
- item.PackageDifference = "增加套餐"
|
|
|
- }
|
|
|
- if item.Money == detailPrevious.Money {
|
|
|
- item.PackageDifference = "维持套餐"
|
|
|
- }
|
|
|
- if item.Money < detailPrevious.Money {
|
|
|
- item.PackageDifference = "减少套餐"
|
|
|
+ if detailPrevious == nil {
|
|
|
+ item.PackageDifference = ""
|
|
|
+ } else {
|
|
|
+ if item.Money > detailPrevious.Money {
|
|
|
+ item.PackageDifference = "增加套餐"
|
|
|
+ }
|
|
|
+ if item.Money == detailPrevious.Money {
|
|
|
+ item.PackageDifference = "维持套餐"
|
|
|
+ }
|
|
|
+ if item.Money < detailPrevious.Money {
|
|
|
+ item.PackageDifference = "减少套餐"
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
item.CompanyContractMergeId = contractMergeInfo.CompanyContractMergeId
|