From b44fb213dc3bcdbe059eda4e48a4efcb8f8c608e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=B9=8F?= Date: Mon, 30 Jun 2025 14:56:15 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E4=B8=80=E6=97=A5=E6=B8=B8?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E7=B1=BB=E5=9E=8B=E5=8F=8A=E6=89=A9=E5=B1=95?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ctmobilefirst/controllers/api.php | 8 ++ .../ctmobilefirst/models/api_model.php | 89 ++++++++++++++++++- 2 files changed, 96 insertions(+), 1 deletion(-) diff --git a/application/third_party/ctmobilefirst/controllers/api.php b/application/third_party/ctmobilefirst/controllers/api.php index 0998b34f..8ae011d8 100644 --- a/application/third_party/ctmobilefirst/controllers/api.php +++ b/application/third_party/ctmobilefirst/controllers/api.php @@ -478,6 +478,14 @@ class Api extends CI_Controller { echo json_encode($list,JSON_UNESCAPED_UNICODE); } + /** + * 获取发布的一日游详细页的所有产品对应的类型列表,扩展类型列表。(用于搜索页) + */ + public function getPagTypeList(){ + $list = $this->api_model->getLineTypeList(); + echo json_encode($list,JSON_NUMERIC_CHECK); + } + } /* End of file Api.php */ diff --git a/application/third_party/ctmobilefirst/models/api_model.php b/application/third_party/ctmobilefirst/models/api_model.php index 1d96f92c..f0f17f17 100644 --- a/application/third_party/ctmobilefirst/models/api_model.php +++ b/application/third_party/ctmobilefirst/models/api_model.php @@ -649,7 +649,7 @@ class Api_model extends CI_Model { /** * 获取所有录入线路的列表 */ - public function getTourList(){ + function getTourList(){ $sql = "SELECT convert(varchar(100),( SELECT TOP 1 im_value FROM information_ct.dbo.infoMetas @@ -751,6 +751,93 @@ class Api_model extends CI_Model { } + + + /** + * 获取发布的一日游详细页的所有产品对应的类型列表,扩展类型列表。(用于搜索页) + */ + function getPagTypeList(){ + $sql = " SELECT DISTINCT PAG_Type ,PAG_ExtendType + FROM dbo.BIZ_PackageInfo P1 INNER JOIN + dbo.BIZ_PackageInfo2 p2 ON P1.PAG_SN = p2.PAG2_PAG_SN + WHERE (pag_dei_sn= 25 ) + AND (p2.PAG2_Check = 2) + AND (PAG2_LGC = 107) + and PAG_Code in ( SELECT convert(varchar(100),( + SELECT TOP 1 im_value + FROM information_ct.dbo.infoMetas + WHERE im_key = 'meta_ct_page_value' + AND im_ic_id = ic_id + )) AS code + FROM information_ct.dbo.infoContents + INNER JOIN information_ct.dbo.infoStructures ON ic_id = is_ic_id + WHERE is_sitecode ='shanghai' AND ic_status = 1 + and ic_id in (select im_ic_id from information_ct.dbo.infoMetas where im_key='meta_ct_page_type' and convert(varchar(100),im_value)='daytripdetail') + ) "; + + $query =$this->HT->query($sql); + $type_values = array(); //类型 + $extendType_values = array(); //扩展类型 + + if ($query->num_rows() > 0) { + foreach ($query->result_array() as $row) { + $column_data = $row['PAG_Type']; + // 分割逗号分隔的值 + $values = explode(',', $column_data); + // 去除每个值的空白字符 + $values = array_map('trim', $values); + // 合并到总数组 + $type_values = array_merge($type_values, $values); + + $column_data2 = $row['PAG_ExtendType']; + // 分割逗号分隔的值 + $values2 = explode(',', $column_data); + // 去除每个值的空白字符 + $values2 = array_map('trim', $values); + // 合并到总数组 + $extendType_values = array_merge($extendType_values, $values2); + } + } + + // 去重 + $unique_values = array_unique($type_values); + $unique_values2 = array_unique($extendType_values); + + // 合并为逗号分隔的字符串,所有类型的字符串 + $type_string = implode(',', $unique_values); + $extendType_string = implode(',', $unique_values2); + + $resultClass = new stdClass(); + + $sql2 = " select SYC_SN, SYC2_CodeDiscribe + from SystemCode + inner join SystemCode2 on SYC_SN = SYC2_SYC_SN + where SYC_Type=6 and SYC2_LGC=".$this->CTLGC." and SYC2_CodeDiscribe>'' and SYC_SN in (".$type_string.") "; + + + $query = $this->HT->query($sql2); + if ($query->num_rows()>0){ + $resultClass->type = $query->result(); + }else { + $resultClass->type = []; + } + + $sql3 = " select SYC_SN, SYC2_CodeDiscribe + from SystemCode + inner join SystemCode2 on SYC_SN = SYC2_SYC_SN + where SYC_Type=6 and SYC2_LGC=".$this->CTLGC." and SYC2_CodeDiscribe>'' and SYC_SN in (".$extendType_string.") "; + + $query = $this->HT->query($sql3); + if ($query->num_rows()>0){ + $resultClass->extendType = $query->result(); + }else { + $resultClass->extendType = []; + } + + return $resultClass; + } + + } /* End of file Api_model.php */