作者 lyh

gx

... ... @@ -37,26 +37,10 @@ class BaseLogic extends Logic
$this->request = request();
$this->requestAll = request()->all();
$this->user = Cache::get(request()->header('token'));
$this->project = $this->getProjectInfo($this->user['project_id']);
$this->project = Cache::get('user-'.$this->user['project_id']);
}
/**
* @remark :获取项目数据详情
* @name :getProjectInfo
* @author :lyh
* @method :post
* @time :2023/8/17 10:20
*/
public function getProjectInfo($id){
$projectModel = new Project();
$info = $projectModel->with('payment')->with('deploy_build')
->with('deploy_optimize')->with('online_check')->where(['id'=>$id])->first();
if($info['extend_type'] != 0){
$info['type'] = $info['extend_type'];
}
return $this->success($info);
}
/**
* 列表
* @param array $map
* @param array $sort
... ...
... ... @@ -150,15 +150,32 @@ class UserLoginLogic
}
}
//获取项目详情
$project = (new ProjectLogic())->getProjectInfo($info['project_id']);
$project = $this->getProjectInfo($info['project_id']);
$info['company'] = $project['company'] ?? '';
$info['plan'] = Project::planMap()[$project['deploy_build']['plan']];
$info['domain'] = !empty($project['deploy_optimize']['domain']) ?
$project['deploy_optimize']['domain'] : ($project['deploy_build']['test_domain'] ?? '');
//保存项目缓存
Cache::add('user-'.$project,$project);
return $this->success($info);
}
/**
* @remark :获取项目数据详情
* @name :getProjectInfo
* @author :lyh
* @method :post
* @time :2023/8/17 10:20
*/
public function getProjectInfo($id){
$projectModel = new Project();
$info = $projectModel->with('payment')->with('deploy_build')
->with('deploy_optimize')->with('online_check')->where(['id'=>$id])->first();
if($info['extend_type'] != 0){
$info['type'] = $info['extend_type'];
}
return $this->success($info);
}
/**
* @notes: 请简要描述方法功能
* @param array $data
... ...