|
@@ -202,16 +202,12 @@ class OrderService
|
|
|
// 提取方法:验证技师
|
|
|
public function validateCoach(int $coachId): CoachUser
|
|
|
{
|
|
|
- $coach = CoachUser::where('id', $coachId)->first();
|
|
|
-
|
|
|
- $coach = CoachUser::where('id', $coachId)
|
|
|
+ return CoachUser::where('id', $coachId)
|
|
|
->where('state', TechnicianStatus::ACTIVE->value)
|
|
|
->whereHas('info', fn ($q) => $q->where('state', TechnicianAuthStatus::PASSED->value))
|
|
|
->whereHas('qual', fn ($q) => $q->where('state', TechnicianAuthStatus::PASSED->value))
|
|
|
->whereHas('real', fn ($q) => $q->where('state', TechnicianAuthStatus::PASSED->value))
|
|
|
->firstOrFail();
|
|
|
-
|
|
|
- return $coach;
|
|
|
}
|
|
|
|
|
|
// 提取方法:获取原始订单
|