public function get_result_dlt($id, $is_orderid = TRUE) { if ($is_orderid) { return Plans_lotty_orderService::get_instance()->get_by_order_id($id); } else { return Plans_lotty_orderService::get_instance()->get_by_plan_id($id); } }
/** * 方案列表 */ public function index($status = null) { $per_page = controller_tool::per_page(); $lotyid = lottnum::getlottid($status); $isnowissue = Qihaoservice::get_instance()->getisnow($lotyid); $nowissue = $isnowissue['qihao']; $where = array('lotyid' => $lotyid, 'qihao' => $nowissue); if ($_GET) { $issue = $this->input->get('issue') ? $this->input->get('issue') : -1; $stat = $this->input->get('stat') ? $this->input->get('stat') : -1; $bid = $this->input->get('bid'); $wtype = $this->input->get('wtype'); if ($issue != -1) { $where['qihao'] = $issue; } else { unset($where['qihao']); } if ($stat == 0 || $stat == 2) { $where['isfull'] = $stat; } elseif ($stat == 1) { $where['restat'] = $stat; } elseif ($stat == 3) { $where['cpstat'] = 2; } if ($bid) { $where['basic_id'] = $bid; } if ($wtype > 0) { $where['wtype'] = $wtype; } } //初始化默认查询结构体 $query_struct_default = array('orderby' => array('id' => 'DESC'), 'limit' => array('per_page' => $per_page, 'page' => 1), 'where' => $where); $acobj = Plans_lotty_orderService::get_instance(); $return_data['count'] = $acobj->count($query_struct_default); //统计数量 if (isset($stat) && $stat == 3) { $return_data['sum'] = $acobj->query_sum($query_struct_default, array('allmoney', 'afterbonus')); } /* 调用分页 */ $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'] = $acobj->query_assoc($query_struct_default); //彩种配置 $lottconfig = Kohana::config("ticket_type.type"); $return_data['lottconfig'] = $lottconfig; //方案状态说明 $lottnumconfig = Kohana::config("lottnum"); $return_data['cpstatinfo'] = $lottnumconfig['cpstatinfo']; $return_data['restatinfo'] = $lottnumconfig['restatinfo']; $return_data['isfullinfo'] = $lottnumconfig['isfullinfo']; $return_data['status'] = is_null($status) ? 'dlt' : $status; //近10期期号列表 $return_data['issues'] = $this->getissue(is_null($status) ? 'dlt' : $status); $return_data['theissue'] = isset($issue) ? $issue : $nowissue; $return_data['site_config'] = Kohana::config('site_config.site'); $host = $_SERVER['HTTP_HOST']; $dis_site_config = Kohana::config('distribution_site_config'); if (array_key_exists($host, $dis_site_config) == true && isset($dis_site_config[$host])) { $return_data['site_config']['site_title'] = $dis_site_config[$host]['site_name']; $return_data['site_config']['keywords'] = $dis_site_config[$host]['keywords']; $return_data['site_config']['description'] = $dis_site_config[$host]['description']; } $this->template->content = new View("lottnum/order", $return_data); }