1,"errinfo"=>"用户未登录")); exit; } $pdo=conn(); $sql="CALL HT_GET_CALENDAR_INFO_BY_DATE('".$dateTime."',{$productID})"; $result=$pdo->query($sql); $rowset=$result->fetchAll(PDO::FETCH_ASSOC); $data = array(); //if(strlen(trim($USER_ID))<=0){ // $data['code']='1'; // $data['info']='未登录'; //}else{ $data['code']='0'; $data['info']=''; $row_temp = array(); if( count($rowset) > 0) { foreach( $rowset as $row_info ) { $row_temp[$row_info["dateTime"]] = $row_info; } } $empty_common_array = array("buyPrice" => "", "retailPrice" => "", "distributionPrice" => "","switchStyle" => "","buyStyle" => "", "totalCount" => "","saleCount" => "","buy_type_id" => "","can_sale" => "144"); $max_days = date("t", strtotime($_GET['dateTime']."-01")); for( $day_temp = 1; $day_temp <= $max_days; $day_temp++) { $index_day = $_GET['dateTime'].sprintf("-%02d", $day_temp ); if( isset($row_temp[$index_day]) ) { $data['calender_Info'][] = $row_temp[$index_day]; } else { $empty_array = $empty_common_array; $empty_array["dateTime"] = $index_day; $data['calender_Info'][] = $empty_array; } } // $data['calender_Info']=$rowset; //} echo json_encode($data); exit();