小编Del*_*aul的帖子

在杂货店搜寻没有发生的事情

在杂货店中,相关表格不会进行搜索.

搜索仅发生在该表字段中.

function index()  { 
    $crud = new grocery_CRUD();
    $crud->set_theme('flexigrid');
    $crud->set_table('table_name');
    $crud->display_as('id','Name');
    $crud->callback_column('id', array($this, 'changeName'));
    $output = $crud->render();
} 
Run Code Online (Sandbox Code Playgroud)
function changeName($value, $row)  {
    $new = $this->db->select('name')->where('another_table.id', $row->id)->get('another_table')->result();
    if(!empty($new)){
        return $new[0]->name;
    } else {
        return $value;
    }
}
Run Code Online (Sandbox Code Playgroud)

这里搜索名称没有发生.

有人有解决方案吗?

提前致谢.

php codeigniter crud grocery-crud

5
推荐指数
1
解决办法
2562
查看次数

标签 统计

codeigniter ×1

crud ×1

grocery-crud ×1

php ×1