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.
information-system/application/models/import_adv_model.php

76 lines
2.3 KiB
PHP

<?php
/**
*
* 数据导入
*
*/
class Import_adv_model extends CI_Model
{
private $ht;
private $srms;
function __construct()
{
parent::__construct();
$this->ht = $this->load->database('HT', TRUE);
$this->srms = $this->load->database('SRMS', TRUE);
}
/**
*
* 获取faq列表
*
*/
function get_faq($site_code, $site_lgc)
{
$sql = "SELECT swsn.WSN_ID, \n"
. " swsn.WSN_Title, \n"
. " swsn.WSN_Memo, \n"
. " swsn.WSN_ViewNum, \n"
. " swsn.WSN_UserName, \n"
. " swsn.WSN_LastDate, \n"
. " swsc.SFC2_Title, \n"
. " swsc.SFC2_SFCID, \n"
. " swsc.SFC2_Byname, \n"
. " swsn.WSN_WebSiteCode \n"
. "FROM SRMS_WebSite_Note swsn \n"
. " INNER JOIN SRMS_WebSite_Category swc \n"
. " ON swc.SFC_ID = swsn.WSN_SFCID \n"
. " AND swc.SFC_Type = 2 \n"
. " INNER JOIN SRMS_WebSite_Category2 swsc \n"
. " ON swsc.SFC2_SFCID = swc.SFC_ID \n"
. "WHERE swsn.WSN_Status <> 2 \n"
. " AND swsc.SFC2_LGC = ? \n"
. " AND swsn.WSN_WebSiteCode = ? \n"
. "ORDER BY \n"
. " swsn.WSN_ViewNum DESC";
$query = $this->srms->query($sql, array($site_lgc, $site_code));
//print_r($this->srms->queries);
return $query->result();
}
/**
*
* 获取faq的根节点的is_id
*
*/
public function get_faq_root_isid($site_code)
{
$sql = "SELECT TOP 1 s.is_id \n"
. "FROM infoContents c \n"
. " INNER JOIN infoStructures s \n"
. " ON s.is_ic_id = c.ic_id \n"
. " AND s.is_sitecode = c.ic_sitecode \n"
. "WHERE c.ic_ht_area_type = 'q' \n"
. " AND s.is_parent_id = 0 \n"
. " AND s.is_level = 1 \n"
. " AND c.ic_sitecode = ? ";
$query = $this->ht->query($sql, array($site_code));
return $query->row()->is_id;
}
}
// end of Import_adv_model