You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
208 lines
7.6 KiB
PHTML
208 lines
7.6 KiB
PHTML
6 years ago
|
<?php
|
||
|
if (!defined('BASEPATH'))
|
||
|
exit('No direct script access allowed');
|
||
|
|
||
|
class pages extends CI_Controller{
|
||
|
|
||
|
public function __construct(){
|
||
|
parent::__construct();
|
||
|
$this->load->model("train_system_model");
|
||
|
$this->load->model("BIZ_train_model");
|
||
|
$this->load->helper('train');
|
||
|
$this->order_status_msg = $this->config->item('train_order_status_msg');
|
||
|
}
|
||
|
|
||
|
public function index($coli_id = null){
|
||
|
if($this->session->userdata('dingname') == '' && $this->session->userdata('dingunionid') == ''){
|
||
|
dingLogin();
|
||
|
}
|
||
|
if($coli_id == null){
|
||
|
$cols_id = $this->input->post("ht_order");
|
||
|
}else{
|
||
|
$cols_id = $coli_id;
|
||
|
}
|
||
|
|
||
|
$list=new StdClass;
|
||
|
if(!empty($cols_id)){
|
||
|
$cold_sn = $this->BIZ_train_model->get_biz_cold($cols_id);
|
||
|
$list->wl = $this->BIZ_train_model->get_operatorInfo($cols_id);
|
||
|
$i=0;
|
||
|
$list->info=array();
|
||
|
foreach ($cold_sn as $v) {
|
||
|
$list->info[$i] = new StdClass;
|
||
|
$list->info[$i]->people = $this->BIZ_train_model->biz_people($v->COLD_SN);
|
||
|
$list->info[$i]->train = $this->BIZ_train_model->get_biz_foi($v->COLD_SN);
|
||
|
$list->info[$i]->status = $this->BIZ_train_model->get_biz_jol($v->COLD_SN);
|
||
|
$i++;
|
||
|
}
|
||
|
$list->cols_id=$cols_id;
|
||
|
}
|
||
|
|
||
|
//查询聚合余额
|
||
|
$back_data = GetPost_http("http://op.juhe.cn/trainTickets/balance.php?key=79f03107b921ef31310bd40a1415c1cb");
|
||
|
$back_data = json_decode($back_data);
|
||
|
if(!empty($back_data->result)){
|
||
|
$list->balance = $back_data->result;
|
||
|
}else{
|
||
|
$list->balance = "NULL";
|
||
|
}
|
||
|
//print_r($list);
|
||
|
$this->load->view('common/header');
|
||
|
$this->load->view('homepage',$list);
|
||
|
$this->load->view('common/footer');
|
||
|
}
|
||
|
|
||
|
//系统列表页面
|
||
|
public function order_list(){
|
||
|
if($this->session->userdata('dingname') == '' && $this->session->userdata('dingunionid') == ''){
|
||
|
dingLogin();
|
||
|
}
|
||
|
$page_size = 10;
|
||
|
$page = $this->input->get("page");
|
||
|
$order = $this->input->get("order");
|
||
|
$web_code = $this->input->get("web_code");
|
||
|
$where = "1=1";//搜索条件
|
||
|
$page_parameter = "";//返回的分页条件参数
|
||
|
if(empty($page) or !is_numeric($page)){
|
||
|
$page=0;
|
||
|
}
|
||
|
if(!empty($order)){
|
||
|
$where = "BIZ_ConfirmLineInfo.COLI_ID='{$order}' OR InfoManager.dbo.trainsystem.ts_ordernumber='{$order}'";
|
||
|
//$where2 = "where BIZ_ConfirmLineInfo.COLI_ID='{$order}' OR JOL_JuheOrder='{$order}'";
|
||
|
$list["order"] = $order;
|
||
|
$page_parameter = "order=".$order;
|
||
|
}
|
||
|
if(!empty($web_code)){
|
||
|
$where = "BIZ_ConfirmLineInfo.COLI_WebCode='{$web_code}'";
|
||
|
$page_parameter = "web_code=".$web_code;
|
||
|
}
|
||
|
|
||
|
//获取订单数据
|
||
|
$data = $this->train_system_model->get_order($page_size,$page,$where);
|
||
|
//print_r($data);die();
|
||
|
$list["data"]=$data->list;
|
||
|
|
||
|
$this->load->library('pagination');
|
||
|
|
||
|
$config['base_url'] = site_url("/apps/trainsystem/pages/order_list?{$page_parameter}");
|
||
|
$config['total_rows'] = $data->count;
|
||
|
$config['per_page'] = $page_size;
|
||
|
$config['page_query_string']=TRUE;
|
||
|
$config['query_string_segment']="page";
|
||
|
$config['cur_tag_open'] = '<li class="active"><a href="#">';
|
||
|
$config['cur_tag_close'] = '</a></li>';
|
||
|
$config['first_tag_open']=$config['last_tag_open']=$config['next_tag_open']=$config['prev_tag_open']=$config['num_tag_open']="<li>";
|
||
|
$config['first_tag_close']=$config['last_tag_close']=$config['next_tag_close']=$config['prev_tag_close']=$config['num_tag_close']="</li>";
|
||
|
|
||
|
$this->pagination->initialize($config);
|
||
|
|
||
|
$list["page_link"]=$this->pagination->create_links();
|
||
|
|
||
|
foreach ($list["data"] as $key => $value) {
|
||
|
$value->info = $this->order_status_msg[$value->ts_status];//自定义说明信息;
|
||
|
}
|
||
|
|
||
|
|
||
|
$this->load->view('header');
|
||
|
$this->load->view('order_list',$list);
|
||
|
$this->load->view('footer');
|
||
|
}
|
||
|
|
||
|
//订单详情页面
|
||
|
public function order(){
|
||
|
if($this->session->userdata('dingname') == '' && $this->session->userdata('dingunionid') == ''){
|
||
|
dingLogin();
|
||
|
}
|
||
|
$ordernumber = $order=$this->input->get("order");
|
||
|
|
||
|
if(empty($ordernumber)){
|
||
|
exit('参数错误');
|
||
|
}
|
||
|
|
||
|
//根据订单号查询订单信息
|
||
|
$data = array();
|
||
|
$train_infos = $this->train_system_model->get_train_infos($ordernumber);
|
||
|
$passpager_detail = $this->train_system_model->get_passager_details($ordernumber);
|
||
|
|
||
|
//构造详情数组
|
||
|
$data['status'] = $train_infos->ts_status;
|
||
|
$data['ordernumber'] = $train_infos->ts_ordernumber;
|
||
|
$data['train_date'] = $train_infos->ts_startdate;
|
||
|
$data['checi'] = $train_infos->ts_checi;
|
||
|
$data['elecnumber'] = $train_infos->ts_elecnumber;
|
||
|
$data['from_station_name'] = $train_infos->ts_fromstationame;
|
||
|
$data['from_station_code'] = $train_infos->ts_fromstationcode;
|
||
|
$data['to_station_name'] = $train_infos->ts_tostationame;
|
||
|
$data['to_station_code'] = $train_infos->ts_tostationcode;
|
||
|
$data['start_time'] = $train_infos->ts_startime;
|
||
|
$data['arrive_time'] = $train_infos->ts_endtime;
|
||
|
$data['channel'] = $train_infos->ts_channel;
|
||
|
$data['msg'] = $train_infos->ts_errormsg;
|
||
|
$data['passengers'] = $passpager_detail;
|
||
|
|
||
|
//聚合订单可以查询实时数据
|
||
|
if($train_infos->ts_channel == 'juhe'){
|
||
|
$post_data=array(
|
||
|
"key"=>"79f03107b921ef31310bd40a1415c1cb",
|
||
|
"orderid"=>$train_infos->ts_ordernumber
|
||
|
);
|
||
|
$back_data = GetPost_http("http://op.juhe.cn/trainTickets/orderStatus",$post_data);
|
||
|
$data['train_date'] = '';
|
||
|
$data['start_time'] = json_decode($back_data)->result->start_time;
|
||
|
$data['arrive_time'] = json_decode($back_data)->result->arrive_time;
|
||
|
}
|
||
|
|
||
|
$this->load->view('bootstrap3/header');
|
||
|
$this->load->view('order',$data);
|
||
|
$this->load->view('bootstrap3/footer');
|
||
|
}
|
||
|
|
||
|
//退票页面
|
||
|
public function refund(){
|
||
|
if($this->session->userdata('dingname') == '' && $this->session->userdata('dingunionid') == ''){
|
||
|
dingLogin();
|
||
|
}
|
||
|
$ordernumber = $order=$this->input->get("order");
|
||
|
|
||
|
if(empty($ordernumber)){
|
||
|
exit('参数错误');
|
||
|
}
|
||
|
|
||
|
//根据订单号查询订单信息
|
||
|
$data = array();
|
||
|
$train_infos = $this->train_system_model->get_train_infos($ordernumber);
|
||
|
$passpager_detail = $this->train_system_model->get_passager_details($ordernumber);
|
||
|
|
||
|
//构造详情数组
|
||
|
$data['ordernumber'] = $train_infos->ts_ordernumber;
|
||
|
$data['cold_sn'] = $train_infos->ts_cold_sn;
|
||
|
$data['train_date'] = $train_infos->ts_startdate;
|
||
|
$data['checi'] = $train_infos->ts_checi;
|
||
|
$data['elecnumber'] = $train_infos->ts_elecnumber;
|
||
|
$data['from_station_name'] = $train_infos->ts_fromstationame;
|
||
|
$data['from_station_code'] = $train_infos->ts_fromstationcode;
|
||
|
$data['to_station_name'] = $train_infos->ts_tostationame;
|
||
|
$data['to_station_code'] = $train_infos->ts_tostationcode;
|
||
|
$data['start_time'] = $train_infos->ts_startime;
|
||
|
$data['arrive_time'] = $train_infos->ts_endtime;
|
||
|
$data['channel'] = $train_infos->ts_channel;
|
||
|
$data['msg'] = $train_infos->ts_errormsg;
|
||
|
$data['return_json'] = $train_infos->ts_returncallback;
|
||
|
$data['passengers'] = $passpager_detail;
|
||
|
|
||
|
//print_r($data);
|
||
|
$this->load->view('header');
|
||
|
$this->load->view('refund',$data);
|
||
|
$this->load->view('footer');
|
||
|
|
||
|
}
|
||
|
|
||
|
public function export(){
|
||
|
if($this->session->userdata('dingname') == '' && $this->session->userdata('dingunionid') == ''){
|
||
|
dingLogin();
|
||
|
}
|
||
|
$this->load->view('header');
|
||
|
$this->load->view('export');
|
||
|
$this->load->view('footer');
|
||
|
}
|
||
|
}
|