统计文章与分类中间表中c_id的数目,也就是category表中total字段的值
原生SQL语句:select count(c_id) from article_category where c_id=1;
原来错误的写法:
正确的写法:
ArticleCategory::find()->where(['c_id'=>$id])->count('c_id');
统计文章与分类中间表中c_id的数目,也就是category表中total字段的值
原生SQL语句:select count(c_id) from article_category where c_id=1;
原来错误的写法:
正确的写法:
ArticleCategory::find()->where(['c_id'=>$id])->count('c_id');
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。