|
@@ -1809,6 +1809,17 @@ func GetCompanyContractCountRaiByLastYear(companyId int, startDate string) (tota
|
|
|
startDateTimeFirst, _ := time.Parse(utils.FormatDate, firstContractRai.StartDate)
|
|
|
if startDateTime.Before(startDateTimeFirst) {
|
|
|
total = 1
|
|
|
+ return
|
|
|
+ }
|
|
|
+ //当前合同的开始时间,距离上一份合同的结束时间,超过一年,就属于新签
|
|
|
+ lastContractRai, err := company.GetLastContractRai(companyId)
|
|
|
+ if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ startDateTimeLast, _ := time.Parse(utils.FormatDate, lastContractRai.EndDate)
|
|
|
+ if startDateTime.After(startDateTimeLast) {
|
|
|
+ total = 1
|
|
|
}
|
|
|
return
|
|
|
}
|