hi there
i have 2 tables, imagine tbl_exam and tbl_question
there is no problem in showing question count for each exam in exam gridview, but how can i sort the exam’s gridview by question count?
thanks in advance!
hi there
i have 2 tables, imagine tbl_exam and tbl_question
there is no problem in showing question count for each exam in exam gridview, but how can i sort the exam’s gridview by question count?
thanks in advance!
You can define "question_count" attribute in Exam model.
And … look at the following:
http://www.yiiframework.com/doc-2.0/guide-db-active-record.html#selecting-extra-fields