query($opera_org_id_sql); $rowset = $opera_org_id_result->fetchAll(PDO::FETCH_ASSOC); $opera_org_id = $rowset[0]['opera_org_id']; $main_corp_id = $rowset[0]['main_corp_id']; $and_sql = ''; if ($opera_org_id != '') { $and_sql .= " and org_id in (" . $opera_org_id . ") "; } if ($main_corp_id != 0) { $and_sql .= " and main_corp_id in (" . $main_corp_id . ") "; } if ($search != '') { $and_sql .= " and (line_name like CONCAT('%','" . $search . "','%') or line_code like CONCAT('%','" . $search . "','%')) "; } $sql = "select concat(line_code,line_name) as name,line_id as lineid from opera_line where cancel_flag = 0 and if_disabled = 0 " . $and_sql; writeLog(" AddCarTime " . __LINE__ . ":" . $sql); //$sql="CALL XM_PRO_GET_LINE_LIST({$USER_ID},'".strtoupper($search)."')"; if (is_object($pdo)) { $result = $pdo->query($sql); if ($result == false) { break; } $json = $result->fetchAll(PDO::FETCH_ASSOC); $result->closeCursor(); } break; case 'throughstation': if (is_object($pdo)) { $lineid = isset($_GET['lineid']) ? $_GET['lineid'] : ''; $sql = "CALL XM_PRO_GET_LINE_STATION(1," . $lineid . ")"; writeLog('addCarTime.php throughstation sql:' . $sql); $result = $pdo->query($sql); $json1 = $result->fetchAll(PDO::FETCH_ASSOC); $result->closeCursor(); $sql1 = "CALL XM_PRO_GET_LINE_TICKETS_TYPE(1," . $lineid . ")"; $result1 = $pdo->query($sql1); $json2 = $result1->fetchAll(PDO::FETCH_ASSOC); $result1->closeCursor(); $sql2 = "CALL XM_PRO_GET_LINE_CAR_TYPE(1,1)"; $result2 = $pdo->query($sql2); $json3 = $result2->fetchAll(PDO::FETCH_ASSOC); $result2->closeCursor(); //print_r($json3); foreach ($json1 as $k => $v) { if ($v['TICKET_GATE']) { $str = explode(',', $v['TICKET_GATE']); $json1[$k]['TICKET_GATE'] = ''; foreach ($str as $val) { $str1 = explode("^-^", $val); $json1[$k]['TICKET_GATE'][$str1[0]] = $str1[1]; } } } //$cost_type = array(array('type_id' => 518, 'type_name' => '按车辆结算'), array('type_id' => 519, 'type_name' => '按车座结算')); $cost_type = array(array('type_id' => 477, 'type_name' => '包车计价'), array('type_id' => 478, 'type_name' => '车座计价')); $sql3 = "select s.id as supplier_id,s.supplier_name as bus_team from base_supplier as s,base_supplier_purchase as p where s.id = p.supplier_id and s.cancel_flag = 0 and s.supplier_type = 187 and p.cancel_flag = 0 and p.product_type = 259 group by s.id"; $result3 = $pdo->query($sql3); $json4 = $result3->fetchAll(PDO::FETCH_ASSOC); $sql5 = "select supplier_id,bus_res_id, base_cost from base_bus_cost where id > 0 "; $result5 = $pdo->query($sql5); $json5 = $result5->fetchAll(PDO::FETCH_ASSOC); $base_cost = array(); foreach( $json5 as $base_cost_info ) { $supplier_id = $base_cost_info["supplier_id"]; $bus_res_id = $base_cost_info["bus_res_id"]; if( !isset($base_cost[$supplier_id]) ) { $base_cost[$supplier_id] = array(); } $base_cost[$supplier_id][$bus_res_id] = $base_cost_info["base_cost"]; } $json['station'] = $json1; $json['addcartype'] = $json3; $json['ticket'] = $json2; $json['cost_type'] = $cost_type; $json['supplier_list'] = $json4; $json['base_cost'] = $base_cost; } break; case 'addcartype': if (is_object($pdo)) { $sql = 'CALL XM_PRO_GET_LINE_CAR_TYPE(1,1)'; $result = $pdo->query($sql); $json = $result->fetchAll(PDO::FETCH_ASSOC); //print_r($json); } break; } if (is_array($json)) { echo json_encode($json); } exit; //require_once '../Common/Config.php';