I would like to retrieve data matching the search string, provided, it must not belongs to current user.
if($str_search && $str_search != '' )
{
$mandate_list = Mandate::select(array('umrn','mandate_status', 'payment_type','currency','fixed_amount','max_amount','user_id','id','debtor_bank','creditor_bank','refusal_reason'))
->orWhere('id', 'LIKE', '%'.$str_search.'%')
->orWhere('umrn','LIKE','%'.$str_search.'%')
->orWhere('mandate_status','LIKE','%'.$str_search.'%')
->orWhere('mandate_date','LIKE','%'.$str_search.'%')
->orWhere('payment_type','LIKE','%'.$str_search.'%')
->orWhere('currency','LIKE','%'.$str_search.'%')
->orWhere('fixed_amount','LIKE','%'.$str_search.'%')
->orWhere('mandate_date','LIKE','%'.$str_search.'%')
->where('user_id', '<>', $current_user)
->orderBy('updated_at', 'desc')
->get();
}
But this query displays all records (even belongs to current user). How can i solve this. Thanks for your suggestions.