Authored by wuxiao

配置时区

修改房间预告时间的编辑
... ... @@ -158,16 +158,17 @@ class Room extends \yii\db\ActiveRecord
if (empty($data['app'])){
throw new \Exception('未选择业务线');
}
if (!empty($data['starting_time'])){
$data['starting_time'] = (int)strtotime($data['starting_time']);
if ($data['starting_time'] <= time()){
throw new \Exception('预告开始时间不能早于当前时间');
}
}
$data['room_id'] = $this->bornRoomId();
sort($data['app']);
$data['app'] = implode(',', $data['app']);
$data['starting_time'] = $data['starting_time'] ? strtotime($data['starting_time']) : 0;
if ( ($data['starting_time']>0) && ($data['starting_time'] <= time())){
$data['starting_time'] = 0;
}
if ($data['best'] > 0){
$count = $this->find()->where(['!=','best','0'])->count();
if ($count >= 2){
... ... @@ -218,15 +219,16 @@ class Room extends \yii\db\ActiveRecord
if (empty($data['app'])){
throw new \Exception('未选择业务线');
}
if (!empty($data['starting_time'])){
$data['starting_time'] = (int)strtotime($data['starting_time']);
if ($data['starting_time'] <= time()){
throw new \Exception('预告开始时间不能早于当前时间');
}
}
@sort($data['app']);
$data['app'] = implode(',', $data['app']);
$data['starting_time'] = $data['starting_time'] ? strtotime($data['starting_time']) : 0;
if ( ($data['starting_time']>0) && ($data['starting_time'] <= time())){
$data['starting_time'] = 0;
}
if ($data['best'] > 0){
$count = $this->find()->where(['and',['!=','best','0'],['!=','id',$this->id]])->count();
if ($count >= 2){
... ...
... ... @@ -62,7 +62,7 @@ $this->registerJs($this->blocks['javascript'],View::POS_END)
<div class="form-group">
<label class="col-sm-3 control-label">预告开始时间: </label>
<div class="col-sm-5">
<input type="text" name="starting_time" class="form-control" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'%y-%M-%d %H:%m:%s'})" value="<?=$model->starting_time ? date('Y-m-d H:i:s',$model->starting_time) : ''?>">
<input type="text" name="starting_time" class="form-control" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" value="<?=$model->starting_time ? date('Y-m-d H:i:s',$model->starting_time) : ''?>">
</div>
</div>
... ...
... ... @@ -44,5 +44,12 @@ return [
],
],
],
/**
* 默认路由
*/
'defaultRoute'=>'index/index',
/*
* 时区
*/
'timeZone' => 'Asia/Shanghai',
];
... ...