作者 lyh

gx

... ... @@ -205,9 +205,9 @@ class BlogLogic extends BaseLogic
$data = ['dra'=>0,'pub'=>1,'del'=>2,'tal'=>3];
foreach ($data as $k => $v){
if($v == 3){
$data[$k] = $this->model->count();
$data[$k] = $this->model->where(['project_id'=>$this->user['project_id']])->count();
}else{
$data[$k] = $this->model->where(['status'=>$v])->count();
$data[$k] = $this->model->where(['status'=>$v,'project_id'=>$this->user['project_id']])->count();
}
}
return $this->success($data);
... ...
... ... @@ -201,9 +201,9 @@ class NewsLogic extends BaseLogic
$data = ['dra'=>0,'pub'=>1,'del'=>2,'tal'=>3];
foreach ($data as $k => $v){
if($v == 3){
$data[$k] = $this->model->count();
$data[$k] = $this->model->where(['project_id'=>$this->user['project_id']])->count();
}else{
$data[$k] = $this->model->where(['status'=>$v])->count();
$data[$k] = $this->model->where(['status'=>$v,'project_id'=>$this->user['project_id']])->count();
}
}
return $this->success($data);
... ...
... ... @@ -25,12 +25,15 @@ class RoleLogic extends BaseLogic
* @time :2023/6/17 16:40
*/
public function role_get_menu(){
$menuModel = new ProjectMenuModel();
//根据当前登录用户角色返回用户菜单列表
if($this->user['role_id'] != 0){
$info = $this->model->read(['id'=>$this->user['role_id']]);
$info['role_menu'] = trim($info['role_menu'],',');
$menuModel = new ProjectMenuModel();
$lists = $menuModel->where(['status'=>0])->whereIn('id',explode(',',$info['role_menu']))->get();
$lists = $lists->toArray();
}else{
$lists = $menuModel->where(['status'=>0])->get();
}
$menu = array();
foreach ($lists as $k => $v){
$v = (array)$v;
... ...