| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- declare(strict_types=1);
- namespace App\Model;
- use Hyperf\DbConnection\Model\Model;
- /**
- */
- class SinglePage extends Model
- {
- /**
- * The table associated with the model.
- */
- protected ?string $table = 'single_page';
- /**
- * The attributes that are mass assignable.
- */
- protected array $fillable = [];
- /**
- * The attributes that should be cast to native types.
- */
- protected array $casts = [];
- /**
- * 定义与分类的多对一关系
- */
- public function websiteCategory()
- {
- return $this->belongsTo(WebsiteCategory::class, 'catid', 'category_id');
- }
- /**
- * 定义与分类的一对一关系
- */
- public function user()
- {
- return $this->hasOne(User::class, 'id', 'user_id');
- }
- }
|