|
@@ -60,21 +60,38 @@ class Menu extends Base
|
|
|
// }
|
|
|
public function list()
|
|
|
{
|
|
|
- $uid = $this->uid;
|
|
|
- if ($uid == '') {
|
|
|
- return error_show(101, '未找到用户信息');
|
|
|
- }
|
|
|
- $role = $this->checkRole();
|
|
|
+ $post = $this->request->filter('trim')->post();
|
|
|
+// $uid = $this->uid;
|
|
|
+// if ($uid == '') {
|
|
|
+// return error_show(101, '未找到用户信息');
|
|
|
+// }
|
|
|
|
|
|
- if (empty($role)) {
|
|
|
- return app_show(0, "获取成功", []);
|
|
|
- }
|
|
|
+ //相关权限等以后重新梳理
|
|
|
+// $role = $this->checkRole();
|
|
|
+
|
|
|
+ if ($this->level == 1) {
|
|
|
+ //超管,获取所有
|
|
|
+ $role['action_conllect'] = Db::name('action')
|
|
|
+ ->field('id')
|
|
|
+ ->where(['is_del' => 0, 'status' => 1])
|
|
|
+ ->buildSql();
|
|
|
+ } else $role['action_conllect'] = Db::name('user_role')
|
|
|
+ ->alias('a')
|
|
|
+ ->field('b.action_conllect')
|
|
|
+ ->leftJoin('role_action b', 'b.role_id=a.roleid')
|
|
|
+ ->where(['a.uid' => $this->uid, 'a.is_del' => 0, 'a.companyNo' => $post['relaComNo']])
|
|
|
+ ->buildSql();
|
|
|
+
|
|
|
+// if (empty($role['action_conllect'])) {
|
|
|
+// return app_show(0, "获取成功", []);
|
|
|
+// }
|
|
|
|
|
|
- $where=[['status','=',1],['cstatus','=',1],['is_display','=',1]];
|
|
|
- if(!empty($role['action_conllect'])) $where[]=['aid','in',$role['action_conllect']];
|
|
|
+ $where = [['status', '=', 1], ['cstatus', '=', 1], ['is_display', '=', 1]];
|
|
|
+// if (!empty($role['action_conllect'])) $where[] = ['aid', 'in', $role['action_conllect']];
|
|
|
|
|
|
$data = Db::name("view_menu")
|
|
|
->where($where)
|
|
|
+ ->where('aid in '.$role['action_conllect'])
|
|
|
->order("weight desc,id asc,cweight desc,cid asc")
|
|
|
->select()
|
|
|
->toArray();
|