Files
yusheng-php/application/guildadmin/controller/SystemMessage.php

74 lines
2.4 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
namespace app\guildAdmin\controller;
use app\admin\command\Menu;
use app\GuildAdmin\model\AuthGroup;
use app\GuildAdmin\model\AuthGroupAccess;
use app\GuildAdmin\model\AuthRule;
use app\common\controller\GuildAdmin;
use fast\Random;
use fast\Tree;
use think\Cache;
use think\Db;
use think\Exception;
use think\Hook;
use think\Session;
use think\Validate;
/**
* 管理员管理
*
* @icon fa fa-users
* @remark 一个管理员可以有多个角色组,左侧的菜单根据管理员所拥有的权限进行生成
*/
class SystemMessage extends GuildAdmin
{
protected $noNeedLogin = [];
protected $noNeedRight = [];
protected $layout = '';
protected $table_guild_subsidy_config = 'vs_guild_subsidy_config';
protected $table_guild_subsidy = 'vs_guild_subsidy';
protected $table_guild_user = 'vs_guild_user';
protected $table_guild_data = 'vs_guild_data';
protected $table_guild = 'vs_guild';
public function _initialize()
{
parent::_initialize();
}
//平台公告
public function message_lists(){
$guild_id = $this->guildId;
$page = input('page', 1);
$page_limit = input('page_limit', 30);
$where['delete_time'] = 0;
if($this->auth->id != 1) {
$where['receiving_id'] = $guild_id;
}
$where['type'] = 5;
$count = db::name('system_message')->where($where)->count();
$lists = db::name('system_message')->where($where)->order('createtime desc')->page($page, $page_limit)->select();
$lists_data =[];
foreach ($lists as $key => $value) {
$lists_data[$key]['title'] = $value['title'];
$lists_data[$key]['content'] = $value['content'];
$lists_data[$key]['createtime'] = date('Y-m-d H:i:s', $value['createtime']);
$lists_data[$key]['type_name'] = $value['type'] == 1 ? '系统消息' : '官方公告';
$lists_data[$key]['admin_name'] = db::name('admin')->where('id', $value['admin_id'])->value('nickname');
//提醒方式1 站内 2短信
$lists_data[$key]['remind_type_str'] = $value['remind_type'] == 1 ? '站内' : '短信';
}
$return_data = [
'page' =>$page,
'page_limit' => $page_limit,
'count' => $count,
'lists' => $lists_data
];
return V(1,"成功", $return_data);
}
}