我的模型中有两个函数,我想在我的模型中调用其他模型,但实际上是错误数组到字符串转换。 这是我的代码:
public function get_detail_activity()
{
$status=$activity;//call function model activity
$query=$this->db->query("SELECT
t_trx_activity.activity_id FROM t_trx_activity
JOIN t_trx_activity_detail ON
t_trx_activity_detail.activity_id =t_trx_activity.activity_id
WHERE t_trx_activity.activity_id = '".$status."' //function put here");
if($query->num_rows()>0)
{
return $query->result();
}
else
{
return array();
}
public function activity()
{
$query=$this->db->query("SELECT t_trx_activity.activity_id
FROM t_trx_activity
ORDER BY
t_trx_activity.activity_id DESC LIMIT 1");
$nik=$this->session->userdata('nik');
if($query->num_rows()>0)
{
return $query->result();
}
else
{
return array();
}
}
如何在一个模型中调用其他模型的函数?
答案 0 :(得分:0)
您没有正确调用该功能,请尝试以下操作,
{{1}}