/** * 分类列表 */ public function index() { //* 权限验证 */ $site_id = site::id(); Myseo_manage::instance()->update_seo_manage_by_site_id($site_id); if ($site_id == 0) { remind::set('请首先进入所要操作的站点', request::referrer(), 'error'); } $site_id_list = role::check('seo_manage', 0, 0); if (empty($site_id_list)) { remind::set('access denied', request::referrer(), 'error'); } $query_struct = array(); $query_struct = array('where' => array('site_id' => $site_id)); $list_columns = array(array('name' => 'ID', 'column' => 'id', 'class_num' => '1'), array('name' => '分类', 'column' => 'parent_id', 'class_num' => '4'), array('name' => '包含子分类', 'column' => 'is_contain_child', 'class_num' => '3'), array('name' => 'Meta Title', 'column' => 'meta_title', 'class_num' => '5'), array('name' => 'Meta Keywords', 'column' => 'meta_keywords', 'class_num' => '5'), array('name' => 'Meta Description', 'column' => 'meta_description', 'class_num' => '6'), array('name' => '发布时间', 'column' => 'create_timestamp', 'class_num' => '5'), array('name' => '更新时间', 'column' => 'update_timestamp', 'class_num' => '5')); $this->template->content = new View("product/seo_manage_list"); $this->template->content->list_columns = $list_columns; /** * 搜索 */ /* $search_arr = array('site_domain','site_id'); $search_type = $this->input->get('search_type'); $search_value = $this->input->get('search_value'); if($search_value&&$search_type) { if(in_array($search_type,$search_arr)) { $query_struct['like'][$search_type] = $search_value; } }*/ //调用分页 $per_page = controller_tool::per_page(); $this->pagination = new Pagination(array('total_items' => Myseo_manage::instance()->count($query_struct), 'items_per_page' => $per_page)); $orderby = array('update_timestamp' => 'DESC'); $seo_manages = Myseo_manage::instance()->seo_manages($query_struct, $orderby, $per_page, $this->pagination->sql_offset); $request_category = array('where' => array('site_id' => $site_id), 'like' => array(), 'orderby' => array()); $category = Mycategory::instance()->lists($request_category); foreach ($category as $val) { $category_list[$val['id']] = $val; } foreach ($seo_manages as $seo_manages_key => $seo_manages_value) { $seo_manages[$seo_manages_key]['is_contain_child'] = view_tool::get_active_img($seo_manages_value['is_contain_child']); $seo_manages[$seo_manages_key]['meta_description'] = strip_tags(text::limit_words($seo_manages_value['meta_description'], 50)); $seo_manages[$seo_manages_key]['create_timestamp'] = date('Y-m-d H:i:s', $seo_manages_value['create_timestamp']); $seo_manages[$seo_manages_key]['update_timestamp'] = date('Y-m-d H:i:s', $seo_manages_value['update_timestamp']); if ($seo_manages_value['parent_id'] && array_key_exists($seo_manages_value['parent_id'], $category_list)) { $seo_manages[$seo_manages_key]['parent_id'] = $category_list[$seo_manages_value['parent_id']]['name']; } else { $seo_manages[$seo_manages_key]['parent_id'] = ''; } foreach ($seo_manages_value as $key => $value) { if (!is_numeric($value) && empty($value)) { $seo_manages[$seo_manages_key][$key] = "NULL"; } } } $this->template->content->seo_manages = $seo_manages; }
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)); /* 用户列表模板 */ $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) { $per_page = controller_tool::per_page(); $lotyid = lottnum::getlottid($status); $where = array('lottyid' => $lotyid); //初始化默认查询结构体 $query_struct_default = array('orderby' => array('id' => 'DESC'), 'limit' => array('per_page' => $per_page, 'page' => 1), 'where' => $where); $jobobj = Lotty_jobService::get_instance(); $return_data['count'] = $jobobj->count($query_struct_default); //统计数量 /* 调用分页 */ $this->pagination = new Pagination(array('total_items' => $return_data['count'], 'items_per_page' => $query_struct_default['limit']['per_page'])); $query_struct_default['limit']['page'] = $this->pagination->current_page; $return_data['list'] = $jobobj->query_assoc($query_struct_default); //彩种配置 $lottconfig = Kohana::config("ticket_type.type"); $return_data['lottconfig'] = $lottconfig; //任务状态说明 $lottnumconfig = Kohana::config("lottnum"); $return_data['jobstatconfig'] = $lottnumconfig['jobstat']; $return_data['jobtype'] = $lottnumconfig['jobtype']; $return_data['status'] = is_null($status) ? 'dlt' : $status; //近10期期号列表 $return_data['issues'] = lottnum::getissue(is_null($status) ? 'dlt' : $status); $this->template->content = new View("lottnum/jobs", $return_data); }
/** * 后台用户列表 */ public function index() { //zhu add role::check('manage_merchant'); $query_struct = array(); /* 管理员才能显示分页 */ $show_page = false; //zhu modify if (role::is_root()) { $show_page = true; $per_page = controller_tool::per_page(); $this->pagination = new Pagination(array('total_items' => Mymanager::instance()->count($query_struct), 'items_per_page' => $per_page)); $order_by = array('id' => 'DESC'); $managers = Mymanager::instance()->managers($query_struct, $order_by, $per_page, $this->pagination->sql_offset); } else { $managers = Mymanager::instance()->subs($this->manager_id); } foreach ($managers as $managers_key => $managers_value) { /* 账号列表中把自己的账号排除、root帐号排除 zhu */ if ($managers_value['id'] == $this->manager_id || role::is_root($managers_value['username'])) { unset($managers[$managers_key]); continue; } $parent_email = Mymanager::instance($managers_value['parent_id'])->get('email'); $managers[$managers_key]['parent_email'] = empty($parent_email) ? '无' : $parent_email; } $this->template->content = new View("manage/manager_list"); $this->template->content->managers = $managers; $this->template->content->show_page = $show_page; }
/** * 列表 */ public function index() { $this->template->content = new View("manage/role_list"); //调用分页 $per_page = controller_tool::per_page(); $this->pagination = new Pagination(array('total_items' => Myrole::instance()->count(), 'items_per_page' => $per_page)); //管理员可能查看所有的用户组,其实只能看到对应等级下面的用户组 if ($this->manager_is_admin == 1) { $roles = Myrole::instance()->roles(); } else { $role_id = Mymanager::instance($this->manager_id)->get('role_id'); $roles = Myrole::instance()->childrens($role_id); } foreach ($roles as $k => $v) { //显示图片标识 $roles[$k]['active_img'] = view_tool::get_active_img($v['active']); $roles[$k]['type_name'] = 'merchant'; if ($v['type'] == 1) { $roles[$k]['type_name'] = 'admin'; } //列表中显示上级用户组 $roles[$k]['parent_name'] = '空'; if ($v['parent_id'] > 0) { $role = Myrole::instance($v['parent_id'])->get(); $roles[$k]['parent_name'] = $role['name']; } } $this->template->content->roles = $roles; }
/** * 列表 */ public function index() { $query_struct = array(); /** * 搜索 */ $search_value = $this->input->get('search_value'); if ($search_value) { $query_struct['where']['mail_category_id'] = $search_value; } //调用分页 $per_page = controller_tool::per_page(); $this->pagination = new Pagination(array('total_items' => Mymail_template::instance()->count($query_struct), 'items_per_page' => $per_page)); $mail_templates = Mymail_template::instance()->mail_templates($query_struct, array('id' => 'DESC'), $per_page, $this->pagination->sql_offset); foreach ($mail_templates as $k => $v) { foreach ($v as $key => $value) { if (!is_numeric($value) && empty($value)) { $mail_templates[$k][$key] = 'NULL'; } } $mail_templates[$k]['content_small'] = strip_tags(text::limit_words($v['content'], 30)); $mail_templates[$k]['active_img'] = view_tool::get_active_img($v['active']); } $mail_categories = Mymail_category::instance()->mail_categories(); $this->template->content = new View("manage/mail_template_list"); $this->template->content->mail_templates = $mail_templates; $this->template->content->mail_categories = $mail_categories; }
public function index() { role::check('user_charge_orders'); /* 初始化默认查询条件 */ $user_query_struct = array('where' => array(), 'like' => array(), 'orderby' => array('id' => "DESC"), 'limit' => array('per_page' => 20, 'offset' => 0)); /* 用户列表模板 */ $this->template->content = new View("user/user_charge_orders"); /* 搜索功能 */ $search_arr = array('order_num'); $search_value = $this->input->get('search_value'); $where_view = array(); $user_query_struct['like']['order_num'] = $search_value; //$user_query_struct['like']['ret_order_num'] = $search_value; $where_view['search_value'] = $search_value; /* 每页显示条数 */ $per_page = controller_tool::per_page(); $user_query_struct['limit']['per_page'] = $per_page; /* 调用分页 */ $this->pagination = new Pagination(array('total_items' => User_chargeService::get_instance()->query_count($user_query_struct), 'items_per_page' => $per_page)); //d($this->pagination->sql_offset); $user_query_struct['limit']['offset'] = $this->pagination->sql_offset; $users = User_chargeService::get_instance()->lists($user_query_struct); $userobj = user::get_instance(); foreach ($users as $key => $rowuser) { $users[$key]['userinfo'] = $userobj->get($rowuser['user_id']); } /* 调用列表 */ $this->template->content->user_list = $users; $this->template->content->where = $where_view; $this->template->content->pay_banks = Kohana::config('pay_banks'); }
public function index() { $news = Mynews::instance(); $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)); $total = $news->count_site_news(); $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; $news = Mynews::instance()->lists($query_struct); $categorys = array(); foreach ($news as $row) { $categorys[$row['classid']] = $row['classid']; } foreach ($categorys as $v) { $str = ''; $aa = array('where' => array('id' => $v), 'like' => array(), 'limit' => array()); $categories = Mynews_category::instance()->list_news_categories($aa); if (count($categories)) { $str = $categories[0]['category_name']; if ($categories[0]['parent_id'] > 0) { $aa = array('where' => array('id' => $categories[0]['parent_id']), 'like' => array(), 'limit' => array()); $cate = Mynews_category::instance()->list_news_categories($aa); $str = $cate[0]['category_name'] . ' > ' . $str; } } $categorys[$v] = $str; } $this->template->content = new View("site/news_list"); $this->template->content->data = $news; $this->template->content->categorys = $categorys; $this->template->content->title = "site news list"; }
/** * 列表 */ public function index() { //查询条件 $query_struct = array('orderby' => array('id' => 'DESC')); /* 搜索 */ $search_arr = array('title', 'content'); $search_type = $this->input->get('search_type'); $search_value = $this->input->get('search_value'); if (!empty($search_value) && in_array($search_type, $search_arr)) { $query_struct['like'][$search_type] = $search_value; } $where_view['search_value'] = $search_value; //调用分页 $per_page = controller_tool::per_page(); $query_struct['per_page'] = $per_page; $this->pagination = new Pagination(array('total_items' => Mynotice::instance()->count($query_struct), 'items_per_page' => $per_page)); $query_struct['per_page'] = $this->pagination->sql_offset; $notice = Mynotice::instance()->lists($query_struct); foreach ($notice as $k => $v) { $notice[$k]['content_small'] = strip_tags(text::limit_words($v['content'], 30)); $notice[$k]['manager_id'] = Mymanager::instance($v['manager_id'])->get('name'); } //VIEW $this->template->content = new View("manage/notice_list"); $this->template->content->notice = $notice; $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() { $list_columns = array(array('name' => '名称', 'column' => 'category_name', 'class_num' => '200')); $orderby_arr = array(0 => array('id' => 'ASC'), 1 => array('id' => 'DESC'), 2 => array('p_order' => 'ASC'), 3 => array('p_order' => 'DESC')); $orderby = controller_tool::orderby($orderby_arr); $query_struct = array('where' => array('parent_id' => 0), 'like' => array(), 'orderby' => $orderby, 'limit' => array('per_page' => controller_tool::per_page(), 'offset' => 0)); $categories = Mydoc_category::instance()->list_doc_categories($query_struct); $this->template->content = new View("site/doc_category_list"); $this->template->content->list_columns = $list_columns; $this->template->content->categories = $categories; }
/** * 模板列表 */ public function index() { //调用分页 $per_page = controller_tool::per_page(); // 初始化默认查询条件 $request_struct_current = array('like' => array(), 'orderby' => array('id' => 'DESC'), 'limit' => array('per_page' => $per_page, 'page' => 1)); //分页 $this->pagination = new Pagination(array('total_items' => Mytheme::instance()->count($request_struct_current), 'items_per_page' => $per_page)); $request_struct['limit']['offset'] = $this->pagination->sql_offset; $themes = Mytheme::instance()->lists($request_struct_current); $this->template->content = new View("manage/theme_list", array('data' => $themes)); }
public function index() { $query_struct = array(); $list_columns = array(array('name' => '域名/IP', 'column' => 'name', 'class_num' => '6'), array('name' => '添加扫描时间', 'column' => 'add_time', 'class_num' => '4')); //调用分类 $per_page = controller_tool::per_page(); $this->pagination = new Pagination(array('total_items' => Myscan::instance()->count($query_struct), 'items_per_page' => $per_page)); $scan = Myscan::instance()->scans($query_struct, NULL, $per_page, $this->pagination->sql_offset); $this->template->content = new View("site/scan_list"); $this->template->content->list_columns = $list_columns; $this->template->content->scan = $scan; }
/** * site type list */ public function index() { $query_struct = array(); /** * 搜索 */ $search_arr = array('manager_id', 'user_log_type', 'date_begin', 'date_end'); foreach ($this->input->get() as $key => $value) { if (in_array($key, $search_arr)) { if ($key == 'date_begin') { $query_struct['where']["add_time >"] = $value . ' 00:00:00'; } elseif ($key == 'date_end') { $query_struct['where']["add_time <"] = $value . ' 24:00:00'; } elseif (!empty($value)) { $query_struct['where'][$key] = $value; } } } if ($this->manager_is_admin != 1) { //得到子用户的ID列表 $childrens = Mymanager::instance($this->manager_id)->subs(); $children_ids = array(); $children_ids[] = $this->manager_id; foreach ($childrens as $key => $value) { $children_ids[] = $value['id']; } $query_struct['in']['manager_id'] = $children_ids; } //调用分页 $per_page = controller_tool::per_page(); $this->pagination = new Pagination(array('total_items' => Myuser_log::instance()->count($query_struct), 'items_per_page' => $per_page)); $user_logs = Myuser_log::instance()->user_logs($query_struct, array('id' => 'DESC'), $per_page, $this->pagination->sql_offset); $user_log_type = Kohana::config('user_log_type.type'); $user_log_type_status = Kohana::config('user_log_type.status'); $managers = Mymanager::instance()->subs($this->manager_id); $managers[] = Mymanager::instance($this->manager_id)->get(); foreach ($user_logs as $key => $value) { $user_logs[$key]['type_name'] = $user_log_type[$value['user_log_type']]; $user_logs[$key]['status_name'] = $user_log_type_status[$value['user_log_type']][$value['status']]; foreach ($value as $k => $v) { if (!is_numeric($v) && empty($v)) { $user_logs[$key][$k] = '无'; } } } $this->template->content = new View("manage/user_log_list"); $this->template->content->user_logs = $user_logs; $this->template->content->user_log_type = $user_log_type; $this->template->content->today = date("Y-m-d", time()); $this->template->content->yesterday = date("Y-m-d", time() - 24 * 3600); $this->template->content->managers = $managers; }
public function index() { role::check('card_system_manage'); $query_condition = array(); $query_condition['beginNum'] = null; $query_condition['endNum'] = null; $query_condition['selectKey'] = null; $query_condition['selectValue'] = null; $per_page = controller_tool::per_page(); $orderby_arr = array(0 => array('id' => 'ASC'), 1 => array('id' => 'DESC'), 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)); if ($_GET) { if (!empty($_GET['beginNum']) && !empty($_GET['endNum'])) { $query_condition['beginNum'] = $_GET['beginNum']; $query_condition['endNum'] = $_GET['endNum']; $query_struct['where']['mgrnum >='] = $_GET['beginNum']; $query_struct['where']['mgrnum <='] = $_GET['endNum']; } if (isset($_GET['selectValue']) && !empty($_GET['selectValue'])) { $query_condition['selectKey'] = $_GET['selectKey']; $query_condition['selectValue'] = $_GET['selectValue']; if ($query_condition['selectKey'] == 'mgrNum') { $query_struct['where']['mgrnum'] = $_GET['selectValue']; } else { if ($query_condition['selectKey'] == 'serialCode') { $query_struct['where']['cardserialcode'] = $_GET['selectValue']; } else { if ($query_condition['selectKey'] == 'issueId') { $query_struct['where']['issueid'] = $_GET['selectValue']; } else { if ($query_condition['selectKey'] == 'openId') { $query_struct['where']['openid'] = $_GET['selectValue']; } else { if ($query_condition['selectKey'] == 'flag') { $query_struct['where']['flag'] = $_GET['selectValue']; } } } } } } } $total = $this->cardDao->count_items_with_condition($query_struct['where']); $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; $cardList = $this->cardDao->lists($query_struct); $this->template->content = new View("card/card_list"); $this->template->content->data = $cardList; $this->template->content->query_condition = $query_condition; $this->template->content->selectMap = $this->selectMap; }
public function index() { role::check('card_system_manage'); $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)); $total = $this->moneyExchangeDao->count_items_with_condition($query_struct['where']); $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; $moneyExchangeList = $this->moneyExchangeDao->lists($query_struct); $this->template->content = new View("card/money_exchange_list"); $this->template->content->data = $moneyExchangeList; }
public function index() { $agentDao = Superplaner::instance(); $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)); $total = $agentDao->count_agents(); $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; $agentList = $agentDao->lists($query_struct); $this->template->content = new View("superplaner/agent_list"); $this->template->content->data = $agentList; }
/** * 币种列表 */ public function index() { /* 初始化结构体*/ $query_struct = array('where' => array(), 'orderby' => array('id' => 'DESC')); $this->template->content = new View("site/currency_list"); //每页显示条数 $per_page = controller_tool::per_page(); $query_struct['limit']['per_page'] = $per_page; //调用分页 $this->pagination = new Pagination(array('total_items' => Mycurrency::instance()->query_count($query_struct), 'items_per_page' => $per_page)); $query_struct['limit']['offset'] = $this->pagination->sql_offset; //调用列表 $this->template->content->currency_list = Mycurrency::instance()->query_assoc($query_struct); }
public function index() { $settlerealtimerptDao = Superplaner_settlerealtimerpt::instance(); $agent_type = Kohana::config('settle.agent_type'); $isbeidan = Kohana::config('settle.isbeidan'); $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)); /** * 搜索 */ $search_arr = array('type', 'agent_type', 'isbeidan', 'date_begin', 'date_end', 'user_id', 'lastname'); foreach ($this->input->get() as $key => $value) { if (in_array($key, $search_arr)) { if ($key == 'date_begin') { $query_struct['where']["settletime >"] = $value . ' 00:00:00'; } elseif ($key == 'date_end') { $query_struct['where']["settletime <"] = $value . ' 24:00:00'; } elseif ($key == 'isbeidan' && !empty($value)) { $query_struct['where']["type"] = $value - 1; } elseif ($key == 'agent_type' && !empty($value)) { $query_struct['where']["agent_type"] = $value - 1; } elseif (!empty($value)) { $query_struct['where'][$key] = $value; } } } $total = $settlerealtimerptDao->count_itmes(); $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 = Superplaner_settlerealtimerpt::instance()->lists($query_struct); $dataList = Superplaner_settlerealtimerpt::instance()->mylists($query_struct); foreach ($dataList as $key => $value) { $dataList[$key]['agent_type'] = $agent_type[$value['agent_type']]; $dataList[$key]['type'] = $isbeidan[$value['type']]; foreach ($value as $k => $v) { if (!is_numeric($v) && empty($v)) { $dataList[$key][$k] = '无'; } } } $this->template->content = new View("superplaner/settle_realtime_rpt"); $this->template->content->data = $dataList; $this->template->content->agent_type = $agent_type; $this->template->content->isbeidan = $isbeidan; $this->template->content->today = date("Y-m-d", time()); $this->template->content->yesterday = date("Y-m-d", time() - 24 * 3600); }
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() { $settlemonthrptdtlDao = Mysettlemonthrptdtl::instance(); $ticket_type = Kohana::config('ticket_type.type'); $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)); /** * 搜索 */ $search_arr = array('ticket_type', 'date_begin', 'date_end', 'agentid', 'user_id', 'agentlastname', 'masterid'); foreach ($this->input->get() as $key => $value) { if (in_array($key, $search_arr)) { if ($key == 'date_begin') { $query_struct['where']["settletime >"] = $value . ' 00:00:00'; } elseif ($key == 'date_end') { $query_struct['where']["settletime <"] = $value . ' 24:00:00'; } elseif ($key == 'agentlastname' && !empty($value)) { $query_struct['where']["agent.lastname ="] = $value; } elseif (!empty($value)) { $query_struct['where'][$key] = $value; } } } $total = $settlemonthrptdtlDao->count_itmes(); $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 = Mysettlemonthrptdtl::instance()->lists($query_struct); $dataList = Mysettlemonthrptdtl::instance()->mylists($query_struct); foreach ($dataList as $key => $value) { $dataList[$key]['urlbase'] = $this->getUrlBaseByTicketType($dataList[$key]['ticket_type']); if ($value['ticket_type'] != 0 && $value['ticket_type'] != 99) { $dataList[$key]['ticket_type'] = $ticket_type[$value['ticket_type']]; } else { $dataList[$key]['ticket_type'] = ''; } foreach ($value as $k => $v) { if (!is_numeric($v) && empty($v)) { $dataList[$key][$k] = '无'; } } } $this->template->content = new View("distribution/settle_month_dtl_rpt"); $this->template->content->data = $dataList; $this->template->content->ticket_type = $ticket_type; $this->template->content->today = date("Y-m-d", time()); $this->template->content->yesterday = date("Y-m-d", time() - 24 * 3600); }
public function index() { $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(), 'like' => array(), 'orderby' => $orderby, 'limit' => array('per_page' => $per_page, 'offset' => 0)); $faq = Myfaq::instance(); $total = $faq->count($query_struct); $this->pagination = new Pagination(array('base_url' => url::current(), 'uri_segment' => 'page', 'total_items' => $total, 'items_per_page' => $per_page, 'style' => 'digg')); $faqs = $faq->lists($query_struct); $this->template->content = new View("site/faq_list"); $this->template->content->data = $faqs; $this->template->content->title = "site faq list"; }
public function index() { $settlemonthrptDao = Mysettlelog::instance(); $settlecls = Kohana::config('settle.settlecls'); $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)); /** * 搜索 */ $search_arr = array('settlecls', 'date_begin', 'date_end'); foreach ($this->input->get() as $key => $value) { if (in_array($key, $search_arr)) { if ($key == 'date_begin') { $query_struct['where']["date_add >"] = $value . ' 00:00:00'; } elseif ($key == 'date_end') { $query_struct['where']["date_add <"] = $value . ' 24:00:00'; } elseif ($key == 'settlecls' && !empty($value)) { $query_struct['like']["actname"] = $value; } elseif (!empty($value)) { $query_struct['where'][$key] = $value; } } } $total = $settlemonthrptDao->count_itmes(); $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 = Mysettlelog::instance()->lists($query_struct); foreach ($dataList as $key => $value) { $dataList[$key]['actname'] = $settlecls[$value['actname']]; foreach ($value as $k => $v) { if (!is_numeric($v) && empty($v)) { $dataList[$key][$k] = '无'; } } } $this->template->content = new View("distribution/settle_log"); $this->template->content->data = $dataList; $this->template->content->settlecls = $settlecls; $this->template->content->today = date("Y-m-d", time()); $this->template->content->yesterday = date("Y-m-d", time() - 24 * 3600); }
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() { // 初始化国家结构体 $country_query_struct = array('where' => array(), 'orderby' => array('id' => 'DESC')); $this->template->content = new View("site/country_manage_list"); //列表排序 $orderby_arr = array(0 => array('id' => 'DESC'), 1 => array('id' => 'ASC'), 2 => array('iso_code' => 'ASC'), 3 => array('iso_code' => 'DESC'), 4 => array('name' => 'ASC'), 5 => array('name' => 'DESC'), 6 => array('name_manage' => 'ASC'), 7 => array('name_manage' => 'DESC'), 8 => array('position' => 'ASC'), 9 => array('position' => 'DESC')); $orderby = controller_tool::orderby($orderby_arr); if (isset($orderby) && !empty($orderby)) { $country_query_struct['orderby'] = $orderby; } //每页显示条数 $per_page = controller_tool::per_page(); $country_query_struct['limit']['per_page'] = $per_page; //调用分页 $this->pagination = new Pagination(array('total_items' => Mycountry::instance()->query_count($country_query_struct), 'items_per_page' => $per_page)); $country_query_struct['limit']['offset'] = $this->pagination->sql_offset; //调用列表 $this->template->content->country_list = Mycountry::instance()->query_assoc($country_query_struct); }
public function index() { $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)); $total = $this->agentDao->count_agents(); $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; $agentList = $this->agentDao->lists($query_struct); foreach ($agentList as $index => $aAgent) { if ($aAgent['agent_type'] == 12) { $relationQuery = array('user_id' => $aAgent['user_id']); $theRelationList = $this->relationDao->lists($relationQuery); $agentList[$index]['relation'] = $theRelationList[0]; } } $this->template->content = new View("distribution/agent_list"); $this->template->content->data = $agentList; }
public function index() { //权限验证 role::check('manage_payment'); $this->template->content = new View("manage/payment_list"); //搜索功能 $search_arr = array('id'); $where = array(); $where_view = array(); $where['manager_id'] = role::root_manager_id(); //列表排序 $orderby_arr = array(0 => array('id' => 'DESC'), 1 => array('id' => 'ASC'), 2 => array('payment_type_id' => 'ASC'), 3 => array('payment_type_id' => 'DESC'), 4 => array('account' => 'ASC'), 5 => array('account' => 'DESC'), 6 => array('position' => 'ASC'), 7 => array('position' => 'DESC'), 8 => array('active' => 'ASC'), 9 => array('active' => 'DESC')); $orderby = controller_tool::orderby($orderby_arr); //每页显示条数 $per_page = controller_tool::per_page(); //调用分页 $this->pagination = new Pagination(array('total_items' => Mypayment::instance()->count($where), 'items_per_page' => $per_page)); //调用列表 $this->template->content->payment_list = Mypayment::instance()->payments($where, $orderby, $per_page, $this->pagination->sql_offset); }
/** * 当前订单导出配置列表 */ public function index() { // 初始化返回数据 $return_data = array(); //请求结构体 $request_data = array(); try { /* 权限验证 订单导出配置*/ role::check('order_edit'); /* 初始化默认查询条件 */ $order_export_config_query_struct = array('where' => array(), 'like' => array(), 'orderby' => array(), 'limit' => array('per_page' => 20, 'offset' => 0)); /* 得到默认每页显示多少条 */ $per_page = controller_tool::per_page(); /* 调用分页 */ $this->pagination = new Pagination(array('total_items' => Myorder_export::instance()->query_count($order_export_config_query_struct), 'items_per_page' => $per_page)); $order_export_config_query_struct['limit']['offset'] = $this->pagination->sql_offset; $order_export_config_query_struct['limit']['per_page'] = $per_page; $order_exports = Myorder_export::instance()->query_assoc($order_export_config_query_struct); /* 调用列表 */ $this->template->content = new View("order/order_export_list"); $this->template->content->order_exports = $order_exports; } catch (MyRuntimeException $ex) { $return_struct['status'] = 0; $return_struct['code'] = $ex->getCode(); $return_struct['msg'] = $ex->getMessage(); //TODO 异常处理 //throw $ex; if ($this->is_ajax_request()) { $this->template = new View('layout/empty_html'); $this->template->content = $return_struct['msg']; } else { $this->template->return_struct = $return_struct; $content = new View('info'); $this->template->content = $content; /* 请求结构数据绑定 */ $this->template->content->request_data = $request_data; /* 返回结构体绑定 */ $this->template->content->return_struct = $return_struct; } } }
/** * 期号改列表 */ public function index($status = NULL) { $per_page = controller_tool::per_page(); $lotyid = lottnum::getlottid($status); $where = array('lotyid' => $lotyid); //初始化默认查询结构体 $query_struct_default = array('orderby' => array('id' => 'DESC'), 'limit' => array('per_page' => $per_page, 'page' => isset($_GET['page']) ? $_GET['page'] : 1), 'where' => $where); $acobj = Qihaoservice::get_instance(); $return_data['count'] = $acobj->count($query_struct_default); //统计数量 /* 调用分页 */ $this->pagination = new Pagination(array('total_items' => $return_data['count'], 'items_per_page' => $query_struct_default['limit']['per_page'])); $query_struct_current['limit']['page'] = $this->pagination->current_page; $return_data['list'] = $acobj->query_assoc($query_struct_default); //彩种配置 $lottconfig = Kohana::config("ticket_type.type"); $return_data['lottconfig'] = $lottconfig; $return_data['status'] = is_null($status) ? 'dlt' : $status; $this->template->content = new View("lottnum/qihao", $return_data); //$this->template->content->where = $where_view; }