![](/img/trans.png)
[英]Set_relation_n_n grocery crud and condeigniter and MYSQL
[英]set_relation_n_n with "Not in" in grocery Crud
我有一個 n 與 n 的關系,它工作正常,但我需要使用 not in 的過濾器。 請看下面的代碼
$crud ->set_relation_n_n('Productos', 'donaciones_productos', 'productos', 'donaciones_id', 'productos_id', '{nombre}({serie})','id',array('id_estado'=>5,'activo'=>1));
但我需要包含其他帶有句子“not in”的過濾器。 一些類似於
$this->db->where ('productos.id not in (select productos_id from donaciones_productos)');
我希望你能幫助我,感謝你的時間和幫助
提前致謝
對我來說,當我遇到這種問題時,最好的解決辦法是轉向“觀點”,
您可以使用您期望的確切結果和 set_primary_key 在雜貨雜貨中創建視圖,該視圖將像處理表一樣處理視圖,但您需要自定義更新和插入回調以影響原始表,
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.