public function edit($id) { $curr['name'] = $this->crumb['edit']['name']; $curr['url'] = $this->crumb['edit']['url']; $result = ['data' => AdminModel::find($id), 'roleModels' => RoleModel::all(), 'crumb' => $this->crumb, 'curr' => $curr]; return view('admin.admin.edit', $result); }
/** * 查询方法 */ public function query() { $datas = RoleModel::orderBy('id', 'asc')->paginate($this->limit); $datas->limit = $this->limit; return $datas; }
public function role() { $roleid = $this->role_id ? $this->role_id : 0; $roleModel = RoleModel::find($roleid); return $roleModel ? $roleModel->name : ''; }