public static function get_user_firstmenu() { $user_id = ADMINUSERID; if (ADMINLEVEL == 1) { return pm_db::fetch_all(pm_db::query("SELECT * FROM pm_menu WHERE level=1 AND parent_id=0")); } $usermenu = mod_member::get_user_menu($user_id); $menu = array(); $query = pm_db::query("SELECT * FROM pm_menu WHERE level=3 AND is_show=1 AND status=1"); while ($row = pm_db::fetch_one($query)) { $secondmenu = pm_db::fetch_result("SELECT * FROM pm_menu WHERE menu_id='{$row['parent_id']}' AND level=2 AND is_show=1 AND status=1"); $firstmenu = pm_db::fetch_result("SELECT * FROM pm_menu WHERE menu_id='{$secondmenu['parent_id']}' AND level=1 AND is_show=1 AND status=1"); $menu[$firstmenu['menu_id']] = $firstmenu; } return $menu; }
public static function adminmsg_list($keyword = '', $start = 0, $perpage = 20) { $condition = ''; if ($keyword) { $condition .= "AND content LIKE '%{$keyword}%'"; } if ($start > -1 && $perpage > 0) { $condition .= "ORDER BY id DESC LIMIT {$start}, {$perpage}"; } $query = pm_db::query("SELECT SQL_CALC_FOUND_ROWS * FROM gamebi_adminmsg WHERE 1=1 {$condition}"); $data = pm_db::fetch_all($query); if ($data) { $datas['data'] = $data; $datas['total'] = pm_db::result_first("SELECT FOUND_ROWS() AS rows"); return $datas; } else { return null; } }
public function testaa() { $aa = pm_db::fetch_all(pm_db::query("select * from gamebi_giving_item")); echo "<pre>"; print_r($aa); //echo pm_db::query("insert into gamebi_giving_item set itemid='14190001',name='炼武破片',type='2',gameid='100087'"); // // //echo pm_db::query("insert into gamebi_giving_item set itemid='14190002',name='防具碎片',type='2',gameid='100087'"); //echo pm_db::query("insert into gamebi_giving_item set itemid='14190003',name='饰品碎片',type='2',gameid='100087'"); //echo pm_db::query("insert into gamebi_giving_item set itemid='14191001',name='上古残枪',type='2',gameid='100087'"); //echo pm_db::query("insert into gamebi_giving_item set itemid='14191002',name='上古残扇',type='2',gameid='100087'"); //echo pm_db::query("insert into gamebi_giving_item set itemid='14191003',name='上古残剑',type='2',gameid='100087'"); }
private function getparents($list) { foreach ($list as $val) { $p[] = $val['parent_id']; } $sql_2 = "SELECT * FROM iosadm_menu where menu_id in (" . implode(',', array_unique($p)) . ")"; $parentlist = pm_db::fetch_all(pm_db::query($sql_2)); foreach ($parentlist as $value) { $parent[$value['menu_id']] = $value['menu_name']; } foreach ($parent as $key => $value) { $menu[$key]['label'] = $value; foreach ($list as $val) { if ($val['parent_id'] == $key) { $menu[$key]['children'][$val['menu_id']]['label'] = $val['menu_name']; $menu[$key]['children'][$val['menu_id']]['action'] = $val['act_url']; } } } return $menu; }
public static function gamecoop_data($start, $gecp_name, $plat, $type, $sortcoop, $perpage = 20) { $where = ''; if (!empty($gecp_name)) { $where .= " AND gecp_name LIKE '%{$gecp_name}%' "; } if (!empty($plat)) { $where .= " AND gecp_plat = '{$plat}' "; } if (!empty($type)) { $where .= " AND gecp_type = '{$type}' "; } if (!empty($sortcoop)) { $where .= "ORDER BY gecp_coopid "; } else { $where .= "ORDER BY gecp_coopid DESC "; } if ($start > -1 && $perpage > 0) { $where .= " LIMIT {$start}, {$perpage} "; } $sql = "SELECT SQL_CALC_FOUND_ROWS * FROM pm_gamecoop WHERE 1=1 {$where} "; $query = pm_db::query($sql); $total = pm_db::fetch_result("SELECT FOUND_ROWS() AS rows"); $data = pm_db::fetch_all($query); if ($data) { $output = array(); $output['data'] = $data; $output['total'] = $total['rows']; return $output; } else { return null; } }
public static function get_logslist($start, $username, $ctr_new, $act_new, $start_dategsh, $end_dategsh, $perpage = 20) { $where = ''; if (!empty($username)) { $where .= " AND username = '******' "; } if (!empty($ctr_new)) { $where .= " AND ctrl = 'c={$ctr_new}' "; } if (!empty($act_new)) { $where .= " AND act = 'a={$act_new}' "; } if (!empty($start_dategsh)) { $where .= " AND aday >= {$start_dategsh} "; } if (!empty($end_dategsh)) { $where .= " AND aday <= {$end_dategsh} "; } if ($start > -1 && $perpage > 0) { $where .= " ORDER BY timestamp DESC LIMIT {$start}, {$perpage} "; } $sql = "SELECT SQL_CALC_FOUND_ROWS * FROM iosadm_oplog WHERE 1=1 {$where} "; $query = pm_db::query($sql); $data = pm_db::fetch_all($query); $total = pm_db::result_first(" SELECT FOUND_ROWS() AS rows "); if ($data) { $output = array(); $output['data'] = $data; $output['total'] = $total; return $output; } else { return null; } }