update: minor update

This commit is contained in:
yangshuimiao
2025-01-10 07:48:24 +08:00
parent e33cb8e93a
commit 5d135b24f1
6 changed files with 23 additions and 32 deletions
+7 -5
View File
@@ -22,7 +22,7 @@ EOF;
"status" => "1",
'stocks'=> $data,
"company"=>$_REQUEST['t_vendor'],
));
),JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
}
/**
@@ -65,7 +65,7 @@ if($_REQUEST['t']=='financeData'){
//strip key from array $data
//dataTable must NOT have any key of json
$data=array_values($data);
echo json_encode(array("data"=>$data));
echo json_encode(array("data"=>$data),JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
}
/*
@@ -78,7 +78,7 @@ if($_REQUEST['t']=='esfTBD'){
"status" => "1",
'dataTrade'=> $dataTrade,
'dataList'=>$dataList
));
),JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
}
/*
@@ -90,7 +90,7 @@ if($_REQUEST['t']=='esfListDaily'){
echo json_encode(array(
"status" => "1",
'datas'=> $data
));
),JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
}
function esfTradeDaily(){
global $mysqli;
@@ -108,6 +108,7 @@ function esfTradeDaily(){
left join estate_json_ext eje1 on eje1.id=eje.id+3
left join estate_json_ext eje2 on eje2.id=eje.id+4
where ej.data_type='5' and (ej.tdate>='{$_REQUEST['t_start']}' and ej.tdate<='{$_REQUEST['t_end']}')
order by ej.tdate asc
EOF;
$result = $mysqli->query($sql);
@@ -131,6 +132,7 @@ function esfListDaily(){
left join estate_json_ext eje1 on eje1.id=eje.id+3
left join estate_json_ext eje2 on eje2.id=eje.id+5
where ej.data_type='8' and (ej.tdate>='{$_REQUEST['t_start']}' and ej.tdate<='{$_REQUEST['t_end']}')
order by ej.tdate asc
EOF;
$result = $mysqli->query($sql);
@@ -181,5 +183,5 @@ EOF;
"status" => "1",
'datas'=> $data,
'dataExt'=> $data2
));
),JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
}
+3 -2
View File
@@ -17,7 +17,7 @@ if($day_end) {
$where .= " and trade_date <'".$day_end."'";
}
$sql= <<<EOF
select trade_date, $item as pe_ttm from stock_his_basic_pro where ts_code = '$ts_code' $where order by trade_date asc
select DATE_FORMAT(trade_date,'%Y-%m-%d') as trade_date, $item as pe_ttm from stock_his_basic_pro where ts_code = '$ts_code' $where order by trade_date asc
EOF;
#echo $sql;
$result = $mysqli->query($sql);
@@ -27,7 +27,8 @@ $tDate=$idx=$data=$data_clean=array(); # $data_clean is an array without null
if($result && $result->num_rows>0) {
#$data = $result->fetch_all();
while($row=$result->fetch_assoc()){
$trade_date=substr($row['trade_date'],0,4).'-'.substr($row['trade_date'],4,2).'-'.substr($row['trade_date'],6,2);
$trade_date=$row['trade_date'];
#$trade_date=substr($row['trade_date'],0,4).'-'.substr($row['trade_date'],4,2).'-'.substr($row['trade_date'],6,2);
#$trade_date1=strtotime($row['trade_date']);
array_push($tDate,$trade_date);
array_push($idx,$row['pe_ttm']);