- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
在 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/
我的想法是,当我添加一个新行时,其中一个字段 (ID) 必须具有默认值 + 另一个字段的值 + 日期。 ID 示例:IDPeter17112017 所以,这是我的代码,但它不起作用,或者可能不是最好的
我对 Grocery Grocery 很陌生。我在 insert_before_callback 上遇到了一些逻辑操作问题 我有一个产品表,当我出售产品时,它会检查产品的可用性。如果可用,则会将其插入
我正在尝试使用 callback_column 更改列值功能。 $crud = new grocery_CRUD(); $crud -> set_table('booking'); //$crud->
我在 GroceryCrud 中有一个问题。 我想在一张表中插入数据。表是这样的: id, card_no, site_code, site_no card_no 是独一无二的,我已经实现了它。 然而
我一直在使用 Grocery Crud开发一个简单的本地应用程序,允许用户自己注册并喜欢乐队并对其进行评分,并选择他们认识的也在该应用程序中注册的人。 实体: Person(person_id,per
我在 Mysql 中用这些列创建了一个表 secretNumber(主键和 AI) 姓名 日期 等... 我的想法是当我要向这个表中添加一个新项目时,自动生成一个“ secret 数字”但必须有 3
我是 Grocery CRUD 新手。这个库节省的时间给我留下了深刻的印象,我要感谢所有参与这个项目的优秀开发人员。 我在显示表中的日期字段时遇到一个小问题。当我按下编辑按钮时,它会显示在编辑和查看页
我在上传视频文件时遇到食品 Grocery 问题。在上传过程中显示过程图像,完成后显示空白,视频文件未上传。我已经为我的上传文件夹设置了 777 权限,我尝试上传 mp4、flv、3gp 文件格式。
需要一些帮助来建立产品和数量之间的关系。 Table1: Products Columns: id , code, unit, name, size , cost , price - Table2:
我是 Grocery 店的新手, 我不知道如何在不刷新页面的情况下重新加载 Grocery 网格。 目前我已经用ajax重新加载了所有页面 $.ajax({ type:'POS
在 grocery crud 中,不会搜索相关表。 仅针对该表字段进行搜索。 function index() { $crud = new grocery_CRUD(); $crud
您好,我正在将 Grocery CRUD 与 HMVC 结合使用,但我遇到了一些奇怪的问题。 class Source extends MX_Controller { function __c
在 Codeigniter 中通过 Grocery CRUD 库使用搜索查询时,在表中搜索数据的“0”值会得到完整的表。为什么? $crud = new grocery_CRUD();
我的 Controller ,在 invHdrData 表中插入一行,我希望该表中的最大文档编号自动插入文档编号插入之前的回调不起作用。那么问题出在哪里呢?如果您能给我一些答案,我将不胜感激:) 我的
我使用grocery-crud 进行简单的 SQL 选择 $crud->set_table('lista_ab'); $crud->set_relation('id_ab','lista_ab_ter
如何在 Grocery 店 CRUD 中使用 mysql AES 解密来匹配表中的数据? 获取 CRUD 设置关系时出错,如下所示: $crud->set_relation(AES_DECRYPT(d
我有下表 CREATE TABLE IF NOT EXISTS `maintrequests` ( `id` int(11) NOT NULL AUTO_INCREMENT, `propID`
有没有办法让 Grocery CRUD 呈现的特定列右对齐? 在我的例子中,我只想专门右对齐 Bonus Value 列。 非常感谢您的帮助。 最佳答案 在您的 Controller 中,将您想要右对
我需要执行的函数处理 DateTime。 public function dtr() { try { $crud = new grocery_CRUD(); $
我有两张 table CREATE TABLE `tbl_patient` ( id_patient INTEGER NOT NULL PRIMARY KEY AUTO_IN
我是一名优秀的程序员,十分优秀!