From d8da878b9fb9ce14cbb44b3add52af07843b635c Mon Sep 17 00:00:00 2001 From: ui_none <1035096867@qq.com> Date: Fri, 16 Aug 2024 16:27:22 +0800 Subject: [PATCH] docs: x Change-Id: Ia46f6e2f8fbcbca140ea3a5dcc905f444354b2d1 --- show/api_pos.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/show/api_pos.php b/show/api_pos.php index 49edad0..c5be463 100644 --- a/show/api_pos.php +++ b/show/api_pos.php @@ -75,12 +75,13 @@ function response_pos($api, $data) } // 向本机地址发送请求,拼接端口号、路径、post参数和header,调用自定义gquery函数 -function self_query($path, $post) +function self_query($path, $post) { return gquery("http://127.0.0.1:" . $_SERVER['SERVER_PORT'] . $path, $post, array('Host: ' . $_SERVER['SERVER_NAME'])); } // 从post参数中获取pay_mode等参数,实时消费接口中使用,包括infoquery takemeal takemealok posonline +// 检查用户是否存在并返回用户信息 function pos_check_user() { global $post, $db, $company_id; @@ -130,6 +131,7 @@ function pos_check_user() ); response_pos($post['api'], $arr); } + // 返回用户信息 return $uInfo; } @@ -175,6 +177,7 @@ if ($qs == 'heartbeat' || $qs == 'addperson' || $qs == 'delperson') { //心跳 // tb_user_face和tb_user表关联,获取对应信息 // user user_face + // 只取face_code face_path $data = $db->get_all("select a.* from tb_user_face a, tb_user b where a.user_id=b.id and b.company_id = '{$company_id}'"); $faceInfo = array(); // 提取上一步得到的关联信息并添加到faceInfo数组中,判断此文件是否存在于服务器后台目录,存在则将item信息存进dict数据中,key是user_id,value是item @@ -206,6 +209,7 @@ if ($qs == 'heartbeat' || $qs == 'addperson' || $qs == 'delperson') { //心跳 $userList_s[$key]['facepath'] = $info1['path'] . ''; $info1 = $cardInfo[$uid]; + // 从cardInfo中仅获取cardno $userList_s[$key]['cardno'] = $info1['cardno'] . ''; } @@ -515,6 +519,7 @@ else if ($qs == 'real') { response_pos($api, $arr); } + // 取餐接口,获取对应取餐码的取餐信息,需要字段 $s = self_query("/api/order/take", array('take_code' => $order['take_food_code'], 'dining_hall_id' => $dining_hall_id, 'channelid' => $channel_id)); $rs = json_decode($s, true); @@ -534,6 +539,7 @@ else if ($qs == 'real') { response_pos($api, $arr); } + // $takeInfo = $rs['data']['list'][0]; $detail = array();