...
|
...
|
@@ -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){
|
...
|
...
|
|