|
@@ -158,16 +158,17 @@ class Room extends \yii\db\ActiveRecord |
|
@@ -158,16 +158,17 @@ class Room extends \yii\db\ActiveRecord |
158
|
if (empty($data['app'])){
|
158
|
if (empty($data['app'])){
|
159
|
throw new \Exception('未选择业务线');
|
159
|
throw new \Exception('未选择业务线');
|
160
|
}
|
160
|
}
|
|
|
161
|
+ if (!empty($data['starting_time'])){
|
|
|
162
|
+ $data['starting_time'] = (int)strtotime($data['starting_time']);
|
|
|
163
|
+ if ($data['starting_time'] <= time()){
|
|
|
164
|
+ throw new \Exception('预告开始时间不能早于当前时间');
|
|
|
165
|
+ }
|
|
|
166
|
+ }
|
161
|
|
167
|
|
162
|
$data['room_id'] = $this->bornRoomId();
|
168
|
$data['room_id'] = $this->bornRoomId();
|
163
|
sort($data['app']);
|
169
|
sort($data['app']);
|
164
|
$data['app'] = implode(',', $data['app']);
|
170
|
$data['app'] = implode(',', $data['app']);
|
165
|
|
171
|
|
166
|
- $data['starting_time'] = $data['starting_time'] ? strtotime($data['starting_time']) : 0;
|
|
|
167
|
- if ( ($data['starting_time']>0) && ($data['starting_time'] <= time())){
|
|
|
168
|
- $data['starting_time'] = 0;
|
|
|
169
|
- }
|
|
|
170
|
-
|
|
|
171
|
if ($data['best'] > 0){
|
172
|
if ($data['best'] > 0){
|
172
|
$count = $this->find()->where(['!=','best','0'])->count();
|
173
|
$count = $this->find()->where(['!=','best','0'])->count();
|
173
|
if ($count >= 2){
|
174
|
if ($count >= 2){
|
|
@@ -218,15 +219,16 @@ class Room extends \yii\db\ActiveRecord |
|
@@ -218,15 +219,16 @@ class Room extends \yii\db\ActiveRecord |
218
|
if (empty($data['app'])){
|
219
|
if (empty($data['app'])){
|
219
|
throw new \Exception('未选择业务线');
|
220
|
throw new \Exception('未选择业务线');
|
220
|
}
|
221
|
}
|
|
|
222
|
+ if (!empty($data['starting_time'])){
|
|
|
223
|
+ $data['starting_time'] = (int)strtotime($data['starting_time']);
|
|
|
224
|
+ if ($data['starting_time'] <= time()){
|
|
|
225
|
+ throw new \Exception('预告开始时间不能早于当前时间');
|
|
|
226
|
+ }
|
|
|
227
|
+ }
|
221
|
|
228
|
|
222
|
@sort($data['app']);
|
229
|
@sort($data['app']);
|
223
|
$data['app'] = implode(',', $data['app']);
|
230
|
$data['app'] = implode(',', $data['app']);
|
224
|
|
231
|
|
225
|
- $data['starting_time'] = $data['starting_time'] ? strtotime($data['starting_time']) : 0;
|
|
|
226
|
- if ( ($data['starting_time']>0) && ($data['starting_time'] <= time())){
|
|
|
227
|
- $data['starting_time'] = 0;
|
|
|
228
|
- }
|
|
|
229
|
-
|
|
|
230
|
if ($data['best'] > 0){
|
232
|
if ($data['best'] > 0){
|
231
|
$count = $this->find()->where(['and',['!=','best','0'],['!=','id',$this->id]])->count();
|
233
|
$count = $this->find()->where(['and',['!=','best','0'],['!=','id',$this->id]])->count();
|
232
|
if ($count >= 2){
|
234
|
if ($count >= 2){
|