...
|
...
|
@@ -39,7 +39,7 @@ class Room extends \yii\db\ActiveRecord |
|
|
public function rules()
|
|
|
{
|
|
|
return [
|
|
|
[['room_id', 'master_id', 'starting_time', 'best', 'vest', 'living', 'status', 'create_time', 'update_time'], 'integer'],
|
|
|
[['room_id', 'master_id', 'starting_time', 'best', 'vest', 'is_addup', 'living', 'status', 'create_time', 'update_time'], 'integer'],
|
|
|
[['title', 'watermark'], 'string', 'max' => 100],
|
|
|
[['app', 'secret'], 'string', 'max' => 50],
|
|
|
[['pic', 'background_pic'], 'string', 'max' => 255],
|
...
|
...
|
@@ -234,7 +234,11 @@ class Room extends \yii\db\ActiveRecord |
|
|
throw new \Exception('精选房间上限是2个');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (isset($data['is_addup'])){
|
|
|
$data['is_addup'] = Yii::$app->params['config']['is_addup'];
|
|
|
}else{
|
|
|
$data['is_addup'] = 0;
|
|
|
}
|
|
|
$this->setAttributes($data);
|
|
|
if (!$this->save()){
|
|
|
throw new \Exception(current($this->getFirstErrors()));
|
...
|
...
|
|