Exemple #1
0
 public function actionResetDb()
 {
     die;
     LikeFbPost::model()->deleteAll();
     LikeFbFiles::model()->deleteAll();
     LikeFbDoc::model()->deleteAll();
     LikeFbCommentDoc::model()->deleteAll();
     LikeFbCommentFile::model()->deleteAll();
     LikeFbCommentPost::model()->deleteAll();
     PhotoFbCommentPost::model()->deleteAll();
     PhotoFbPost::model()->deleteAll();
     FbDocComment::model()->deleteAll();
     FbFilesComment::model()->deleteAll();
     FbPostComment::model()->deleteAll();
     FbPost::model()->deleteAll();
     FbFiles::model()->deleteAll();
     FbDoc::model()->deleteAll();
     MemberDegreeGroup::model()->deleteAll();
     MemberExamGroup::model()->deleteAll();
 }
Exemple #2
0
$n_total_post_exam = 0;
$n_total_post_exam_like = 0;
$n_total_photo_post_exam = 0;
$n_total_exam_post_comment = 0;
$n_total_photo_exam_comments = 0;
$n_total_like_comments = 0;
$n_total_exam_files = 0;
$n_total_exam_docs = 0;
if (is_a($group, 'DegreeGroup')) {
    $ref_id = $group->cid;
    $find_group = DegreeGroup::model()->findByPk($group->cid);
    $posts_degree = FbPost::model()->findAllByAttributes(array('degree_group_id' => $group->cid));
    $docs_degree = FbDoc::model()->findAllByAttributes(array('degree_group_id' => $group->cid));
    $files_degree = FbFiles::model()->findAllByAttributes(array('degree_group_id' => $group->cid));
    foreach ($docs_degree as $doc) {
        $docs_like = LikeFbDoc::model()->findByAttributes(array('ref_entity_id' => $doc->fbdid));
        $n_total_like_docs += count($docs_like);
        // 			array_push($total_like_docs_degree, $docs_like);
    }
    $exam_group_created = ExamGroup::model()->findAllByAttributes(array('degree_group_id' => $group->cid));
    $member = MemberDegreeGroup::model()->findAllByAttributes(array('user_group_id' => $group->cid));
    foreach ($posts_degree as $p) {
        $photos = PhotoFbPost::model()->findAllByAttributes(array('element_id' => $p->fbpid));
        $n_photos_posts_degree += count($photos);
        // 			array_push($total_photos_degree_post, $photos);
        $like_post_degree = LikeFbPost::model()->findAllByAttributes(array('ref_entity_id' => $p->fbpid));
        $n_like_post_degree += count($like_post_degree);
        // 			array_push($total_like_post_degree, $like_post_degree);
        $comments = FbPostComment::model()->findAllByAttributes(array('ref_entity_id' => $p->fbpid));
        $n_comment_post_degree += count($comments);
        // 				array_push($total_degree_post_comment, $comments);