Autor | Zpráva | ||
---|---|---|---|
Elsevi Profil * |
#1 · Zasláno: 6. 10. 2012, 21:28:23
Dobry den, som novy v ORM datamapper pre codeigniter. Mam vytvoreny blog ale len cez klasicke active record od CI..chcem prejst na ORM datamapper od wanwizzarda a nastali mi nejake problemy, s ktorimi si neviem poradit. Mam jeden query cez AR:
$query = $this->db->select(" a.title AS articles_title, a.content AS articles_content, CONCAT(up.first_name, ' ', up.last_name) AS articles_author, DATE_FORMAT(a.created, '%T %d.%m.%Y') AS articles_created, (SELECT IFNULL(ROUND(AVG(av.vote),1), 0) FROM articles_votes av WHERE a.id = av.article_id) AS articles_votes, (SELECT COUNT(ac.id) FROM articles_comments ac WHERE a.id = ac.article_id) AS articles_totalcomments", FALSE) ->from('articles a') ->join('user_profiles up', 'a.author_id = up.user_id') ->where('page_id', $page_id) ->order_by("a.id") ->limit($num, $offset) ->get(); |
||
Časová prodleva: 12 let
|
0