| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226 |
- <?php
- use common\services\xhUserService;
- use common\services\xhTrainUserCourseService;
- use yii\widgets\LinkPager;
- ?>
- <div class="page-title">
- <div class="title-env">
- <h1 class="title">作品管理</h1>
- </div>
- <div class="breadcrumb-env">
- <ol class="breadcrumb bc-1">
- <li>
- <a href="/"><i class="fa-home"></i>Home</a>
- </li>
- <li>
- <a href="javascript:void(0)">花艺培训</a>
- </li>
- <li class="active">
- <strong>作品管理</strong>
- </li>
- </ol>
- </div>
- </div>
- <div class="panel panel-default">
- <div class="panel-body">
- <div id="example-2_wrapper" class="dataTables_wrapper form-inline dt-bootstrap no-footer">
- <div class="row">
- <div class="col-xs-6" style="width:90%;">
- <div class="dataTables_length">
- <a href="javascript:void(0)" name="weekList" class="btn btn-secondary btn-single" style="margin-right:15px;">本周榜</a>
- <a href="javascript:void(0)" name="monthList" class="btn btn-secondary btn-single" style="margin-right:15px;">本月榜</a>
- </div>
- </div>
- </div>
- <div class="table-responsive">
- <table class="table table-bordered table-striped table-hover" >
- <thead>
- <tr class="active">
- <th class="no-sorting"><input type="checkbox"></th>
- <th>ID</th>
- <th>姓名</th>
- <th>课名</th>
- <th>作品</th>
- <th>喜欢数</th>
- <th>时间</th>
- <th>操作</th>
- </tr>
- </thead>
- <tbody class="middle-align">
- <?php if(!empty($models)){ ?>
- <?php foreach($models as $key => $val){
- $userId = $val['userId'];
- $user = xhUserService::getById($userId);
- ?>
- <tr>
- <td><input type="checkbox"></td>
- <td><?= $key+1 ?></td>
- <td><a href="/course/detail?id=<?= $val['studentId'] ?>"><?= $user['userName'] ?></a></td>
- <td><?= $val['courseName'] ?></td>
- <td>
- <?php
- $largeImg = $val['worksImg'];
- $imgList = xhTrainUserCourseService::getWorksImgList($largeImg);
- echo '<img src="'.Yii::$app->params['imgUrl'].$imgList['small'].'" width="25" />';
- ?>
- </td>
- <td>
- <?php
- $praiseNum = Yii::$app->redis->executeCommand('ZCOUNT', ["userCourse".$val['id']."PraiseUser", 0, time()]);
- echo $praiseNum;
- ?>
- </td>
- <td><?php if(!empty($val['attendTime'])){ echo date("Y-m-d H:i:s",$val['attendTime']); } ?></td>
- <td>
- </td>
- </tr>
- <?php } } ?>
- </tbody>
- </table>
- </div>
- <div class="row">
- <div>
- <!--
- <div style="display:inline-block;margin-left:15px;">
- <label><select name="example-1_length"
- aria-controls="example-1" class="form-control">
- <option value="0">批量操作</option>
- <option value="1">批量下架</option>
- <option value="2">批量删除</option>
- </select>
- </label>
- <input class="btn btn-secondary btn-single" type="submit" name="" value="确认" />
- </div>
- -->
- <div class="dataTables_paginate paging_simple_numbers" style="float:right;padding-top:0px;margin-right:15px;">
- <?= LinkPager::widget(['pagination' => $pages]); ?>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- footer -->
- <?php
- use backend\widgets\FooterWidget;
- ?>
- <?= FooterWidget::widget()?>
- <!-- footer -->
- <!-- modal 周榜 -->
- <div class="modal fade" id="weekModal" >
- <div class="modal-dialog" style="height:450px;">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
- <h4 class="modal-title">本周集赞排行榜</h4>
- </div>
- <div class="modal-body">
- <div class="table-responsive">
- <table class="table table-bordered table-striped table-hover" >
- <thead>
- <tr class="active">
- <th>名次</th>
- <th>头像</th>
- <th>姓名</th>
- <th>点赞数</th>
- </tr>
- </thead>
- <tbody class="middle-align">
- <?php if(!empty($weekRank)){ ?>
- <?php foreach($weekRank as $key => $val){ ?>
- <tr>
- <td><?= $key + 1 ?></td>
- <td><img width="20" src="<?= Yii::$app->params['imgUrl'].$val['userInfo']['avatar'] ?>" /></td>
- <td><a href="#"><?= $val['userInfo']['userName'] ?></a></td>
- <td><?= $val['praiseNum'] ?></td>
- </tr>
- <?php } } ?>
- </tbody>
- </table>
- </div>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-white" data-dismiss="modal">确认</button>
- </div>
- </div>
- </div>
- </div>
- <script>
- $(function(){
- //充值操作
- jQuery("a[name=weekList]").click(function(){
- var url = $(this).attr('data-url');
- var userName = $(this).attr('data-userName');
- $("#rechargeModal .modal-body span").text(userName);
- $("#rechargeModal .modal-body input[name=userName]").val(userName);
- $("#rechargeModal .modal-body input[name=requestUrl]").val(url);
- $("#rechargeModal .modal-body input[name=rechargeAmount]").val('');
- jQuery('#weekModal').modal('show');
- });
- });
- </script>
- <!-- modal 月榜 -->
- <div class="modal fade" id="monthModal" >
- <div class="modal-dialog" style="height:450px;">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
- <h4 class="modal-title">本月集赞排行榜</h4>
- </div>
- <div class="modal-body">
- <div class="table-responsive">
- <table class="table table-bordered table-striped table-hover" >
- <thead>
- <tr class="active">
- <th>名次</th>
- <th>头像</th>
- <th>姓名</th>
- <th>点赞数</th>
- </tr>
- </thead>
- <tbody class="middle-align">
- <?php if(!empty($monthRank)){ ?>
- <?php foreach($monthRank as $key => $val){ ?>
- <tr>
- <td><?= $key + 1 ?></td>
- <td><img width="20" src="<?= Yii::$app->params['imgUrl'].$val['userInfo']['avatar'] ?>" /></td>
- <td><a href="#"><?= $val['userInfo']['userName'] ?></a></td>
- <td><?= $val['praiseNum'] ?></td>
- </tr>
- <?php } } ?>
- </tbody>
- </table>
- </div>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-white" data-dismiss="modal">确认</button>
- </div>
- </div>
- </div>
- </div>
- <script>
- $(function(){
- //充值操作
- jQuery("a[name=monthList]").click(function(){
- var url = $(this).attr('data-url');
- var userName = $(this).attr('data-userName');
- $("#rechargeModal .modal-body span").text(userName);
- $("#rechargeModal .modal-body input[name=userName]").val(userName);
- $("#rechargeModal .modal-body input[name=requestUrl]").val(url);
- $("#rechargeModal .modal-body input[name=rechargeAmount]").val('');
- jQuery('#monthModal').modal('show');
- });
- });
- </script>
|