raihanafroz / zkteco

ZKTeco Laravel Library
151 stars 57 forks source link

Filter of attendence and user datas #10

Open Anish-Nectar opened 2 years ago

Anish-Nectar commented 2 years ago

I cant add filter like (pagination , today attendances) in getAttendance and getUser function. It takes lot of time to get fetch thousands of data from server

mohamedbakr57 commented 2 years ago

It doesn’t take arguments fetch all data then handle it by yourself

stagebkm commented 2 years ago

Good morning Sir,I'm trying to make a project with my ZKTeco device and Laravel,But I have a problem, I don't know how to synchronize automatically the device to my database,  so I would like to ask you to help me please 🙏,Obtenir Outlook pour Android

mohamedbakr57 commented 2 years ago

Download the zkteco lib package and use it’s built in function setUser

stagebkm commented 2 years ago

I'm using this package, my application is connected with the device,But I want to connect the device to my database, with use the application,Obtenir Outlook pour Android

stagebkm commented 2 years ago

I'm using the application to get data from the device and insert in my database Obtenir Outlook pour Android

mohamedbakr57 commented 2 years ago

Use getUser() it gives u array of people inserted in the device

Almandeel commented 1 year ago

You can use this : $zk = new ZKTeco('ip'); $zk->connect(); $zk->enableDevice(); $zk->getUser(); $tody = collect($zk->getAttendance())->whereBetween('timestamp', [Carbon::parse(now())->startOfDay(), Carbon::parse(now())->endOfDay()]);

and also for best performance cache this $zk->getAttendance()

NazarAli commented 1 month ago

@Almandeel your code very slow load all data in app then filtered it. what you do if have more than 50000 records ?