Authored by wuxiao

模型修改

@@ -38,11 +38,11 @@ class Room extends \yii\db\ActiveRecord @@ -38,11 +38,11 @@ class Room extends \yii\db\ActiveRecord
38 public function rules() 38 public function rules()
39 { 39 {
40 return [ 40 return [
41 - [['room_id', 'master_id', 'app', 'starting_time', 'living', 'status', 'create_time', 'update_time'], 'integer'],  
42 - [['best', 'vest'], 'string'], 41 + [['room_id', 'master_id', 'starting_time', 'best', 'vest', 'living', 'status', 'create_time', 'update_time'], 'integer'],
43 [['title', 'watermark'], 'string', 'max' => 100], 42 [['title', 'watermark'], 'string', 'max' => 100],
44 - [['secret'], 'string', 'max' => 50],  
45 - [['pic'], 'string', 'max' => 255], 43 + [['app', 'secret'], 'string', 'max' => 50],
  44 + [['pic', 'background_pic'], 'string', 'max' => 255],
  45 + [['room_id'], 'unique'],
46 ]; 46 ];
47 } 47 }
48 48
@@ -34,8 +34,6 @@ class RoomQchannel extends \yii\db\ActiveRecord @@ -34,8 +34,6 @@ class RoomQchannel extends \yii\db\ActiveRecord
34 [['room_id', 'create_time', 'update_time'], 'integer'], 34 [['room_id', 'create_time', 'update_time'], 'integer'],
35 [['downstream_address'], 'string'], 35 [['downstream_address'], 'string'],
36 [['channel_id', 'upstream_address'], 'string', 'max' => 255], 36 [['channel_id', 'upstream_address'], 'string', 'max' => 255],
37 - [['create_time', 'update_time'], 'default', 'value' => time()],  
38 - [['create_time', 'update_time'], 'required'],  
39 ]; 37 ];
40 } 38 }
41 39
@@ -38,9 +38,10 @@ class Video extends \yii\db\ActiveRecord @@ -38,9 +38,10 @@ class Video extends \yii\db\ActiveRecord
38 public function rules() 38 public function rules()
39 { 39 {
40 return [ 40 return [
41 - [['app', 'task_id', 'live_start_time', 'live_end_time', 'master_id', 'room_id', 'status', 'like_num', 'audience_num', 'replay_num', 'create_time', 'update_time'], 'integer'], 41 + [['task_id', 'live_start_time', 'live_end_time', 'master_id', 'room_id', 'status', 'like_num', 'audience_num', 'replay_num', 'create_time', 'update_time'], 'integer'],
42 [['title', 'live_title'], 'string', 'max' => 100], 42 [['title', 'live_title'], 'string', 'max' => 100],
43 [['pic', 'url'], 'string', 'max' => 255], 43 [['pic', 'url'], 'string', 'max' => 255],
  44 + [['app'], 'string', 'max' => 50],
44 ]; 45 ];
45 } 46 }
46 47
@@ -37,13 +37,11 @@ class Room extends \yii\db\ActiveRecord @@ -37,13 +37,11 @@ class Room extends \yii\db\ActiveRecord
37 public function rules() 37 public function rules()
38 { 38 {
39 return [ 39 return [
40 - [['room_id', 'master_id', 'app', 'starting_time', 'living', 'status', 'create_time', 'update_time'], 'integer'],  
41 - [['best', 'vest'], 'string'], 40 + [['room_id', 'master_id', 'starting_time', 'best', 'vest', 'living', 'status', 'create_time', 'update_time'], 'integer'],
42 [['title', 'watermark'], 'string', 'max' => 100], 41 [['title', 'watermark'], 'string', 'max' => 100],
43 - [['secret'], 'string', 'max' => 50],  
44 - [['pic'], 'string', 'max' => 255],  
45 - [['create_time', 'update_time'], 'default', 'value' => time()],  
46 - [['create_time', 'update_time'], 'required'], 42 + [['app', 'secret'], 'string', 'max' => 50],
  43 + [['pic', 'background_pic'], 'string', 'max' => 255],
  44 + [['room_id'], 'unique'],
47 ]; 45 ];
48 } 46 }
49 47
@@ -34,8 +34,6 @@ class RoomQchannel extends \yii\db\ActiveRecord @@ -34,8 +34,6 @@ class RoomQchannel extends \yii\db\ActiveRecord
34 [['room_id', 'create_time', 'update_time'], 'integer'], 34 [['room_id', 'create_time', 'update_time'], 'integer'],
35 [['downstream_address'], 'string'], 35 [['downstream_address'], 'string'],
36 [['channel_id', 'upstream_address'], 'string', 'max' => 255], 36 [['channel_id', 'upstream_address'], 'string', 'max' => 255],
37 - [['create_time', 'update_time'], 'default', 'value' => time()],  
38 - [['create_time', 'update_time'], 'required'],  
39 ]; 37 ];
40 } 38 }
41 39
@@ -41,9 +41,10 @@ class Video extends \yii\db\ActiveRecord @@ -41,9 +41,10 @@ class Video extends \yii\db\ActiveRecord
41 public function rules() 41 public function rules()
42 { 42 {
43 return [ 43 return [
44 - [['app', 'task_id', 'live_start_time', 'live_end_time', 'master_id', 'room_id', 'status', 'like_num', 'audience_num', 'replay_num', 'create_time', 'update_time'], 'integer'], 44 + [['task_id', 'live_start_time', 'live_end_time', 'master_id', 'room_id', 'status', 'like_num', 'audience_num', 'replay_num', 'create_time', 'update_time'], 'integer'],
45 [['title', 'live_title'], 'string', 'max' => 100], 45 [['title', 'live_title'], 'string', 'max' => 100],
46 [['pic', 'url'], 'string', 'max' => 255], 46 [['pic', 'url'], 'string', 'max' => 255],
  47 + [['app'], 'string', 'max' => 50],
47 ]; 48 ];
48 } 49 }
49 50