public static function PopulateReviewViewModelList($reviews) { for ($i = 0; $i < count($reviews); $i++) { $models[$i] = ReviewHelper::PopulateReviewViewModel($reviews[$i]); } return $models; }
public function action_item() { PermissionHelper::Verification('Editor'); $model = ReviewHelper::PopulateReviewViewModelList(ReviewService::GetAll()); $this->view->generate('/Review/item_view.php', 'template_view.php', $model); }
<meta charset="utf-8" /> <?php $title = isset($page_title) ? $page_title . ' - 美团技术委员会' : '美团技术委员会'; echo '<title>' . $title . '</title>'; ?> <link rel="stylesheet" href="/static/bootstrap/css/bootstrap.css"> <link rel="stylesheet" href="/static/css/prt_base.css"> <link rel="icon" href="/favicon.ico" type="image/x-icon"> <script type="text/javascript" src="/static/js/zepto.min.js"></script> <script type="text/javascript" src="/static/js/jquery-1.7.1.min.js"></script> <script type="text/javascript" src="/static/js/prt_base.js"></script> <script type="text/javascript" src="/static/js/chart.min.js"></script> <script type="text/javascript" src="/static/js/jquery.dragsort.js"></script> </head> <body id="<?php echo isset($page_name) ? $page_name : ''; ?> "> <header class="common-header">美团技术委员会 <?php $count = ReviewHelper::getCountOfTodo(self::$loginUser); $DATES = ReviewHelper::getLimitDates(); echo '<a class="mine" href="/review/mine">我的申请</a>'; if ($count > 0) { echo '<a href="/review/manage">待处理<span>' . $count . '</span>项</a>'; } else { echo '<a href="/review/manage">待处理事项</a>'; } ?> </header>
<table class="table table-bordered" id="review"> <tr> <th>Имя пользователя</th> <th>Коментарий</th> </tr> <?php $reviewdata = ReviewHelper::PopulateReviewViewModelList(ReviewService::GetByProductId($data->Id)); if (isset($reviewdata)) { foreach ($reviewdata as $review) { ?> <tr> <td style="width: 150px"><?php echo $review->account->name; ?> </td> <td><?php echo $review->value; ?> </td> </tr> <?php } } ?> </table> <form class=form-inline" action="/Account/newReview" method="post"> <input type="hidden" name="tovarId" value="<?php echo $data->Id; ?> "> <div class="form-group" style="vertical-align: middle">