Compare commits

..

2 Commits

Author SHA1 Message Date
aa2e02beac fixing idxdept 2025-08-28 13:09:05 +07:00
a74010325f Remove unnecessary condition from attendance log query 2025-07-07 13:46:17 +07:00
3 changed files with 18 additions and 6 deletions

View File

@ -82,8 +82,8 @@ class LogController
public function index()
{
$ip = "192.168.100.76"; //$row['deviceip'];
$qry="select * from tbl_deviceinfo where _idx=36 and isdeleted=0 order by _idx asc";
$ip = "172.16.116.5"; //$row['deviceip'];
$qry="select * from tbl_deviceinfo where isreprocess=1 and isdeleted=0 order by _idx asc";
#echo $qry;
$rs=$this->selectquerySP($qry);
if($rs){
@ -107,7 +107,7 @@ class LogController
$data = [];
foreach ($getData as $att) {
// echo date("Y-m-d", strtotime($att['timestamp']));
if (date("Y-m-d", strtotime($att['timestamp'])) == date("Y-m-d")) {
if (date("Y-m-d", strtotime($att['timestamp'])) == date("Y-m-d",strtotime($rw['reprocessdate']))) {
// $data[] = [
// "idUser" => $att['id'],
// "name" => isset($users[$att['id']]) ? $users[$att['id']]['name'] : $att['id'],
@ -117,12 +117,12 @@ class LogController
// "deviceIP" => $ip
// ];
// echo json_encode($att)."\n";
$res=$this->fn_setattendance($att, $ip);
// $res=$this->fn_setattendance($att, $ip);
$reslog=$this->fn_setattendancelogs($att, $ip);
$data[] = [
"fingerid" => $att['id'],
"time" => date("Y-m-d H:i:s", strtotime($att['timestamp'])),
"status" => $res
"status" => $reslog
];
}
}

View File

@ -719,10 +719,22 @@ class LogController
$rtn=true;
return $rtn;
}
public function fn_idxdept(){
$qry="update tbl_attendanceemployee a, tbl_employee e set a.idxdept = e.idxdept
where e._idx=a.idxemployee and a.idxdept=0";
$this->executeSP($qry);
$qry="update tbl_attendancelist a, tbl_employee e set a.idxdept = e.idxdept
where e._idx=a.idxemployee and a.idxdept=0";
$this->executeSP($qry);
return true;
}
}
$cl = new LogController();
$rtn =$cl->index();
$rtn =$cl->fn_idxdept();
#if(isset($_REQUEST['isgetdata'])){
# echo "indx";

View File

@ -78,7 +78,7 @@ class LogController
$argv=$_SERVER['argv'];
// echo $argv[1];return false;
$qry="select * from tbl_attendancelogs
where cast(dates as date)=cast('".$argv[1]."' as date) and isprocess=0
where cast(dates as date)=cast('".$argv[1]."' as date)
order by _idx asc";
$rs=$this->selectquerySP($qry);
if($rs){