本文整理汇总了PHP中app\Role::getRolebyRoleId方法的典型用法代码示例。如果您正苦于以下问题:PHP Role::getRolebyRoleId方法的具体用法?PHP Role::getRolebyRoleId怎么用?PHP Role::getRolebyRoleId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Role
的用法示例。
在下文中一共展示了Role::getRolebyRoleId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: searchfull
public function searchfull()
{
$chucnang = 'timkiemcongvanden';
$rolechucnangsearchs = Role::getRolebyRoleId($chucnang, Auth::user()->role_id);
if (Auth::check() && $rolechucnangsearchs && $rolechucnangsearchs->Danhsach == 1) {
$phongid = User::where('id', Auth::user()->id)->value('phong_id');
$capphathanhs = Danhmucnhomdonvi::get(array('id', 'name'));
$noiphathanhs = Danhmucdonvi::get(array('id', 'name', 'danhmucnhomdonvi_id'));
$mucdichs = Danhmucmucdich::get(array('id', 'name'));
$linhvucchuyendes = Linhvucchuyende::get(array('id', 'name'));
$chuyendes = Danhmucchuyende::get(array('id', 'name', 'linhvucchuyende_id'));
$chutrixulys = Danhmucphong::get(array('id', 'name'));
$phoihopxulys = Danhmucphong::get(array('id', 'name'));
$canboxulys = Canbo::get(array('id', 'name'));
$domats = Danhmucdomat::get(array('id', 'name'));
$dokhans = Danhmucdokhan::get(array('id', 'name'));
$loaicongvans = Danhmucloaicongvan::get(array('id', 'name'));
// Input
$loaivanban = Input::get('loaivanban');
$noidung = Input::get('noidungcongvan');
//noidungcongvan
$noidungtrichyeu = false;
$ykienlanhdao = false;
if (Input::get('noidungtrichyeu-checkbox') == 'on') {
$noidungtrichyeu = true;
}
if (Input::get('noidungykienlanhdao-checkbox') == 'on') {
$ykienlanhdao = true;
}
$socongvandenso = Input::get('socongvandenso');
if ($socongvandenso == '') {
$querysocongvandenso = 'socongvandenso > 0';
} else {
$querysocongvandenso = 'socongvandenso = ' . $socongvandenso;
}
$socongvandenchu = Input::get('socongvandenchu');
$sohosoluu = Input::get('sohosoluu');
$trichyeucongvan = Input::get('trichyeucongvanden');
$noiluutru = Input::get('noiluutru');
//input radio search
$radiosearch = Input::get('radio-search');
$radiosearchcheck_all = '';
$radiosearchcheck_sohosoluu = '';
$radiosearchcheck_sohosoluubo = '';
if ($radiosearch == 'all') {
if ($sohosoluu == '') {
$querysohosoluu = '((sohosoluu > 0 AND sohosoluubo is null) OR (sohosoluu is null AND sohosoluubo > 0))';
} else {
$querysohosoluu = '(sohosoluu = ' . $sohosoluu . ' OR sohosoluubo = ' . $sohosoluu . ')';
}
$radiosearchcheck_all = 'checked';
} else {
if ($radiosearch == 'congvanden') {
if ($sohosoluu == '') {
$querysohosoluu = 'sohosoluu > 0';
} else {
$querysohosoluu = 'sohosoluu = ' . $sohosoluu;
}
$radiosearchcheck_sohosoluu = 'checked';
} else {
if ($radiosearch == 'congvandenbo') {
if ($sohosoluu == '') {
$querysohosoluu = 'sohosoluubo > 0';
} else {
$querysohosoluu = 'sohosoluubo = ' . $sohosoluu;
}
$radiosearchcheck_sohosoluubo = 'checked';
}
}
}
// Tìm theo năm
$timtheonam = Input::get('timtheonam-checkbox');
if ($timtheonam == 'on') {
$namvanban = Input::get('year');
$querynamvanban = 'year(ngayden) =' . $namvanban;
} else {
$querynamvanban = 'year(ngayden) >= 1900';
}
// Tim kiem
if ($loaivanban == 0) {
isset($loaivanban);
if ($noidungtrichyeu && !$ykienlanhdao) {
$congvandens = Congvanden::where('phong_id', $phongid)->whereRaw($querynamvanban)->where('trichyeucongvanden', 'LIKE', '%' . $noidung . '%')->whereRaw($querysocongvandenso)->where('socongvandenchu', 'LIKE', '%' . $socongvandenchu . '%')->whereRaw($querysohosoluu)->whereNull('congvandens.deleted_at')->orderBy('ngayden', 'desc')->orderBy('updated_at')->orderBy('created_at')->get();
} else {
if ($ykienlanhdao && !$noidungtrichyeu) {
$congvandens = Congvanden::where('phong_id', $phongid)->whereRaw($querynamvanban)->where('trichykienlanhdao', 'LIKE', '%' . $noidung . '%')->WhereRaw($querysocongvandenso)->where('socongvandenchu', 'LIKE', '%' . $socongvandenchu . '%')->whereRaw($querysohosoluu)->whereNull('congvandens.deleted_at')->orderBy('ngayden', 'desc')->orderBy('updated_at')->orderBy('created_at')->get();
} else {
if ($noidungtrichyeu && $ykienlanhdao) {
$congvandens = Congvanden::where('phong_id', $phongid)->whereRaw($querynamvanban)->where('trichykienlanhdao', 'LIKE', '%' . $noidung . '%')->WhereRaw($querysocongvandenso)->where('socongvandenchu', 'LIKE', '%' . $socongvandenchu . '%')->whereRaw($querysohosoluu)->whereNull('congvandens.deleted_at')->orWhere(function ($query) use($phongid, $querynamvanban, $noidung, $querysocongvandenso, $socongvandenchu, $querysohosoluu) {
$query->where('phong_id', $phongid)->whereRaw($querynamvanban)->where('trichyeucongvanden', 'LIKE', '%' . $noidung . '%')->WhereRaw($querysocongvandenso)->where('socongvandenchu', 'LIKE', '%' . $socongvandenchu . '%')->whereRaw($querysohosoluu)->whereNull('congvandens.deleted_at');
})->orderBy('ngayden', 'desc')->orderBy('updated_at')->orderBy('created_at')->get();
} else {
$congvandens = Congvanden::where('phong_id', $phongid)->whereRaw($querynamvanban)->where('trichyeucongvanden', 'LIKE', '%' . $noidung . '%')->WhereRaw($querysocongvandenso)->where('socongvandenchu', 'LIKE', '%' . $socongvandenchu . '%')->whereRaw($querysohosoluu)->whereNull('congvandens.deleted_at')->orderBy('ngayden', 'desc')->orderBy('updated_at')->orderBy('created_at')->get();
}
}
}
} else {
if ($loaivanban != 0) {
if ($noidungtrichyeu && !$ykienlanhdao) {
$congvandens = Congvanden::where('phong_id', $phongid)->whereRaw($querynamvanban)->where('danhmucloaicongvan_id', '=', $loaivanban)->where('trichyeucongvanden', 'LIKE', '%' . $noidung . '%')->WhereRaw($querysocongvandenso)->where('socongvandenchu', 'LIKE', '%' . $socongvandenchu . '%')->whereRaw($querysohosoluu)->whereNull('congvandens.deleted_at')->orderBy('ngayden', 'desc')->orderBy('updated_at')->orderBy('created_at')->get();
//.........这里部分代码省略.........
示例2: searchfull
public function searchfull()
{
$chucnang = 'timkiemcongvandi';
$rolechucnangsearchs = Role::getRolebyRoleId($chucnang, Auth::user()->role_id);
if (Auth::check() && $rolechucnangsearchs && $rolechucnangsearchs->Danhsach == 1) {
$phongid = User::where('id', Auth::user()->id)->value('phong_id');
$loaicongvans = Danhmucloaicongvan::get(array('id', 'name'));
// Input
$capphathanhs = Danhmucnhomdonvi::get(array('id', 'name'));
$noiphathanhs = Danhmucdonvi::get(array('id', 'name', 'danhmucnhomdonvi_id'));
$mucdichs = Danhmucmucdich::get(array('id', 'name'));
$linhvucchuyendes = Linhvucchuyende::get(array('id', 'name'));
$chuyendes = Danhmucchuyende::get(array('id', 'name', 'linhvucchuyende_id'));
$chutrixulys = Danhmucphong::get(array('id', 'name'));
$phoihopxulys = Danhmucphong::get(array('id', 'name'));
$canboxulys = Canbo::get(array('id', 'name'));
$nguoikys = Canbo::get(['id', 'name']);
$hinhthucchuyens = Danhmuchinhthucchuyen::get(['id', 'name']);
$noisoanthaos = Danhmucphong::get(['id', 'name']);
$domats = Danhmucdomat::get(array('id', 'name'));
$dokhans = Danhmucdokhan::get(array('id', 'name'));
$loaicongvans = Danhmucloaicongvan::get(array('id', 'name'));
// Input
$loaivanban = Input::get('loaivanban');
$noidung = Input::get('noidungcongvan');
//noidungcongvan
// Tìm theo năm
$timtheonam = Input::get('timtheonam-checkbox');
if ($timtheonam == 'on') {
$namvanban = Input::get('year');
$querynamvanban = 'year(ngayphathanh) =' . $namvanban;
} else {
$querynamvanban = 'year(ngayphathanh) >= 1900';
}
$socongvandiso = Input::get('socongvandiso');
if ($socongvandiso == '') {
$querysocongvandiso = 'socongvandiso > 0';
} else {
$querysocongvandiso = 'socongvandiso = ' . $socongvandiso;
}
$socongvandichu = Input::get('socongvandichu');
$noinhancongvan = Input::get('noinhancongvan');
// Tim kiem
if ($loaivanban == 0) {
$congvandis = Congvandi::where('phong_id', $phongid)->whereRaw($querynamvanban)->where('trichyeucongvandi', 'LIKE', '%' . $noidung . '%')->WhereRaw($querysocongvandiso)->where('socongvandichu', 'LIKE', '%' . $socongvandichu . '%')->Where('noinhancongvan', 'LIKE', '%' . $noinhancongvan . '%')->whereNull('congvandis.deleted_at')->orderBy('ngaynhap', 'desc')->orderBy('updated_at')->orderBy('created_at')->get();
} else {
if ($loaivanban != 0) {
$congvandis = Congvandi::where('phong_id', $phongid)->whereRaw($querynamvanban)->where('danhmucloaicongvan_id', '=', $loaivanban)->where('trichyeucongvandi', 'LIKE', '%' . $noidung . '%')->WhereRaw($querysocongvandiso)->where('socongvandichu', 'LIKE', '%' . $socongvandichu . '%')->Where('noinhancongvan', 'LIKE', '%' . $noinhancongvan . '%')->whereNull('congvandis.deleted_at')->orderBy('ngaynhap', 'desc')->orderBy('updated_at')->orderBy('created_at')->get();
}
}
// Tim kiem nang cao
// input
$timnangcao = Input::get('timnangcao-checkbox');
//input
$noisoanthao = Input::get('noisoanthao');
//
$nguoiky = Input::get('nguoiky');
//
$capphathanh = Input::get('capphathanh');
$noiphathanh = Input::get('noiphathanh');
$domat = Input::get('domatcongvan');
$mucdich = Input::get('mucdich');
$linhvucchuyende = Input::get('linhvucchuyende');
//
$chuyende = Input::get('chuyende');
$hinhthucchuyen = Input::get('hinhthucchuyen');
$dokhan = Input::get('dokhancongvan');
$querynoisoanthao = '';
$querynguoiky = '';
$queryhinhthucchuyen = '';
$querycapphathanh = '';
$querynoiphathanh = '';
$querydomat = '';
$querydokhan = '';
$querymucdich = '';
$querylinhvucchuyende = '';
$querychuyende = '';
// noi soan thao
if ($noisoanthao != 0) {
$querynoisoanthao = 'noisoanthao_id = ' . $noisoanthao;
} else {
$querynoisoanthao = 'noisoanthao_id != 0';
}
// nguoi ky
if ($nguoiky != 0) {
$querynguoiky = 'nguoiky_id = ' . $nguoiky;
} else {
$querynguoiky = 'nguoiky_id != 0';
}
// hinh thuc chuyen
if ($hinhthucchuyen != 0) {
$queryhinhthucchuyen = 'danhmuchinhthucchuyen_id = ' . $hinhthucchuyen;
} else {
$queryhinhthucchuyen = 'danhmuchinhthucchuyen_id != 0';
}
//cap phát hành
if ($capphathanh != 0) {
$querycapphathanh = 'capphathanh_id = ' . $capphathanh;
} else {
$querycapphathanh = 'capphathanh_id != 0';
//.........这里部分代码省略.........