Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Codeigniter 如何通过下拉关系字段过滤关系\n\n多选_Codeigniter_Grocery Crud - Fatal编程技术网

Codeigniter 如何通过下拉关系字段过滤关系\n\n多选

Codeigniter 如何通过下拉关系字段过滤关系\n\n多选,codeigniter,grocery-crud,Codeigniter,Grocery Crud,我有四张桌子: 项目 *item_id* vendor_id title *vendor_id* title *location_id* title vendor_id vendor_location_id priority 供应商 *item_id* vendor_id title *vendor_id* title *location_id* title vendor_id vendor_location_id priority 供应商位置 *item_id* vendor_

我有四张桌子:

项目

*item_id*
vendor_id
title
*vendor_id*
title
*location_id*
title
vendor_id
vendor_location_id
priority
供应商

*item_id*
vendor_id
title
*vendor_id*
title
*location_id*
title
vendor_id
vendor_location_id
priority
供应商位置

*item_id*
vendor_id
title
*vendor_id*
title
*location_id*
title
vendor_id
vendor_location_id
priority
供应商\供应商\地点

*item_id*
vendor_id
title
*vendor_id*
title
*location_id*
title
vendor_id
vendor_location_id
priority
这是我的控制器:

$crud->set_theme('datatables');
$crud->set_subject('Items');
$crud->set_table('items');
$crud->set_relation('vendor_id', 'vendors', 'title');
$crud->set_relation_n_n('Locations', 'items_vendor_locations', 'vendor_locations', 'item_id', 'vendor_location_id', '{location_title} {country} {city}', 'priority');
如何根据我通过供应商所做的选择筛选关系?例如:我选择vendor 30,位置仅显示vendor 30的位置,而不是所有位置。我想这是通过回调函数实现的。有人能给我举个例子或大致的指导如何做到这一点吗