KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Dashboard:Using User::id in query #1788

Closed george quinones opened this topic on on Dec 23, 2020 - 2 comments

george quinones commented on Dec 23, 2020

I am working with dashboard

I am trying to use the User::Id in a query but . . . .

return AutoMaker::table("userCarriers_v")
                ->orderBy("name")
                ->where("userId","=",App::id())
                ->select("name as CarrierName,carrierWritingAgent");

        }
KoolReport commented on Dec 23, 2020

You can refer to user id like following:

return AutoMaker::table("userCarriers_v")
                ->orderBy("name")
                ->where("userId","=",$this->app()->user()->id())
                ->select("name")->alias("CarrierName")
                ->addSelect("carrierWritingAgent");

        }
george quinones commented on Dec 23, 2020

that makes sense now

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
None yet

None