查询:
Need::Where('student_id', '!=', $id)->Where($matchto)->orWhere($matchfrom)->orWhere($matchstandard)->orWhere($matchlives_in)->orWhere($matchhobbies)->orWhere($matchskills)->orWhere($matchspecialization_1)->orWhere($matchdesignation_1)->get();
它像这样生成结果查询
"query" => "select * from `needs` where `student_id` != ? and (`to` = ?) or (`from` = ?) or (`standard` = ?) or (`lives_in` = ?) or (`hobbies` = ?) or (`skills` = ?) or (`specialization_1` = ?) or (`designation_1` = ?)"
我想要的是
"query" => "select * from `needs` where `student_id` != ? and **(**(`to` = ?) or (`from` = ?) or (`standard` = ?) or (`lives_in` = ?) or (`hobbies` = ?) or (`skills` = ?) or (`specialization_1` = ?) or (`designation_1` = ?)**)**"
student_id`之后的额外括号!=?和。我怎样才能做到这一点?
答案 0 :(得分:2)
你需要筑巢你的条件:
MSR->Temp->Export_1->ZipExport_1->ZipExport1