我有两个功能getCompanyDetails
和getHostingDetails
第一个数据库getCompanyDetails
工作正常,但getHostingDetails
显示
Trying to get property of non-object
获取公司详细信息:
控制器: $data['companyName'] = $this->quote->getCompanyDetails()->companyName;
模型:
public function getCompanyDetails()
{
$this->db->select('companyName,companySlogan,companyContact,
companyEmail,companyWebsite,companyPhone,
companyFax,companyAddress');
$this->db->from('companyDetails');
$result = $this->db->get();
if($result->num_rows()<1)
{
return FALSE;
}else{
return $result->row();
}
}
获取主机详细信息:
控制器:
$data['hostingRequired'] = $this->quote->getHostingDetails()->hostingRequired;
模型:
public function getHostingDetails()
{
$this->db->select('hostingRequired,domainRequired,domainToBeReged,
domaintoBeReged0,domainTransfer,domainToBeTransfered,
domainToBeTransfered0,currentHosting');
$this->db->from('hostingDetails');
$result = $this->db->get();
if($result->num_rows()<1)
{
return FALSE;
}else{
return $result->row();
}
}