options where clause not working

options where clause not working

stpstp Posts: 6Questions: 2Answers: 0
edited March 2019 in DataTables

What i am doing wrong. I try filter jury table select list jury.name values. I have session customer_id and jury table also column name customer_id.

\ code \

     Editor::inst( $db, 'member' )
           ->fields(
       Field::inst( 'member.id' ),
               Field::inst( 'juryid' )
                  ->options( Options::inst()
                          ->table( 'jury' )
                          ->value( 'id' )
                          ->label( 'name' )
                          **->where( 'jury.customer_id', $_SESSION['customer_id'], '=' )   \\ SO THIS NOT WORKING**
        )
                    ->validator( Validate::dbValues() )
          )
     ->leftJoin( 'jury', 'jury.id', '=', 'memberjurys.juryid' )
->leftJoin( 'members', 'members.id', '=', 'memberjurys.memberid' )
->where( 'memberjurys.customer_id', $_SESSION['customer_id'], '=' )
->process( $_POST )
->json();

Answers

  • stpstp Posts: 6Questions: 2Answers: 0

    I found answer

    ->where( function ($db) {
    $db->where( 'customer_id', $_SESSION['customer_id'] );
    })

This discussion has been closed.