作者 lyh

gx

@@ -205,9 +205,9 @@ class BlogLogic extends BaseLogic @@ -205,9 +205,9 @@ class BlogLogic extends BaseLogic
205 $data = ['dra'=>0,'pub'=>1,'del'=>2,'tal'=>3]; 205 $data = ['dra'=>0,'pub'=>1,'del'=>2,'tal'=>3];
206 foreach ($data as $k => $v){ 206 foreach ($data as $k => $v){
207 if($v == 3){ 207 if($v == 3){
208 - $data[$k] = $this->model->count(); 208 + $data[$k] = $this->model->where(['project_id'=>$this->user['project_id']])->count();
209 }else{ 209 }else{
210 - $data[$k] = $this->model->where(['status'=>$v])->count(); 210 + $data[$k] = $this->model->where(['status'=>$v,'project_id'=>$this->user['project_id']])->count();
211 } 211 }
212 } 212 }
213 return $this->success($data); 213 return $this->success($data);
@@ -201,9 +201,9 @@ class NewsLogic extends BaseLogic @@ -201,9 +201,9 @@ class NewsLogic extends BaseLogic
201 $data = ['dra'=>0,'pub'=>1,'del'=>2,'tal'=>3]; 201 $data = ['dra'=>0,'pub'=>1,'del'=>2,'tal'=>3];
202 foreach ($data as $k => $v){ 202 foreach ($data as $k => $v){
203 if($v == 3){ 203 if($v == 3){
204 - $data[$k] = $this->model->count(); 204 + $data[$k] = $this->model->where(['project_id'=>$this->user['project_id']])->count();
205 }else{ 205 }else{
206 - $data[$k] = $this->model->where(['status'=>$v])->count(); 206 + $data[$k] = $this->model->where(['status'=>$v,'project_id'=>$this->user['project_id']])->count();
207 } 207 }
208 } 208 }
209 return $this->success($data); 209 return $this->success($data);
@@ -25,12 +25,15 @@ class RoleLogic extends BaseLogic @@ -25,12 +25,15 @@ class RoleLogic extends BaseLogic
25 * @time :2023/6/17 16:40 25 * @time :2023/6/17 16:40
26 */ 26 */
27 public function role_get_menu(){ 27 public function role_get_menu(){
  28 + $menuModel = new ProjectMenuModel();
28 //根据当前登录用户角色返回用户菜单列表 29 //根据当前登录用户角色返回用户菜单列表
  30 + if($this->user['role_id'] != 0){
29 $info = $this->model->read(['id'=>$this->user['role_id']]); 31 $info = $this->model->read(['id'=>$this->user['role_id']]);
30 $info['role_menu'] = trim($info['role_menu'],','); 32 $info['role_menu'] = trim($info['role_menu'],',');
31 - $menuModel = new ProjectMenuModel();  
32 $lists = $menuModel->where(['status'=>0])->whereIn('id',explode(',',$info['role_menu']))->get(); 33 $lists = $menuModel->where(['status'=>0])->whereIn('id',explode(',',$info['role_menu']))->get();
33 - $lists = $lists->toArray(); 34 + }else{
  35 + $lists = $menuModel->where(['status'=>0])->get();
  36 + }
34 $menu = array(); 37 $menu = array();
35 foreach ($lists as $k => $v){ 38 foreach ($lists as $k => $v){
36 $v = (array)$v; 39 $v = (array)$v;