作者 linmadan

修复申请完成任务bug

... ... @@ -45,7 +45,7 @@ func (service *ApplyCompleteTaskService) ApplyComplete(taskId int64, receiverUid
return nil, fmt.Errorf("无效的任务")
}
if task.TaskType == domain.TASK_TYPE_ROB {
if task.RobInfo.Receiver != nil {
if task.RobInfo != nil && task.RobInfo.Receiver != nil {
if receiver.EmployeeInfo.Uid != task.RobInfo.Receiver.Uid {
return nil, fmt.Errorf("无法申请完成别人领取的任务")
}
... ... @@ -54,7 +54,7 @@ func (service *ApplyCompleteTaskService) ApplyComplete(taskId int64, receiverUid
}
}
if task.TaskType == domain.TASK_TYPE_BID {
if task.BidInfo.SuccessfulBidder != nil {
if task.BidInfo != nil && task.BidInfo.SuccessfulBidder != nil {
if receiver.EmployeeInfo.Uid != task.BidInfo.SuccessfulBidder.Uid {
return nil, fmt.Errorf("无法申请完成别人领取的任务")
}
... ...