我是 CI 的新手。在我的视图页面中,我有一个使用多选的搜索框。所以我可以选择一些数据,并根据我选择的数据进行搜索。但是当我点击按钮显示数据时出现错误
“消息:数组到字符串的转换”
并且无法显示结果。如何解决?
这是控制器页面
function get_menu_access_report()
{
$menu_cos = $_POST['menu_cos'];
$menu_list = $_POST['menu_list'];
if(isset($menu_cos)&&isset($menu_list)){
die(json_encode($this->menu_model->get_menu_access_report($menu_cos,$menu_list)));
}
}
这是模型页面
function get_menu_access_report($menu_cos, $menu_list){
$query="
SELECT osC.name AS project, mn.name AS menu_name, bp.name AS employee, MAX(tm.is_all_data) AS all_data,
GROUP_CONCAT(t.name SEPARATOR '<br>') AS title
FROM db_mstr.m_menu mn
JOIN db_mstr.m_grp_menu_dt gmd ON mn.id = gmd.menu_id
JOIN db_mstr.m_grp_menu gm ON gmd.grp_menu_id = gm.id
JOIN db_mstr.m_title_menu tm ON gm.id = tm.grp_menu_id
JOIN db_mstr.m_title t ON tm.title_id = t.id
JOIN db_mstr.m_os os ON t.os_id = os.id
JOIN db_mstr.m_os osC ON os.cos_id = osC.id
JOIN db_mstr.m_bp_title bpt ON t.id = bpt.title_id AND bpt.is_deleted=0
JOIN db_mstr.m_bp bp ON bpt.bp_id = bp.id
where mn.id='$menu_list' and osC.id = '$menu_cos'
GROUP BY project,employee";
return $this->db->query($query)->result();
}