0) { $row = mysqli_fetch_assoc($result); $data = [ 'oderid' => $row['oderid'], 'phones' => $row['phone'], 'uid' => $row['uid'], 'status' => $row['status'], 'name' => $row['name'], 'time' => date('Y-m-d H:i:s', $row['time']), 'tgaccount' => $proxy_acc, 'goods' => $row['goods'], 'thirdphone' => $row['thirdphone'], 'iccid' => $row['iccid'], 'notes'=> $row['beizhu'] ]; echo json_encode($data); } else { // 手机号没有对应的订单 $msg = '没有找到对应的订单'; $response = [ 'status' => 'error', 'msg' => $msg ]; echo json_encode($response); } } // 判断是否为身份证号 else if (preg_match('/^\d{17}[\d|x]|\d{15}$/', $searchValue)) { // 查询订单表中身份证号为$searchValue的订单信息 $sql = "SELECT * FROM oder WHERE uid = '$searchValue'"; $result = mysqli_query($con, $sql); if (mysqli_num_rows($result) > 0) { $row = mysqli_fetch_assoc($result); // $xdtime = $row['time']; $data = [ 'oderid' => $row['oderid'], 'phones' => $row['phone'], 'uid' => $row['uid'], 'status' => $row['status'], 'name' => $row['name'], 'time' => date('Y-m-d H:i:s', $row['time']), 'tgaccount' => $proxy_acc, 'goods' => $row['goods'], 'thirdphone' => $row['thirdphone'], 'iccid' => $row['iccid'], 'notes'=> $row['beizhu'] ]; echo json_encode($data); } else { // 身份证号没有对应的订单 $msg = '没有找到对应的订单'; $response = [ 'status' => 'error', 'msg' => $msg ]; echo json_encode($response); } } // 判断是否为订单号 else if (strpos($searchValue, 'KJKJ') === 0) { // 查询订单表中订单号为$searchValue的订单信息 $sql = "SELECT * FROM oder WHERE oderid = '$searchValue'"; $result = mysqli_query($con, $sql); if (mysqli_num_rows($result) > 0) { $row = mysqli_fetch_assoc($result); $data = [ 'oderid' => $row['oderid'], 'phones' => $row['phone'], 'uid' => $row['uid'], 'status' => $row['status'], 'name' => $row['name'], 'time' => date('Y-m-d H:i:s', $row['time']), 'tgaccount' => $proxy_acc, 'goods' => $row['goods'], 'thirdphone' => $row['thirdphone'], 'iccid' => $row['iccid'], 'notes'=> $row['beizhu'] ]; echo json_encode($data); } else { // 订单号没有对应的订单 $msg = '没有找到对应的订单'; $response = [ 'status' => 'error', 'msg' => $msg ]; echo json_encode($response); } } // 输入的信息有误 else { $msg = '您输入的信息有误'; $response = [ 'status' => 'error', 'msg' => $msg ]; echo json_encode($response); }