|
...
|
...
|
@@ -254,6 +254,7 @@ class LoginController extends BaseController |
|
|
|
}
|
|
|
|
//没有from_order_id的项目 进入演示版 运营中心
|
|
|
|
$arr['from_order_id'] = $arr['from_order_id'] ?? 0;
|
|
|
|
$arr['phone'] = $arr['phone'] ?? '';
|
|
|
|
if(!$arr['from_order_id']){
|
|
|
|
//有账号就直接登录, 没有账号创建账号登录
|
|
|
|
$user = (new User())->where('project_id', Project::DEMO_PROJECT_ID)->where('mobile', $arr['phone'])->first();
|
|
...
|
...
|
@@ -272,21 +273,21 @@ class LoginController extends BaseController |
|
|
|
$dept_user->user_id = $user->id;
|
|
|
|
$dept_user->save();
|
|
|
|
}
|
|
|
|
$data = [
|
|
|
|
'user_id'=>$user['id'],
|
|
|
|
'manager_id'=>0,
|
|
|
|
];
|
|
|
|
}else{
|
|
|
|
//有from_order_id, 找到对应的项目并登录主账号
|
|
|
|
//有from_order_id, 找到对应的项目并登录对应账号
|
|
|
|
$project = (new Project())->read(['from_order_id'=>$arr['from_order_id'], 'delete_status' => Project::IS_DEL_FALSE]);
|
|
|
|
if(!$project){
|
|
|
|
$this->response('项目不存在,请联系管理员',Code::USER_ERROR);
|
|
|
|
}
|
|
|
|
$data = [
|
|
|
|
'project_id'=>$project['id'],
|
|
|
|
'manager_id'=>0,
|
|
|
|
];
|
|
|
|
$user = (new User())->where('project_id', $project['id'])->where('mobile', $arr['phone'])->first();
|
|
|
|
if(!$user){
|
|
|
|
$this->response('账号不存在,请联系管理员',Code::USER_ERROR);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$data = [
|
|
|
|
'user_id'=>$user['id'],
|
|
|
|
'manager_id'=>0,
|
|
|
|
];
|
|
|
|
$info = $logic->autologin($data);
|
|
|
|
$this->response('success',Code::SUCCESS,['info'=>$info]);
|
|
|
|
}
|
...
|
...
|
|