//前端调用7天的日期和时间
public function getf7()
{
$data = [];
$format = 'm-d';
for ($i = 0; $i < 7; $i++) {
$strtotime = strtotime('+' . ($i) . ' days');
$data[$i]['date'] = date($format, $strtotime);
$data[$i]['week'] = "周" . mb_substr("日一二三四五六", date("w", $strtotime), 1, "utf-8");
}
return $this->json_data(array('data' => $data, 'st' => 1));
}
网友评论