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;
}
Пожалуйста, помогите мне исправить.
Задача ещё не решена.
Других решений пока нет …