| 123456789101112131415161718192021222324252627282930 |
- <?php
- declare(strict_types=1);
- namespace App\Model;
- class TypeModel extends BaseModel
- {
- /**
- * 表名.
- *
- * @var string
- */
- protected $table = 'type';
- public function video()
- {
- return $this->hasMany(TypeVideoModel::class, 'type_id', 'id');
- }
- public function upvideo()
- {
- return $this->hasMany(TypeVideoModel::class, 'type_id', 'id')->where('status', 1);
- }
- public function users()
- {
- return $this->hasMany(UserTagModel::class, 'tag_id', 'id');
- }
- }
|