第16行$data['paidls']=$this->paidlisting->ls();
抛出错误调用未定义的方法。我在这里粘贴了我的控制器和模型。
<?php
class Package extends CI_Controller{
public function __construct(){
parent::__construct();
$this->load->model('advertise/advertise_model','advertise');
$this->load->model('advertise/package_model','package');
$this->load->model('advertise/paidlisting_model','paidlisting');
$this->load->model('gallery/gallery_model','gallery');
$this->load->model('log','log');
$this->load->library('payment');
$myself = $this->session->userdata('client');
}
public function index(){
$data = array();
$data['banners']=$this->package->ls();
$data['paidls']=$this->paidlisting->ls();
$this->load->library('media');
foreach($data['banners'] as $key=>$banner)
{
if($this->gallery->fetchAllData('adv_package',$banner->id)){
$images = array();
$imgs = $this->gallery->fetchAllData('adv_package',$banner->id);
foreach ($imgs as $im)
{
$images[] =array(to_imageurl($im),'alt'=>$im->alt);
}
$data['banners'][$key]->image = $images;
}else{
$data['banners'][$key]->image = '';
}
}
foreach($data['paidls'] as $key=>$row)
{
if($this->gallery->fetchAllData('adv_paidlisting_package',$row->id))
{
$images = array();
$imgs = $this->gallery->fetchAllData('adv_paidlisting_package',$row->id);
foreach ($imgs as $im)
{
$images[] =array(to_imageurl($im),'alt'=>$im->alt);
}
$data['paidls'][$key]->image = $images;
}else{
$data['paidls'][$key]->image = '';
}
}
public function ls(){
$result = $this->db->get_where('adv_paidlisting_package',array('status'=>1));
$data = array();
if($result->num_rows()){
foreach($result->result() as $item){
array_push($data,$item);
}
}
return $data;
}
请帮我解决。