1,"info"=>"用户未登录")); exit; } $pdo=conn(); switch ($method){ case 'getRunInfo': $RUN_ID=isset($_GET['run_id'])?$_GET['run_id']:''; $sql1="CALL SP_GET_RUN_INFO('".$USER_ID."','".$RUN_ID."')"; $sql2="CALL SP_GET_STATION_LIST('".$USER_ID."','".$RUN_ID."')"; $sql4="CALL SP_GET_BUS_INFO('".$USER_ID."','".$RUN_ID."')"; $sql5="CALL SP_GET_TICKET_TYPE('".$USER_ID."','".$RUN_ID."')"; if(is_object($pdo)){ $result1=$pdo->query($sql1); $json1=$result1->fetchAll(PDO::FETCH_ASSOC); $result1->closeCursor(); $result2=$pdo->query($sql2); $json2=$result2->fetchAll(PDO::FETCH_ASSOC); $result2->closeCursor(); $result4=$pdo->query($sql4); $json4=$result4->fetchAll(PDO::FETCH_ASSOC); $result4->closeCursor(); $result5=$pdo->query($sql5); $json5=$result5->fetchAll(PDO::FETCH_ASSOC); $result5->closeCursor(); } $data['code']='0'; $data['info']=''; if(count($json1)>0){ $data['property']=$json1[0]['property']; $data['prod_name']=$json1[0]['prod_name']; $data['run_date']=$json1[0]['run_date']; $data['run_time']=$json1[0]['run_time']; $data['run_status']=$json1[0]['run_status']; $data['receiving']=$json1[0]['receiving']; $data['pre_sale_day']=$json1[0]['pre_sale_day']; // $data['bus_type']=$json2[0]['bus_type']; $data['station_list']=$json2; } if(count($json4)>0){ $data['bus_info']=$json4; } if(count($json5)>0){ $data['ticket_type']=$json5; } $sql7="CALL SP_GET_RUN_TICKET_INFO('".$USER_ID."','".$RUN_ID."')"; if(is_object($pdo)){ $stmt=$pdo->query($sql7); $i = 1; do{ $rowset = $stmt->fetchAll(PDO::FETCH_ASSOC); if($i==1){ $data['order_ticket_info_list']=$rowset; }else if ($i==2){ $data['not_in_order_ticket_info_list']=$rowset; }else{ } $i++; }while ($stmt->nextRowset()); } $stmt->closeCursor(); break; case 'getRunList': $PAGE=isset($_GET['currpage'])?$_GET['currpage']:1; $PAGE_SIZE=isset($_GET['page_size'])?$_GET['page_size']:20; $START_AREA=isset($_GET['start_area'])?$_GET['start_area']:''; $END_AREA=isset($_GET['end_area'])?$_GET['end_area']:''; $LINE=isset($_GET['line'])?$_GET['line']:''; $START_DATE=isset($_GET['start_date'])?$_GET['start_date']:''; $END_DATE=isset($_GET['end_date'])?$_GET['end_date']:''; $RUN_STATUS=isset($_GET['run_status'])?$_GET['run_status']:''; $BUS_TYPE=isset($_GET['bus_type'])?$_GET['bus_type']:'0'; $BUS_GROUP=isset($_GET['bus_group'])?$_GET['bus_group']:'0'; $PROD_START_LIST = ""; if( $BUS_GROUP != "0" ) { $sql = " SELECT id,group_name,prod_list,start_time_list FROM line_group_common WHERE id={$BUS_GROUP} "; $pdo1 = conn(); $stmt1=$pdo1->query($sql); if( $stmt1 ) { $rowset = $stmt1->fetchAll(PDO::FETCH_ASSOC); if( $rowset ) { $bus_group_info = $rowset[0]; $prod_array = explode("_", $bus_group_info["prod_list"]); $start_array = explode("_", $bus_group_info["start_time_list"]); $prod_start_array = array(); foreach( $prod_array as $key => $prod_id) { $PROD_START_LIST .= $prod_id.",".$start_array[$key]."|"; } } $stmt1->closeCursor(); } } // $sql6="CALL SP_GET_RUN_LIST(".$USER_ID.",".$PAGE.",".$PAGE_SIZE.",'".$START_AREA."' // ,'".$END_AREA."','".$LINE."','".$START_DATE."','".$END_DATE.",".$RUN_STATUS.")"; $sql6="CALL SP_GET_RUN_LIST(".$USER_ID.",".$PAGE.",".$PAGE_SIZE.",'".$START_AREA."' ,'".$END_AREA."','".$LINE."','".$START_DATE."','".$END_DATE."',".$RUN_STATUS.",".$BUS_TYPE.",'".$PROD_START_LIST."')"; if(is_object($pdo)){ $stmt=$pdo->query($sql6); if($stmt){ $data['code']='0'; $data['info']=''; $data['run_list']= array(); $i = 1; do{ $rowset = $stmt->fetchAll(PDO::FETCH_ASSOC); if($i==1){ $data['currpage']=$rowset[0]['currpage']; $data['total_page']=$rowset[0]['total_page']; $data['total']=$rowset[0]['total']; $data['page_size']=$rowset[0]['page_size']; }else if ($i==2){ $data['run_list']=$rowset; }else{ } $i++; }while ($stmt->nextRowset()); }else{ $data['code']='1'; $data['info']=$sql6; } if($stmt){ $stmt->closeCursor(); } } $sql = " SELECT id as group_id,group_name from line_group_common WHERE cancel_flag = 0 "; if(is_object($pdo)){ $stmt=$pdo->query($sql); $line_group=$stmt->fetchAll(PDO::FETCH_ASSOC); $stmt->closeCursor(); if(count($line_group)>0){ $data['bus_group_list']=$line_group; }else{ $data['bus_group_list']=array(); } } break; default: break; } if(is_array($data)){ echo json_encode($data); } //$sql1 = "CALL SP_REFRESH_RUN_BUS_STATUS()"; //$result = $pdo->query($sql1); exit;