KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.

Dynamic QueryBuilder #1078

Open Mike Carroll opened this topic on 5 days ago - 1 comments

Mike Carroll commented 5 days ago

Are there any examples on how to use query builder but in a dynamic fashion. From the examples, they appear to all be static. Hope my question makes sense.

KoolReport commented 5 days ago

Let say you have report parameter like $this->params["start_date"] and $this->params["end_date"] you can do:

DB::table("orders")->whereBetween(
    "order_date",
    [$this->params["start_date"],$this->params["end_date"]]
);

Give tips to supporter for his good work

If you feel that supporter has done a good work, consider giving him some credit. Any amount put into the tips box below is appreciated. By doing so, you have contribtuted to the existence of KoolReport and the quality of support.

Tips box
None yet

QueryBuilder