/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index(Request $request) { // $data = $request->input(); $name = isset($data['name']) ? $data['name'] : ''; $pagesize = 20; $query = DataManager::where('status', Config::get("hthou.status_normal")); if (!empty($name)) { $query->where('username', $name); } $query->orderBy('id', 'asc'); $list = $query->paginate($pagesize); $role_list = DataRole::where('status', Config::get("hthou.status_normal"))->get(); $group_list = DataGroup::where('status', Config::get("hthou.status_normal"))->get(); return view('admin.managers', ['data' => $list, 'url' => $this->url, 'name' => $name, 'role_list' => $role_list, 'group_list' => $group_list]); }
public function getMembers($id, Request $request) { $forward = GlobalTools::get_forward(); $data = $request->input(); $mkforward = $data['forward']; $name = isset($data['u']) ? $data['u'] : ''; $query = DataGroupManager::where('group_id', $id); if (!empty($name)) { $user = DataManager::where('username', $name)->first(); if (isset($user->id)) { $uid = $user->id; } else { $uid = 0; } $query->where('manager_id', $uid); } $res = $query->orderBy('id', 'desc')->paginate(50); $roles = DataRole::where('status', Config::get('hthou.status_normal'))->get(); return view('admin.group_members', ['mkforward' => $mkforward, 'roles' => $roles, 'name' => $name, 'forward' => $forward, 'groupid' => $id, 'data' => $res, 'url' => $this->url]); }
public function getAllRoles() { $query = DataRole::where('status', Config::get('hthou.status_normal')); $res = $query->orderBy('listorder', 'desc')->orderBy('id', 'desc')->get(); $list = array(); foreach ($res as $r) { $tmp = array('name' => $r->name, 'id' => $r->id); $list[] = $tmp; } return json_encode($list); }