Compare commits
No commits in common. "b67a61be9a664706486dc3c335ab9cd817ed32a5" and "d8da878b9fb9ce14cbb44b3add52af07843b635c" have entirely different histories.
b67a61be9a
...
d8da878b9f
|
@ -61,8 +61,6 @@ function response_pos($api, $data)
|
|||
global $deviceInfo, $post, $log_id, $db;
|
||||
$noncestr = md5(microtime() . '_' . rand());
|
||||
$time = time();
|
||||
// 签名计算
|
||||
$sign = md5($time.$noncestr.$deviceInfo['cardpwd']);
|
||||
$sign = md5($time . $noncestr . $deviceInfo['cardpwd']);
|
||||
$data['sign'] = $sign;
|
||||
|
||||
|
@ -189,11 +187,8 @@ if ($qs == 'heartbeat' || $qs == 'addperson' || $qs == 'delperson') { //心跳
|
|||
$faceInfo[$item['user_id']] = $item;
|
||||
}
|
||||
}
|
||||
// tb_face -> faceInfo -> userList_s
|
||||
// tb_pos_device -> userList_d
|
||||
|
||||
// 关联用户表和用户id卡表,获取信息
|
||||
// 获取对应租户下的所有用户卡信息
|
||||
$data = $db->get_all("select a.* from tb_user_idcard a, tb_user b where a.user_id=b.id and b.company_id = '{$company_id}' and a.state=1 order by a.id");
|
||||
$cardInfo = array();
|
||||
// 提取上一步获取的信息并将数据循环加入到卡信息数组中,类似List[Dict],key是user_id,value是item
|
||||
|
@ -264,7 +259,6 @@ if ($qs == 'heartbeat' || $qs == 'addperson' || $qs == 'delperson') { //心跳
|
|||
}
|
||||
// 设备表的用户信息
|
||||
$item2 = $dUserInfo[$uid];
|
||||
// 本质上其实是比较pos_device_user表中的数据和user user_face表联合查询的结果是否匹配
|
||||
// 如果设备用户表的记录和用户表的记录不一致
|
||||
if (
|
||||
($item2['facecode'] . '') !== ($item['facecode'] . '')
|
||||
|
@ -358,12 +352,6 @@ if ($qs == 'heartbeat' || $qs == 'addperson' || $qs == 'delperson') { //心跳
|
|||
|
||||
$delList = array(); //删除列表
|
||||
$maxcount = 100;
|
||||
// 遍历设备用户表的记录
|
||||
/*
|
||||
删除有两种情况:
|
||||
1. 距上次下发删除5分钟后还没收到确认
|
||||
2. 设备用户表中的用户记录不在用户表中
|
||||
*/
|
||||
foreach ($userList_d as $item) {
|
||||
$uid = $item['uid'];
|
||||
|
||||
|
@ -386,7 +374,7 @@ if ($qs == 'heartbeat' || $qs == 'addperson' || $qs == 'delperson') { //心跳
|
|||
continue;
|
||||
}
|
||||
|
||||
// 设备用户表中的用户记录不在用户表中,添加item到删除列表
|
||||
// 不在用户表中,添加item到删除列表
|
||||
if (!$sUserInfo[$uid]) {
|
||||
$delList[] = $item;
|
||||
if (count($delList) >= $maxcount)
|
||||
|
|
Loading…
Reference in New Issue