diff --git a/show/api_pos.php b/show/api_pos.php index 03dce6d..baa09e4 100644 --- a/show/api_pos.php +++ b/show/api_pos.php @@ -77,12 +77,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; @@ -132,6 +133,7 @@ function pos_check_user() ); response_pos($post['api'], $arr); } + // 返回用户信息 return $uInfo; } @@ -177,6 +179,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 @@ -211,6 +214,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'] . ''; } @@ -527,6 +531,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); @@ -546,6 +551,7 @@ else if ($qs == 'real') { response_pos($api, $arr); } + // $takeInfo = $rs['data']['list'][0]; $detail = array();