hy-farm/muchang/backend/views/message/message_list.php
2026-05-29 19:54:56 +08:00

223 lines
9.6 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!-- 广播消息审核-->
<?php
use common\utils\CommUtil;
use common\utils\EnumUtil;
use yii\widgets\LinkPager;
?>
<section class="content-header">
</section>
<!-- Main content -->
<section class="content">
<div class="box">
<div class="box-header">
<h3 class="box-title">广播消息审核</h3>
</div>
<!-- /.box-header -->
<div class="box-body">
<div id="example2_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
<div class="btn-group btn-group-sm">
<button type="button" class="btn btn-primary " onclick="selectAll();">全选</button>
<button type="button" class="btn btn-primary" onclick="selectRevertAll();">反选</button>
<button type="button" class="btn btn-primary" onclick="pass();">通过</button>
<button type="button" class="btn btn-primary" onclick="reject();">拒绝</button>
</div>
<div class="row">
<div class="col-sm-12">
<table id="example2" class="table table-bordered table-hover dataTable" role="grid" aria-describedby="example2_info">
<thead>
<tr role="row">
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending"></th>
<th class="sorting_asc" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-sort="ascending"
aria-label="Rendering engine: activate to sort column descending">ID
</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">用户ID</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Platform(s): activate to sort column ascending">用户昵称</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Engine version: activate to sort column ascending">微信号</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="CSS grade: activate to sort column ascending">电话</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="CSS grade: activate to sort column ascending">状态</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="CSS grade: activate to sort column ascending">内容</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="CSS grade: activate to sort column ascending">创建时间</th>
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="CSS grade: activate to sort column ascending"></th>
</tr>
</thead>
<tbody>
<?php foreach ($list as $item): ?>
<tr role="row">
<td><input data-selected-check-box type="checkbox" value="<?= $item['id'] ?>" ></td>
<td><?= $item['id'] ?></td>
<td><?= $item['user_id'] ?></td>
<td><?= $item['nickname'] ?></td>
<td><?= $item['wx_id'] ?></td>
<td><?= $item['phone'] ?></td>
<td><?= EnumUtil::VERIFY_LIST_STR[$item['pass']] ?></td>
<td><?= $item['message'] ?></td>
<td><?= CommUtil::formatDate($item['created_at']) ?></td>
<td>
<a href="<?= \yii\helpers\Url::to(['message/message-edit', 'id' => $item['id'], 'type' => EnumUtil::VERIFY_PASS]) ?>"><i class="fa fa-check"></i></a>
<a href="<?= \yii\helpers\Url::to(['message/message-edit', 'id' => $item['id'], 'type' => EnumUtil::VERIFY_REFUSE]) ?>"><i class="fa fa-ban"></i></a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
<div class="btn-group btn-group-sm">
<button type="button" class="btn btn-primary" onclick="selectAll();">全选</button>
<button type="button" class="btn btn-primary" onclick="selectRevertAll();">反选</button>
<button type="button" class="btn btn-primary" onclick="pass();">通过</button>
<button type="button" class="btn btn-primary" onclick="reject();">拒绝</button>
</div>
<div class="row">
<div class="col-sm-5">
<div class="dataTables_info" id="example2_info" role="status" aria-live="polite"><?= sprintf('总共%d条数据', $totalCount); ?></div>
</div>
<div class="col-sm-7">
<div class="dataTables_paginate paging_simple_numbers" id="example2_paginate">
<?= LinkPager::widget(['pagination' => $pages]); ?>
</div>
</div>
</div>
</div>
</div>
<!-- /.box-body -->
</div>
</section>
<script type="text/javascript">
var LG = (function (lg) {
var objURL = function (url) {
this.ourl = url || window.location.href;
this.href = "";//?前面部分
this.params = {};//url参数对象
this.jing = "";//#及后面部分
this.init();
}
//分析url,得到?前面存入this.href,参数解析为this.params对象#号及后面存入this.jing
objURL.prototype.init = function () {
var str = this.ourl;
var index = str.indexOf("#");
if (index > 0) {
this.jing = str.substr(index);
str = str.substring(0, index);
}
index = str.indexOf("?");
if (index > 0) {
this.href = str.substring(0, index);
str = str.substr(index + 1);
var parts = str.split("&");
for (var i = 0; i < parts.length; i++) {
var kv = parts[i].split("=");
this.params[kv[0]] = kv[1];
}
}
else {
this.href = this.ourl;
this.params = {};
}
}
//只是修改this.params
objURL.prototype.set = function (key, val) {
this.params[key] = val;
}
//只是设置this.params
objURL.prototype.remove = function (key) {
this.params[key] = undefined;
}
//根据三部分组成操作后的url
objURL.prototype.url = function () {
var strurl = this.href;
var objps = [];//这里用数组组织,再做join操作
for (var k in this.params) {
if (this.params[k]) {
objps.push(k + "=" + this.params[k]);
}
}
if (objps.length > 0) {
strurl += "?" + objps.join("&");
}
if (this.jing.length > 0) {
strurl += this.jing;
}
return strurl;
}
//得到参数值
objURL.prototype.get = function (key) {
return this.params[key];
}
lg.URL = objURL;
return lg;
}(LG || {}));
function selectAll() {
$("[data-selected-check-box]").each(function () {
$(this).prop("checked","true");
console.log($(this).prop("checked"));
});
}
function selectRevertAll() {
$("[data-selected-check-box]").each(function () {
if($(this).prop("checked"))
{
$(this).removeAttr("checked");
}
else
{
$(this).prop("checked","true");
}
console.log($(this).prop("checked"));
});
}
function pass() {
var str = "";
$("[data-selected-check-box]").each(function () {
if($(this).prop("checked"))
{
str += $(this).val() + "," ;
}
});
if(str.length>0)
str = str.substring(0, str.length - 1);
var url="<?=\yii\helpers\Url::to(['message/do-list'])?>";
var myurl = new LG.URL(url);
myurl.set('id_list_str',str);
myurl.set('type',1);
self.location.href = myurl.url();
}
function reject() {
var str = "";
$("[data-selected-check-box]").each(function () {
if($(this).prop("checked"))
{
str += $(this).val() + "," ;
}
});
if(str.length>0)
str = str.substring(0, str.length - 1);
var url="<?=\yii\helpers\Url::to(['message/do-list'])?>";
var myurl = new LG.URL(url);
myurl.set('id_list_str',str);
myurl.set('type',2);
self.location.href = myurl.url();
}
</script>