You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
580 B

<?php
namespace app\mall\model;
use think\model\concern\SoftDelete;
class MallSpikeTime extends Base
{
use SoftDelete;
/**
* 获取器
*/
public function getEndTimeAttr($value)
{
if($value == '00:00'){
return '24:00';
}
return $value;
}
public function getTimes()
{
$start_time = strtotime(date('Y-m-d'));
$timesList = [];
for($i = 0;$i <= 48;$i++){
$timesList[] = ['key'=>$i,'time'=>date('H:i',$start_time+($i*1800))];
}
return $timesList;
}
}