The core code is as follows:
Copy codeThe Code is as follows:
<? Php
$ Now = time ();
$ Oc = array (
'Team _ type' => 'normal ',
"Begin_time <'{$ now }'",
"End_time> '{$ now }'",
);
$ P = "p2 ";
$ Pp1 = "";
$ Pp2 = "";
$ Now = time ();
Switch ($ p)
{
Case "p1 ":
$ Pp1 = "team_price <10 ";
$ Pp2 = "";
Break;
Case "p2 ":
$ Pp1 = "team_price> 10 ";
$ Pp2 = "team_price <50 ";
Break;
Case "p3 ":
$ Pp1 = "team_price> 50 ";
$ Pp2 = "team_price <100 ";
Break;
Case "p4 ":
$ Pp1 = "team_price> 100 ";
$ Pp2 = "team_price <200 ";
Break;
Case "p5 ":
$ Pp1 = "team_price> 200 ";
$ Pp2 = "";
Break;
Default:
$ Pp1 = "";
$ Pp2 = "";
}
If (! Empty ($ pp1 )){
Array_push ($ oc, $ pp1 );
}
If (! Empty ($ pp2 )){
Array_push ($ oc, $ pp2 );
}
Print_r ($ oc );
?>
Because it is a multi-condition query, you must first determine whether it is null and then add it to the array.