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'作爲參數? –