belongsTo(Category::class, 'catid', 'id'); } /** * 定义与分类的多对一关系 */ public function websiteCategory() { return $this->belongsTo(WebsiteCategory::class, 'catid', 'category_id'); } /** * 定义与分类的多对一关系 */ public function articleIgnore() { return $this->hasOne(ArticleIgnore::class, 'article_id', 'id') // ->whereColumn('article_ignore.website_id', 'article.web_site_id') ; } }