|
...
|
...
|
@@ -13,6 +13,7 @@ use App\Models\Product\Product; |
|
|
|
use App\Models\Project\OnlineCheck;
|
|
|
|
use App\Models\Project\Project;
|
|
|
|
use App\Models\RouteMap\RouteMap;
|
|
|
|
use App\Models\User\User;
|
|
|
|
use App\Services\ProjectServer;
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
|
|
...
|
...
|
@@ -98,4 +99,32 @@ class PrivateController extends BaseController |
|
|
|
}
|
|
|
|
return $this->success($result);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 验证当前用户是否存在
|
|
|
|
* TODO 查询手机号码是否是项目用户, 如果升级项目未上线项目return false;
|
|
|
|
* @param Request $request
|
|
|
|
* @return false|string
|
|
|
|
*/
|
|
|
|
public function hasUser(Request $request)
|
|
|
|
{
|
|
|
|
// 获取数据,初始化信息
|
|
|
|
$mobile = trim($request->input('mobile'));
|
|
|
|
$result = ['mobile' => $mobile, 'v6_user' => false];
|
|
|
|
|
|
|
|
// 获取用户,验证用户
|
|
|
|
$project_ids = User::where(['mobile' => $mobile])->pluck('project_id')->toArray();
|
|
|
|
if (empty($project_ids))
|
|
|
|
return $this->success($result);
|
|
|
|
|
|
|
|
$projects = Project::whereIn('id', $project_ids)->where('delete_status', 0)->get();
|
|
|
|
foreach ($projects as $project) {
|
|
|
|
// 如果是升级项目 并且未上线状态,不算做有效用户
|
|
|
|
if ($project->is_upgrade == Project::IS_UPGRADE_TRUE && $project->type <= Project::TYPE_ONE)
|
|
|
|
continue;
|
|
|
|
$result['v6_user'] = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $this->success($result);
|
|
|
|
}
|
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|