統計文章與分類中間表中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刪除。