팁/튜토리얼

추천수/댓글수로 평점 계산하기

2018.11.14 02:14
1,136
1
<block cond="$mid=='rank'">
   <div class="rankbox">
      {@
      $vote = $document->get('voted_count')?$document->get('voted_count'):0;
      $cmt = $document->getCommentCount()?$document->getCommentCount():0;
      //$star = (int)($vote/$cmt);
      //$star = round($voteDcmt?$voteDcmt:0,0);
      $star = $vote > 0 && $cmt > 0 ? $vote/$cmt : 0;
      }
      <div class="info_starpointCount{$star}">
         {$star}
      </div>
      
      <div class="ico_starpoint{(int)($star)}">
         {$star}
      </div>
      <div class="info_votecount">
         {$document->getCommentCount()?$document->getCommentCount():0}개의 평가
      </div>
   </div>
</block>

KakaoTalk_20181114_105714958.png

eond Lv. 12

댓글 2