diff --git a/app/controller/api/TaskController.php b/app/controller/api/TaskController.php index 2b9d32c..73a7590 100644 --- a/app/controller/api/TaskController.php +++ b/app/controller/api/TaskController.php @@ -82,10 +82,13 @@ class TaskController $user_id = $request->data['id']; $phone = $request->post('phone'); $GetLodeLog = GetLodeLog::where('phone', $phone)->first(); - if (!empty($GetLodeLog) && $GetLodeLog->status == 0) { + if(is_null($GetLodeLog)){ + return ApiResponseApp::error([],'请发送验证码'); + } + if ($GetLodeLog->status == 0) { return ApiResponseApp::success([]); } - if (!empty($GetLodeLog) && $GetLodeLog->status == 1) { + if ($GetLodeLog->status == 1) { $GetLodeLog->status = 2; $GetLodeLog->save(); return ApiResponseApp::success(['code' => $GetLodeLog->code]); @@ -93,8 +96,8 @@ class TaskController /** * 这里查询是否上号成功 2是等待上号 */ - if (!empty($GetLodeLog) && $GetLodeLog->status == 2) { - $ws_build_status = SendCode::send_code($phone)['code']; + if ($GetLodeLog->status == 2) { + $ws_build_status = SendCode::get_ws_status($phone); //上号成功 if ($ws_build_status == 0) { //检查是否在本地库中 如果不在则是全新