This commit is contained in:
yan.y 2025-01-04 23:05:32 +08:00
parent 54a082f8f1
commit 596645cbf1
1 changed files with 3 additions and 3 deletions

View File

@ -161,11 +161,11 @@ func (p DefParty) orderCreate() web_iris.Party {
}
}
}
/*haveReserve := checkOrderServiceTime(orderCreateRequest.ServiceTime, projectionServiceTime)
haveReserve := checkOrderServiceTime(orderCreateRequest.ServiceTime, projectionServiceTime)
if haveReserve {
OrderCreateError.DefFail(ctx, orderCreateRequest, "当前订单预估服务时长预计:"+strconv.Itoa(projectionServiceTime)+"分钟,服务时间过长,请更换时间段预约或联系客服协助预约")
return
}*/
}
for _, value := range orderCreateRequest.PetGoodsInfos {
userPet := GetUserPet(headerBaseInfo.Uid, value.PetId)
if userPet.PetInfo.Vaccine == 0 {
@ -563,7 +563,7 @@ func checkOrderServiceTime(serviceTime string, projectionServiceTime int) bool {
database.Instance().Model(&models.OrderMain{}).Where("service_time >= ? and service_time < DATE_FORMAT(DATE_ADD('"+serviceTime+"', INTERVAL "+strconv.Itoa(projectionServiceTime)+" MINUTE), '%Y-%m-%d %H:%i') and order_status != 3 and order_status != 4 and status = 1", serviceTime).Find(&orderMainTmpList)
//时间点订单数量<服务车辆*车辆单次服务数量 才可接受预约
if len(orderMainTmpList) > 0 {
return len(orderMainTmpList) < len(CarMap)*CarServiceNum
return len(orderMainTmpList) >= len(CarMap)*CarServiceNum
}
return false
}