From 39f6f144db98c32239d02be1072efbbdc5e6707b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=B9=8F?= Date: Tue, 23 Apr 2024 09:12:50 +0800 Subject: [PATCH] =?UTF-8?q?=E7=81=AB=E8=BD=A6=E9=A2=84=E5=94=AE=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E7=BB=B4=E6=8A=A4=E5=8A=9F=E8=83=BD=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../trainsystem/controllers/pages.php | 110 ++++++++++++++++++ .../trainsystem/models/BIZ_train_model.php | 53 +++++++++ .../trainsystem/views/homepage.php | 3 +- 3 files changed, 165 insertions(+), 1 deletion(-) diff --git a/application/third_party/trainsystem/controllers/pages.php b/application/third_party/trainsystem/controllers/pages.php index b4c46a50..ee9c1da1 100644 --- a/application/third_party/trainsystem/controllers/pages.php +++ b/application/third_party/trainsystem/controllers/pages.php @@ -246,4 +246,114 @@ class pages extends CI_Controller{ $this->load->view('export'); $this->load->view('footer'); } + + //预售时间列表 + public function presale_list(){ + $page_size = 10; + $page = $this->input->get("page"); + $stationcn = $this->input->get("stationcn"); + $web_code = $this->input->get("web_code"); + $where = "1=1";//搜索条件 + $page_parameter = "";//返回的分页条件参数 + if(empty($page) or !is_numeric($page)){ + $page=0; + } + if(!empty($stationcn)){ + $where = " TST_station_cn like '%{$stationcn}%' "; + $list["stationcn"] = $stationcn; + $page_parameter = "stationcn=".$stationcn; + } + + //获取订单数据 + $data = $this->BIZ_train_model->get_presale_list($page_size,$page,$where); + // print_r(json_encode($data));die(); + $list["data"]=$data->list; + + $this->load->library('pagination'); + + $config['base_url'] = site_url("/apps/trainsystem/pages/presale_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'] = '
  • '; + $config['cur_tag_close'] = '
  • '; + $config['first_tag_open']=$config['last_tag_open']=$config['next_tag_open']=$config['prev_tag_open']=$config['num_tag_open']="
  • "; + $config['first_tag_close']=$config['lasbt_tag_close']=$config['next_tag_close']=$config['prev_tag_close']=$config['num_tag_close']="
  • "; + + $this->pagination->initialize($config); + + $list["page_link"]=$this->pagination->create_links(); + + $this->load->view('header'); + $this->load->view('presale_list',$list); + $this->load->view('footer'); + + } + + //预售时间编辑 + public function presale_edit(){ + $ordernumber = $tstid=$this->input->get("tstid"); + + if(empty($tstid)){ + exit('参数错误'); + } + + //根据ID号查询信息 + $saletime_detail = $this->BIZ_train_model->get_saletime_detail($tstid); + + $data["info"] = $saletime_detail; + $this->load->view('header'); + $this->load->view('presale_edit',$data); + $this->load->view('footer'); + + } + + //预售时间编辑保存 + public function presale_editsave(){ + $TST_id = $this->input->get_post("TST_id"); + $TST_station_cn = trim($this->input->get_post("TST_station_cn")); + $TST_saletime = trim($this->input->get_post("TST_saletime")); + $TST_station_code = trim($this->input->get_post("TST_station_code")); + + $data = new stdClass(); + $data->TST_id = $TST_id; + $data->TST_station_cn = $TST_station_cn; + $data->TST_saletime = $TST_saletime; + $data->TST_station_code = $TST_station_code; + + $this->BIZ_train_model->update_saletime($data); + + $rUrl = ''; + echo $rUrl; + } + + + public function presale_add(){ + $this->load->view('header'); + $this->load->view('presale_add'); + $this->load->view('footer'); + } + + public function presale_addsave(){ + $TST_station_cn = trim($this->input->get_post("TST_station_cn")); + $TST_saletime = trim($this->input->get_post("TST_saletime")); + $TST_station_code = trim($this->input->get_post("TST_station_code")); + + $data = new stdClass(); + $data->TST_station_cn = $TST_station_cn; + $data->TST_saletime = $TST_saletime; + $data->TST_station_code = $TST_station_code; + + $this->BIZ_train_model->add_saletime($data); + + $rUrl = ''; + echo $rUrl; + + } } diff --git a/application/third_party/trainsystem/models/BIZ_train_model.php b/application/third_party/trainsystem/models/BIZ_train_model.php index 040b5437..032ae2a4 100644 --- a/application/third_party/trainsystem/models/BIZ_train_model.php +++ b/application/third_party/trainsystem/models/BIZ_train_model.php @@ -363,7 +363,60 @@ class BIZ_train_model extends CI_Model { $query = $this->HT->query($sql,$station); return $query->row(); } + + //预售时间列表 + public function get_presale_list($pagesize=10,$page=0,$where="1=1"){ + $data=new StdClass(); + //获取总条数 + $sql="SELECT COUNT(*) AS count FROM TrainSaleTime + WHERE + {$where} + "; + $query = $this->HT->query($sql); + $count=$query->result(); + $data->count=$count[0]->count; + + $sql="SELECT TOP {$pagesize} TST_id,TST_station_cn,TST_station_code,TST_saletime,TST_updatetime from TrainSaleTime + WHERE + TST_id not in ( select top {$page} TST_id from TrainSaleTime where {$where} Order by isnull(TST_updatetime,0) desc,TST_id desc) + AND + {$where} + ORDER BY isnull(TST_updatetime,0) desc,TST_id desc "; + $query = $this->HT->query($sql); + $data->list=$query->result(); + return $data; + } + //预售时间详细 + public function get_saletime_detail($tstid){ + $sql = 'select * from TrainSaleTime where TST_id = ?'; + $query = $this->HT->query($sql,$tstid); + return $query->row(); + } + + //更新预售时间 + public function update_saletime($data){ + $sql = "update TrainSaleTime + set + TST_station_cn = '{$data->TST_station_cn}', + TST_saletime = '{$data->TST_saletime}', + TST_station_code = '{$data->TST_station_code}', + TST_updatetime = getdate() + where TST_id = '{$data->TST_id}' "; + + $query = $this->HT->query($sql); + } + + //添加预售时间 + public function add_saletime($data){ + $sql = " insert into TrainSaleTime (TST_station_cn,TST_saletime,TST_station_code,TST_updatetime) + values (?,?,?,getdate()) "; + + $query = $this->HT->query($sql ,array($data->TST_station_cn,$data->TST_saletime,$data->TST_station_code)); + + } + + //筛选符合发送邮件的订单 public function auto_sendmail(){ $time = date('Y-m-d',time()); diff --git a/application/third_party/trainsystem/views/homepage.php b/application/third_party/trainsystem/views/homepage.php index 096ec0f8..5088ceaf 100644 --- a/application/third_party/trainsystem/views/homepage.php +++ b/application/third_party/trainsystem/views/homepage.php @@ -77,7 +77,8 @@ function selseat(seat){
    -

    翰特订单号 订单列表>>携程改签>>导出交易记录>> 版本:V2.0聚合余额(RMB):

    +

    翰特订单号 订单列表>>预售时间维护>> 版本:V2.0聚合余额(RMB):

    +