作者 lyh

Merge branch 'master' of http://47.244.231.31:8099/zhl/globalso-v6 into develop

... ... @@ -90,31 +90,22 @@ class ProjectController extends BaseController
}
/**
* @remark :type类型
* @name :searchType
* @author :lyh
* @method :post
* @time :2023/8/30 10:14
* 搜索项目状态
* @param $query
* @return mixed
*/
public function searchType(&$query){
if($this->map['type'] == Project::TYPE_ZERO){
$query->where('gl_project.type',Project::TYPE_ZERO);
}elseif ($this->map['type'] == Project::TYPE_ONE){
$query->where('gl_project.type',Project::TYPE_ONE);
}elseif ($this->map['type'] == Project::TYPE_TWO){
$query->whereIn('gl_project.type', [Project::TYPE_TWO,Project::TYPE_THREE]);
}else{
if (in_array($this->map['type'], [Project::TYPE_ZERO, Project::TYPE_ONE, Project::TYPE_TWO, Project::TYPE_THREE]))
$query->where('gl_project.type', $this->map['type']);
else{
$query->whereIn('gl_project.type', [Project::TYPE_FOUR,Project::TYPE_SIX]);
}
return $query;
}
/**
* @remark :查询字段处理
* @name :selectParam
* @author :lyh
* @method :post
* @time :2023/8/18 10:59
* 需要查询的字段
* @return array
*/
public function selectParam(){
$select = [
... ... @@ -154,19 +145,22 @@ class ProjectController extends BaseController
}
/**
* @remark :按需搜索
* @name :searchDomainTitle
* @author :lyh
* @method :post
* @time :2023/9/7 18:39
* 搜索框
* @param $query
* @return mixed
*/
public function searchContent(&$query){
if(!empty($this->map['search']) && !empty($this->map['search_type'])){
//搜索域名
$query->where(function ($subQuery) {
$subQuery->orwhere('gl_project_deploy_optimize.domain','like','%'.$this->map['search'].'%')
->orwhere('gl_project.company','like','%'.$this->map['search'].'%')
->orwhere('gl_project.title','like','%'.$this->map['search'].'%');
// 搜索域名
if ($this->map['search_type'] == 'domain') {
$ids = DomainInfo::where('domain', 'like', '%'.$this->map['search'].'%')->pluck('id')->toArray();
$subQuery->whereIn('gl_project_deploy_optimize.domain', $ids);
} else {
// 搜索名称
$subQuery->orwhere('gl_project.company','like','%'.$this->map['search'].'%')
->orwhere('gl_project.title','like','%'.$this->map['search'].'%');
}
});
}
return $query;
... ...
... ... @@ -33,6 +33,14 @@ class ComController extends BaseController
$this->map = $this->getAdminMenuCondition();
}
$lists = $projectMenuModel->list($this->map,'sort');
foreach ($lists as $k => $v){
$v = (array)$v;
if(empty($this->user['is_upload_manage'])){
if($v['rules'] == '/fileUpload'){
unset($lists[$k]);
}
}
}
$menu = array();
foreach ($lists as $k => $v){
$v = (array)$v;
... ...
... ... @@ -28,6 +28,14 @@ class RoleLogic extends BaseLogic
$menuModel = new ProjectMenuModel();
//根据当前登录用户角色返回用户菜单列表
$lists = $menuModel->where(['status'=>0])->get()->toArray();
foreach ($lists as $k => $v){
$v = (array)$v;
if(empty($this->user['is_upload_manage'])){
if($v['rules'] == '/fileUpload'){
unset($lists[$k]);
}
}
}
$menu = array();
foreach ($lists as $v){
$v = (array)$v;
... ...
... ... @@ -165,6 +165,9 @@ class UserLoginLogic
$info['hagro'] = $project['hagro'] ?? '';
$info['plan'] = Project::planMap()[$project['deploy_build']['plan']];
$info['domain'] = (!empty($project['deploy_optimize']['domain']) ? ((new DomainInfo())->getDomain($project['deploy_optimize']['domain'])) : ($project['deploy_build']['test_domain'] ?? ''));
$info['is_customized'] = $project['is_customized'];
$info['is_upload_manage'] = $project['is_upload_manage'];
$info['upload_config'] = $project['upload_config'];
//保存项目缓存
Cache::put('user-'.$info['project_id'],$project,$minutes = null);
return $this->success($info);
... ...