auditlist.php 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Administrator
  5. * Date: 2017/5/23 0023
  6. * Time: 下午 8:24
  7. */
  8. use yii\helpers\Url;
  9. use yii\widgets\LinkPager;
  10. ?>
  11. <div class="row">
  12. <div class="col-sm-12">
  13. <div class="ibox float-e-margins">
  14. <div class="ibox-content">
  15. <div class="row">
  16. <div class="col-sm-5 m-b-xs">
  17. <div class="col-sm-9">
  18. </div>
  19. </div>
  20. </div>
  21. <div class="table-responsive">
  22. <table class="table table-striped">
  23. <thead>
  24. <tr>
  25. <th>用户id</th>
  26. <th>用户名</th>
  27. <th>公司名</th>
  28. <th>营业执照</th>
  29. <th>电话</th>
  30. <th>等级</th>
  31. <th>年限</th>
  32. <th>领域</th>
  33. <th>地区</th>
  34. <th>注册时间</th>
  35. <th>审核</th>
  36. </tr>
  37. </thead>
  38. <tbody>
  39. <?php if(!empty($datas)):?>
  40. <?php foreach($datas as $data):?>
  41. <tr>
  42. <td><?=$data->id?></td>
  43. <td><?=$data->username?></td>
  44. <? $userinfo = isset($data->usercompany)?$data->usercompany:''?>
  45. <td><a class="introduce""><input hidden="hidden" class="introduce-val" value="<?=isset($userinfo->introduction)?$userinfo->introduction:''?>"><?=isset($userinfo->company)?$userinfo->company:''?></a></td>
  46. <td> <img <?php if(!empty($userinfo->logo)):?>src="<?=Yii::getAlias('@imgdomain').'/'.$userinfo->logo; ?>" style=" width: 50px;"><?php endif;?></td>
  47. <td><?=isset($userinfo->tel)?$userinfo->tel:''?></td>
  48. <td><?=isset($userinfo->level)?$userinfo->level:''?></td>
  49. <td><?=isset($userinfo->age)?$userinfo->age:''?></td>
  50. <td><?=isset($userinfo->licence)?$userinfo->licence:''?></td>
  51. <td><?=isset($userinfo->city)?$userinfo->city:''?><?=isset($userinfo->district)?$userinfo->district:''?><?=isset($userinfo->adress)?$userinfo->adress:''?></td>
  52. <?unset($userinfo)?>
  53. <td><?=date('Y-m-d H:i:s',$data->created_at)?></td>
  54. <td data="<?=$data->id?>">
  55. <a class="btn btn-sm btn-primary user-conduct" date="agree">通过</a>
  56. <button class="btn btn-sm btn-danger user-conduct" date="reject">驳回</button>
  57. </td>
  58. </tr>
  59. <?php endforeach;?>
  60. <?php endif?>
  61. </tbody>
  62. </table>
  63. </div>
  64. </div>
  65. </div>
  66. <?= LinkPager::widget(['pagination' => $pages]); ?>
  67. </div>
  68. </div>
  69. <script>
  70. $(".introduce").click(function(){
  71. var introduce = $(this).find('.introduce-val').val();
  72. var company = $(this).text();
  73. parent.layer.open({//layer弹窗插件语法
  74. title: company+'简介',//标题
  75. anim: 1 ,//动画类型有0-6,不想显示动画,设置 anim: -1
  76. scrollbar: false,//默认允许浏览器滚动,如果设定scrollbar: false,则屏蔽
  77. area: ['500px', '300px'],//自定义宽高
  78. content: '<textarea class="content" rows="6" cols="62">'+introduce+'</textarea>',//自定义内容
  79. shade: [0.8, '#393D49'],//默认是0.3透明度的黑色背景('#000'),不想显示遮罩shade: 0
  80. shadeClose:true,//控制点击弹层外区域关闭
  81. btn: ['确认'],//自定义按钮,默认第一个为确定按钮
  82. btnAlign: 'c',//按钮显示方式 'l' 按钮左对齐 'c' 按钮居中对齐 'r' 按钮右对齐(默认)
  83. btn1:function(index, content){
  84. }
  85. });
  86. });
  87. $('.type-select').change(function(){
  88. var type = $(this).val();
  89. window.location="<?=Url::toRoute(['user/auditlist']);?>?type="+type;
  90. })
  91. $('.user-conduct').click(function(){
  92. var ele = $(this);
  93. var id = ele.parent().attr('data');
  94. var conduct = $(this).attr('date');
  95. if(conduct=='agree'){
  96. var text = "确定审核通过?";
  97. }else{
  98. var text = "确定审核驳回?";
  99. }
  100. swal({
  101. title: "提醒",
  102. text: text,
  103. type: "warning",
  104. showCancelButton: true,
  105. confirmButtonColor: "#DD6B55",
  106. confirmButtonText: "确定",
  107. cancelButtonText: "取消",
  108. closeOnConfirm: false
  109. }, function () {
  110. $.ajax({
  111. url:'<?=Url::toRoute(['user/useraudit']);?>',
  112. type:'POST',
  113. dataType:'json',
  114. data:{'id':id,'conduct':conduct,'_csrf-backend':'<?=Yii::$app->request->csrfToken;?>'},
  115. success:function(data){
  116. if(data.sign==1){
  117. swal("", data.msg, "success");
  118. ele.parent().parent().remove();
  119. }else{
  120. swal("", data.msg, "error");
  121. }
  122. }
  123. });
  124. });
  125. })
  126. </script>