2

I have one relation n to n, and it's working fine but I need filter with 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" . 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

VhsPiceros
  • 410
  • 1
  • 8
  • 17
  • For complex relations/filters it may be better to provide a [model](http://www.grocerycrud.com/documentation/options_functions/set_model). – jrierab Feb 24 '16 at 16:49

1 Answers1

0

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,