0
我有这样的查询搜索多个数据,但我希望它是动态的,并连接到我的应用程序离子它只是静态我将如何将我的搜索查询连接到离子应用程序?
user_model.php(coeigniter)
public function get_halal()
{
$term = "Buko,Beef,Sugar";
$terms = explode(',', $term);
foreach($terms as $term){
$this->db->select('*');
$this->db->from('recipe');
$this->db->join('menu', 'menu.recipe_id = recipe.recipe_id');
$this->db->join('ingredient', 'ingredient.ingredient_id = menu.ingredient_id');
$this->db->where('menu.category_id = 2');
$this->db->like('ingredient.name', $term);
$query = $this->db->get()->result();
}
return $query;
}
。我会怎么做?
解析'$ term'作为参数? –