简体   繁体   English

set_relation_n_n 与“不在”杂货店 Crud

[英]set_relation_n_n with "Not in" in grocery Crud

I have one relation n to n, and it's working fine but I need filter with not in .我有一个 n 与 n 的关系,它工作正常,但我需要使用 not in 的过滤器。 please see the code below请看下面的代码

$crud ->set_relation_n_n('Productos', 'donaciones_productos', 'productos', 'donaciones_id', 'productos_id', '{nombre}({serie})','id',array('id_estado'=>5,'activo'=>1));

but i need include other filter with sentence "not in" .但我需要包含其他带有句子“not in”的过滤器。 Some similar to一些类似于

$this->db->where ('productos.id not in (select productos_id from donaciones_productos)');

I hope you can help me, and thanks for your time and help我希望你能帮助我,感谢你的时间和帮助

Thanks in advance提前致谢

For me when I get into this kind of problem, the best solution is to turn to the "views",对我来说,当我遇到这种问题时,最好的解决办法是转向“观点”,

You can create view with the exact result you expect and set_primary_key in grocery crud that will deal with the view like a table but you need to customize the update and insert call backs to affect original tables,您可以使用您期望的确切结果和 set_primary_key 在杂货杂货中创建视图,该视图将像处理表一样处理视图,但您需要自定义更新和插入回调以影响原始表,

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM