no message

This commit is contained in:
hellcat committed 2025-05-02 14:09:19 +08:00
1 parent 7f6d8f955f
commit 4fe8ea08b8
2 files changed
+35

No files matched your search

@@ -29,4 +29,37 @@ final class HuodongController
}
public function dateHit(ServerRequest $request, Response $response, array $args)
{
$sDate = $args["date"] ?? date("Y-m-d");
// test
// $sDate = "2025-01-01";
$oHuodong = Huodong::where("start_date", "<=", $sDate)->where("end_date", ">=", $sDate)->first();
if ($oHuodong) {
$oHuodong->start_date_str = date("n月j日", strtotime($oHuodong->start_date));
$oHuodong->end_date_str = date("n月j日", strtotime($oHuodong->end_date));
$oHuodong->str = $oHuodong->title.":".$oHuodong->start_date_str."至".$oHuodong->end_date_str."期间,".$oHuodong->content;
$aReturn = [
"status" => 1,
"data" => $oHuodong
];
} else {
$aReturn = [
"status" => 0
];
}
echo json_encode($aReturn);
exit;
}
}