123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- <?php
- /**
- * Created by PhpStorm.
- * User: Administrator
- * Date: 2017/5/23 0023
- * Time: 下午 8:24
- */
- use yii\helpers\Url;
- use yii\widgets\LinkPager;
- ?>
- <div class="row">
- <div class="col-sm-12">
- <div class="ibox float-e-margins">
- <div class="ibox-content">
- <div class="row">
- <div class="col-sm-5 m-b-xs">
- <div class="col-sm-9">
- </div>
- </div>
- </div>
- <div class="table-responsive">
- <table class="table table-striped">
- <thead>
- <tr>
- <th>id</th>
- <th>用户名</th>
- <th>昵称</th>
- <th>头像</th>
- <th>电话</th>
- <th>注册时间</th>
- <th>操作</th>
- </tr>
- </thead>
- <tbody>
- <?php if(!empty($datas)):?>
- <?php foreach($datas as $data):?>
- <tr>
- <td><?=$data->id?></td>
- <td><?=$data->username?></td>
- <?php $userinfo = isset($data->userinfo)?$data->userinfo:''?>
- <td><?=isset($userinfo->nickname)?$userinfo->nickname:''?></td>
- <td> <img src="<?=empty($userinfo->portrait)?\common\models\User::DEFAULT_FACE:\common\models\UserInfo::imagesUrl($userinfo->portrait)?>" style=" width: 50px;"></td>
- <td><?=isset($data->tel)?$data->tel:''?></td>
- <?unset($userinfo)?>
- <td><?=date('Y-m-d H:i',$data->created_at)?></td>
- <td>
- <!-- <a href="--><?//=Url::toRoute(['webconfig/addadvert','id'=>$data->id])?><!--" class="btn btn-sm btn-primary edit_advert">修改</a>-->
- <a class="btn btn-sm btn-danger del"data="<?= $data->id?>">删除</a>
- </td>
- </tr>
- <?php endforeach;?>
- <?php endif?>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- <?= LinkPager::widget(['pagination' => $pages]); ?>
- </div>
- </div>
- <script>
- $('.table-responsive').on('click','.del',function(){
- var id = $(this).attr('data');
- var text = $(this);
- swal({
- title: "确定删除该用户?",
- type: "warning",
- showCancelButton: true,
- confirmButtonColor: "#DD6B55",
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- closeOnConfirm: true,
- closeOnCancel: true },
- function(isConfirm){
- if (isConfirm) {
- $.ajax({
- url:'<?=Url::toRoute(['user/del_company']);?>',
- type:'POST',
- dataType:'json',
- data:{id:id,'_csrf-backend':'<?=Yii::$app->request->csrfToken;?>'},
- success:function(data){
- if(data.sign==1){
- text.parents('tr').remove();
- }else{
- swal("", data.msg, "error");
- }
- }
- })
- }
- });
- })
- $('.user-conduct').click(function(){
- var ele = $(this);
- var id = ele.parent().attr('data');
- var conduct = $(this).attr('date');
- if(conduct=='agree'){
- var text = "确定审核通过?";
- }else{
- var text = "确定审核驳回?";
- }
- swal({
- title: "提醒",
- text: text,
- type: "warning",
- showCancelButton: true,
- confirmButtonColor: "#DD6B55",
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- closeOnConfirm: false
- }, function () {
- $.ajax({
- url:'<?=Url::toRoute(['user/useraudit']);?>',
- type:'POST',
- dataType:'json',
- data:{'id':id,'conduct':conduct,'_csrf-backend':'<?=Yii::$app->request->csrfToken;?>'},
- success:function(data){
- if(data.sign==1){
- swal("", data.msg, "success");
- ele.parent().parent().remove();
- }else{
- swal("", data.msg, "error");
- }
- }
- });
- });
- })
- </script>
|