🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
---- - 多条件筛选 ```` /* * 团课-筛选结果 * search_result */ public function search_result(Request $request) { //获取参数 $param = $request->param(); $join_years = isset($param['join_years']) ? $param['join_years'] : ''; $join_status = isset($param['join_status']) ? $param['join_status'] : ''; $trainersex = isset($param['trainersex']) ? $param['trainersex'] : ''; $service_time = isset($param['service_time']) ? $param['service_time'] : ''; $tags_id = isset($param['tags_id']) ? $param['tags_id'] : ''; //筛选条件 $condition = ' 1=1 '; if($join_status) $condition .= " AND join_years = $join_years "; //证书 if($join_status) $condition .= " AND join_status = $join_status "; //证书 if($trainersex) $condition .= " AND trainersex = $trainersex "; //性别 if($service_time) $condition .= " AND service_time = $service_time "; //服务时间 if($tags_id) $condition .= " AND tags_id = $tags_id "; //类型 $all = Groupclass::with('course') ->where('is_star',1) ->select(); $this->success($all); } ----