hy-farm/muchang/home/views/web/get_broadcast_list.php
2026-05-29 19:54:56 +08:00

51 lines
1.5 KiB
PHP
Raw Permalink 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\models\UserBroadcastMessage;
use common\utils\EnumUtil;
use yii\data\ActiveDataProvider;
use yii\helpers\Html;
use yii\widgets\LinkPager;
$query = UserBroadcastMessage::find()->where(['del' => EnumUtil::DELETE_NOT, 'pass' => EnumUtil::VERIFY_WAIT]);
$provider = new ActiveDataProvider([
'query' => $query,
'pagination' => [
'pageSize' => 4,
],
'sort' => [
'defaultOrder' => [
'created_at' => SORT_DESC,
'id' => SORT_DESC,
]
],
]);
?>
<div class="main">
<ul class="newslist">
<?php foreach ($provider->getModels() as $item): ?>
<li>
<div class="newslist-item-head"><?= $item->nickname ?></div>
<div class="newslist-item-info">
<span>用户ID<?= $item->user_id ?></span>
<span>微信号:<?= $item->wx_id ?></span>
<span>电话:<?= $item->phone ?></span>
<span>日期:<?= $item->created_at_str ?></span>
</div>
<div class="newslist-item-text">
<nobr><?= $item->message ?></nobr>
</div>
</li>
<?php endforeach; ?>
</ul>
<div class="navbar-fixed-bottom" style="bottom: 20px;">
<center>
<?= LinkPager::widget(['pagination' => $provider->pagination, 'maxButtonCount' => 5]); ?>
</center>
</div>
</div>