public function index() { /* 初始化默认查询条件 */ $user_query_struct = array('where' => array(), 'like' => array(), 'orderby' => array(), 'limit' => array('per_page' => 20, 'offset' => 0)); /* 用户列表模板 */ $this->template->content = new View("user/user_list"); /* 搜索功能 */ $search_arr = array('id', 'username', 'email', 'mobile', 'name'); $search_value = $this->input->get('search_value'); $search_type = $this->input->get('search_type'); $where_view = array(); if ($search_arr) { foreach ($search_arr as $value) { if ($search_type == $value && strlen($search_value) > 0) { $user_query_struct['like'][$value] = $search_value; //$user_query_struct['where'][$value] = $search_value; if ($value == 'ip') { $user_query_struct['like'][$value] = tool::myip2long($search_value); //$user_query_struct['where'][$value] = tool::myip2long($search_value); } } } $where_view['search_type'] = $search_type; $where_view['search_value'] = $search_value; } /* 列表排序 */ $orderby_arr = array(0 => array('id' => 'DESC'), 1 => array('id' => 'ASC'), 4 => array('username' => 'ASC'), 5 => array('username' => 'DESC'), 6 => array('email' => 'ASC'), 7 => array('email' => 'DESC'), 8 => array('status' => 'ASC'), 9 => array('status' => 'DESC'), 10 => array('name' => 'ASC'), 11 => array('name' => 'DESC'), 12 => array('reg_time' => 'ASC'), 13 => array('reg_time' => 'DESC')); $orderby = controller_tool::orderby($orderby_arr); $user_query_struct['orderby'] = $orderby; /* 每页显示条数 */ $per_page = controller_tool::per_page(); $user_query_struct['limit']['per_page'] = $per_page; /* 调用分页 */ $this->pagination = new Pagination(array('total_items' => Myuser::instance()->query_count($user_query_struct), 'items_per_page' => $per_page)); $user_query_struct['limit']['offset'] = $this->pagination->sql_offset; $users = Myuser::instance()->query_assoc($user_query_struct); //找出所有的站点的用户等级信息 //$user_levelservice = User_levelService::get_instance(); $query_struct = array('where' => array('active' => 1)); /* $user_levels = $user_levelservice->index($query_struct); $tmp = array(); foreach($user_levels as $user_level) { if($user_level['is_default']) { $tmp['default'] = $user_level; } $tmp[$user_level['id']] = $user_level; } $user_levels = $tmp; foreach ($users as $key => $value) { $users[$key]['level'] = ''; } */ /* 调用列表 */ $this->template->content->user_list = $users; $this->template->content->where = $where_view; $this->template->content->mail_check_pwd = Kohana::config('site_config.site.register_mail_check_pwd'); //Mytool::hash(Mytool::hash($data['password']).$mail_check_pwd) }
public function index($status = NULL) { //权限检查 得到所有可管理站点ID列表 role::check('contact_us'); $this->template->content = new View("user/contact_us_list"); //搜索功能 $search_arr = array('id', 'email', 'name', 'message', 'ip'); $where = array(); $where_view = array(); if ($search_arr) { foreach ($search_arr as $search_value) { if ($this->input->get('search_type') == $search_value && strlen($this->input->get('search_value'))) { $where[$search_value] = $this->input->get('search_value'); if ($search_value == 'ip') { $where[$search_value] = tool::myip2long($this->input->get('search_value')); } } } $where_view['search_type'] = $this->input->get('search_type'); $where_view['search_value'] = $this->input->get('search_value'); } //列表排序 $orderby_arr = array(0 => array('id' => 'DESC'), 1 => array('id' => 'ASC'), 2 => array('id' => 'ASC'), 3 => array('id' => 'DESC'), 4 => array('email' => 'ASC'), 5 => array('email' => 'DESC'), 6 => array('name' => 'ASC'), 7 => array('name' => 'DESC'), 8 => array('message' => 'ASC'), 9 => array('message' => 'DESC'), 10 => array('date_add' => 'ASC'), 11 => array('date_add' => 'DESC'), 12 => array('ip' => 'ASC'), 13 => array('ip' => 'DESC')); $orderby = controller_tool::orderby($orderby_arr); //每页显示条数 $per_page = controller_tool::per_page(); //调用分页 if (isset($status) && $status == 'active') { $where['active'] = 1; } $this->pagination = new Pagination(array('total_items' => Mycontact_us::instance()->count($where), 'items_per_page' => $per_page)); //调用列表 $this->template->content->contact_us_list = Mycontact_us::instance()->contact_uses($where, $orderby, $per_page, $this->pagination->sql_offset); $this->template->content->where = $where_view; }
public function index() { $user_query_struct = array('where' => array(), 'like' => array(), 'orderby' => array(), 'limit' => array('per_page' => 20, 'offset' => 0)); /* 搜索功能 */ $search_arr = array('id', 'email', 'firstname', 'lastname', 'ip', 'mobile', 'real_name'); $search_value = $this->input->get('search_value'); $search_type = $this->input->get('search_type'); $where_view = array(); if ($search_arr) { foreach ($search_arr as $value) { if ($search_type == $value && strlen($search_value) > 0) { $user_query_struct['like'][$value] = $search_value; //$user_query_struct['where'][$value] = $search_value; if ($value == 'ip') { $user_query_struct['like'][$value] = tool::myip2long($search_value); //$user_query_struct['where'][$value] = tool::myip2long($search_value); } } } $where_view['search_type'] = $search_type; $where_view['search_value'] = $search_value; } /* 列表排序 */ $orderby_arr = array(0 => array('id' => 'DESC'), 1 => array('id' => 'ASC'), 4 => array('email' => 'ASC'), 5 => array('email' => 'DESC'), 6 => array('firstname' => 'ASC'), 7 => array('firstname' => 'DESC'), 8 => array('lastname' => 'ASC'), 9 => array('lastname' => 'DESC'), 10 => array('date_add' => 'ASC'), 11 => array('date_add' => 'DESC'), 12 => array('ip' => 'ASC'), 13 => array('ip' => 'DESC'), 14 => array('active' => 'ASC'), 15 => array('active' => 'DESC'), 16 => array('register_mail_active' => 'ASC'), 17 => array('register_mail_active' => 'DESC')); $orderby = controller_tool::orderby($orderby_arr); $user_query_struct['orderby'] = $orderby; /* 每页显示条数 */ $per_page = controller_tool::per_page(); $user_query_struct['limit']['per_page'] = $per_page; /* 调用分页 */ $this->pagination = new Pagination(array('total_items' => Myuser::instance()->query_count($user_query_struct), 'items_per_page' => $per_page)); $user_query_struct['limit']['offset'] = $this->pagination->sql_offset; $user_list = Myuser::instance()->query_assoc($user_query_struct); //找出所有的站点的用户等级信息 $user_levelservice = User_levelService::get_instance(); $query_struct = array('where' => array('active' => 1)); $user_levels = $user_levelservice->index($query_struct); $tmp = array(); foreach ($user_levels as $user_level) { if ($user_level['is_default']) { $tmp['default'] = $user_level; } $tmp[$user_level['id']] = $user_level; } $user_levels = $tmp; foreach ($user_list as $key => $value) { $users[$key]['level'] = ''; if (!empty($user_levels[$value['level_id']])) { $users[$key]['level'] = $user_levels[$value['level_id']]['name_manage']; } else { //$users[$key]['level'] = $user_levels['default']['name_manage']; } } $this->template->content = new View("superplaner/agent_select_list"); $this->template->content->where = $where_view; $this->template->content->user_list = $user_list; }
public function index() { /* 初始化默认查询条件 */ $newsletter_query_struct = array('where' => array('user_id' => 0), 'like' => array(), 'orderby' => array(), 'limit' => array('per_page' => 20, 'offset' => 0)); /* 权限检查 得到所有可管理站点ID列表 */ $site_id_list = role::check('newsletter'); /* Newsletter列表模板 */ $this->template->content = new View("user/newsletter"); /* 搜索功能 */ $search_arr = array('email', 'ip'); $search_value = $this->input->get('search_value'); $search_type = $this->input->get('search_type'); $where_view = array(); if ($search_arr) { foreach ($search_arr as $value) { if ($search_type == $value && strlen($search_value) > 0) { $newsletter_query_struct['where'][$value] = $search_value; if ($value == 'ip') { $newsletter_query_struct['where'][$value] = tool::myip2long($search_value); } } } $where_view['search_type'] = $search_type; $where_view['search_value'] = $search_value; } //当前切入的站点查询条件 $site_in = site::current_query_site_ids(); $where_view['site_id'] = ''; $newsletter_query_struct['where']['site_id'] = $site_in; /* 列表排序 */ $orderby_arr = array(0 => array('id' => 'DESC'), 1 => array('id' => 'ASC'), 2 => array('site_id' => 'ASC'), 3 => array('site_id' => 'DESC'), 4 => array('email' => 'ASC'), 5 => array('email' => 'DESC'), 6 => array('date_add' => 'ASC'), 7 => array('date_add' => 'DESC'), 8 => array('ip' => 'ASC'), 9 => array('ip' => 'DESC'), 10 => array('active' => 'ASC'), 11 => array('active' => 'DESC')); $orderby = controller_tool::orderby($orderby_arr); $newsletter_query_struct['orderby'] = $orderby; /* 每页显示条数 */ $per_page = controller_tool::per_page(); $newsletter_query_struct['limit']['per_page'] = $per_page; /* 调用分页 */ $this->pagination = new Pagination(array('total_items' => Mynewsletter::instance()->query_count($newsletter_query_struct), 'items_per_page' => $per_page)); $newsletter_query_struct['limit']['offset'] = $this->pagination->sql_offset; $newsletters = Mynewsletter::instance()->query_assoc($newsletter_query_struct); foreach ($newsletters as $key => $value) { $site = Mysite::instance($value['site_id'])->get(); $newsletters[$key]['site'] = $site; } /* 调用列表 */ $this->template->content->newsletter_list = $newsletters; /* 搜索信息保存 */ $this->template->content->where = $where_view; }
public function index($userId) { //权限验证 role::check('distribution_system_manage'); if (!$userId) { remind::set(Kohana::lang('o_global.bad_request'), request::referrer(), 'error'); } $aUser = $this->userDao->get_by_id($userId); $aAgent = $this->agentDao->get_by_user_id($userId); if ($aAgent == null) { remind::set(Kohana::lang('o_agent.agent_not_exists'), request::referrer(), 'error'); return; } //排序 $per_page = controller_tool::per_page(); $orderby_arr = array(0 => array('id' => 'DESC'), 1 => array('id' => 'ASC'), 2 => array('order' => 'ASC'), 3 => array('order' => 'DESC')); $orderby = controller_tool::orderby($orderby_arr); $query_struct = array('where' => array(), 'orderby' => $orderby, 'limit' => array('per_page' => $per_page, 'offset' => 0)); $query_struct['where']['agentid'] = $aAgent['user_id']; //搜索 $search_arr = array('users.lastname', 'users.real_name', 'users.email', 'users.mobile', 'users.ip'); $searchBox = array('search_key' => null, 'search_value' => null); $searchBox['search_key'] = $this->input->get('search_key'); $searchBox['search_value'] = $this->input->get('search_value'); if (in_array($searchBox['search_key'], $search_arr)) { if ($searchBox['search_key'] == 'ip') { $query_struct['like'][$value] = tool::myip2long($value); } elseif (!empty($searchBox['search_value'])) { // $query_struct['where'][$key] = $value; $query_struct['like'][$searchBox['search_key']] = $searchBox['search_value']; } } $total = $this->relationDao->count_agent_client($aAgent['user_id']); $this->pagination = new Pagination(array('base_url' => url::current(), 'uri_segment' => 'page', 'total_items' => $total, 'items_per_page' => $per_page, 'style' => 'digg')); $query_struct['limit']['offset'] = $this->pagination->sql_offset; $dataList = $this->relationDao->mylists($query_struct); $this->template->content = new View("distribution/agent_client_list"); $this->template->content->theUser = $aUser; $this->template->content->theAgent = $aAgent; $this->template->content->searchBox = $searchBox; $this->template->content->dataList = $dataList; }
public function index() { role::check('user_list'); /* 初始化默认查询条件 */ $user_query_struct = array('where' => array('invite_user_id > ' => 0), 'like' => array(), 'orderby' => array(), 'limit' => array('per_page' => 20, 'offset' => 0)); /* 用户列表模板 */ $this->template->content = new View("user/user_invite"); /* 搜索功能 */ $search_arr = array('id', 'email', 'lastname', 'ip'); $search_value = $this->input->get('search_value'); $search_type = $this->input->get('search_type'); $where_view = array(); if ($search_arr) { foreach ($search_arr as $value) { if ($search_type == $value && strlen($search_value) > 0) { $user_query_struct['like'][$value] = $search_value; //$user_query_struct['where'][$value] = $search_value; if ($value == 'ip') { $user_query_struct['like'][$value] = tool::myip2long($search_value); //$user_query_struct['where'][$value] = tool::myip2long($search_value); } } } $where_view['search_type'] = $search_type; $where_view['search_value'] = $search_value; } /* 列表排序 */ $orderby_arr = array(0 => array('id' => 'DESC'), 1 => array('id' => 'ASC'), 4 => array('email' => 'ASC'), 5 => array('email' => 'DESC'), 8 => array('lastname' => 'ASC'), 9 => array('lastname' => 'DESC'), 10 => array('date_add' => 'ASC'), 11 => array('date_add' => 'DESC'), 12 => array('ip' => 'ASC'), 13 => array('ip' => 'DESC'), 14 => array('active' => 'ASC'), 15 => array('active' => 'DESC'), 16 => array('register_mail_active' => 'ASC'), 17 => array('register_mail_active' => 'DESC')); $orderby = controller_tool::orderby($orderby_arr); $user_query_struct['orderby'] = $orderby; /* 每页显示条数 */ $per_page = controller_tool::per_page(); $user_query_struct['limit']['per_page'] = $per_page; /* 调用分页 */ $this->pagination = new Pagination(array('total_items' => Myuser::instance()->query_count($user_query_struct), 'items_per_page' => $per_page)); $user_query_struct['limit']['offset'] = $this->pagination->sql_offset; $users = Myuser::instance()->query_assoc($user_query_struct); if (!empty($users)) { $invite_ids = array(); $u_ids = array(); foreach ($users as $row) { $invite_ids[$row['invite_user_id']] = $row['invite_user_id']; $u_ids[$row['id']] = $row['id']; } $user_invite_query_struct = array('where' => array('id' => array_keys($invite_ids))); $user_invite = Myuser::instance()->query_assoc($user_invite_query_struct); } $invites = array(); if (!empty($user_invite)) { foreach ($user_invite as $row) { $invites[$row['id']] = $row; } } $reward = array(); if (!empty($u_ids)) { $sql = " SELECT guest_user_id,reward_money FROM user_reward WHERE guest_user_id in(" . implode(',', $u_ids) . ") AND user_id > 0 AND reward_type = 'invite' "; $reward_list = User_inviteService::get_instance()->select_list($sql); if (!empty($reward_list)) { foreach ($reward_list as $row) { $reward[$row['guest_user_id']] = $row['guest_user_id']; } } } /* 调用列表 */ $this->template->content->user_list = $users; $this->template->content->invite_list = $invites; $this->template->content->reward_list = $reward; $this->template->content->where = $where_view; }