diff --git a/application/controllers/info_amp.php b/application/controllers/info_amp.php index 6fb9fb35..f200ca3c 100644 --- a/application/controllers/info_amp.php +++ b/application/controllers/info_amp.php @@ -11,6 +11,7 @@ class Info_amp extends CI_Controller parent::__construct(); //$this->permission->is_admin(); $this->load->model('InfoMetas_model'); + $this->load->model('InfoContents_model'); //CORS TEST header('Access-Control-Allow-Origin:*'); } @@ -64,7 +65,7 @@ class Info_amp extends CI_Controller } else { echo json_encode(array( "succ" => false, - "message" => "save_amp() -> Post para error." + "message" => "save_amp() -> 参数传递错误。" )); } } @@ -75,7 +76,7 @@ class Info_amp extends CI_Controller if (!$icid) { echo json_encode(array( "succ" => false, - "message" => "load_amp() -> Post para error." + "message" => "load_amp() -> 参数传递错误。" )); return false; } @@ -91,7 +92,31 @@ class Info_amp extends CI_Controller } else { echo json_encode(array( "succ" => false, - "message" => "load_amp() -> No data error." + "message" => "load_amp() -> 无数据返回。" + )); + } + } + + public function load_info() + { + $icid = $this->input->post('icid'); + if ($icid) { + $ic = $this->InfoContents_model->get_ic_contents2($icid); + if ($ic) { + echo json_encode(array( + "succ" => true, + "info" => $ic->ic_content + )); + } else { + echo json_encode(array( + "succ" => false, + "message" => "load_info() -> 无数据返回。" + )); + } + } else { + echo json_encode(array( + "succ" => false, + "message" => "load_info() -> 参数传递错误。" )); } } diff --git a/application/models/infoContents_model.php b/application/models/infoContents_model.php index 7e6b3e64..026f33a0 100644 --- a/application/models/infoContents_model.php +++ b/application/models/infoContents_model.php @@ -124,6 +124,21 @@ class InfoContents_model extends CI_Model } } + public function get_ic_contents2($ic_id) + { + $sql="SELECT top 1 ic_id, ic_content from infoContents where ic_id=?"; + $query=$this->HT->query($sql,array($ic_id)); + if ($query->result()) + { + $row = $query->row(); + return $row; + } + else + { + return FALSE; + } + } + public function get_ic_contents_by_list($ic_id_list) { $ic_id_list=trim($ic_id_list);