gpt4 book ai didi

php - 搜索不会发生在 Grocery 店里

转载 作者:塔克拉玛干 更新时间:2023-11-03 05:45:01 24 4
gpt4 key购买 nike

在 grocery crud 中,不会搜索相关表。

仅针对该表字段进行搜索。

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();
}

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;
}
}

这里没有搜索名字。

有人对此有解决方案吗?

提前致谢。

最佳答案

您好@DelvinPaul:希望您的问题得到解决。以防万一它没有解决,请尝试使用

changeName 中调试您的查询
log_message('info','Query: '.$this->db->last_query());
log_message('info','Result Returned: '.print_r($new,true));

将这些语句放在您的 changeName 函数中的以下行之后:

$new = $this->db->select('name')->where('another_table.id', $row->id)->get('another_table')->result();

并且不要忘记在您的配置文件中更改 $config['log_threshold'] = 3;。调试后,请更清楚地更新您的问题,以便我们回答。

关于php - 搜索不会发生在 Grocery 店里,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15292091/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com