36 lines
1.1 KiB
PHP
36 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace app\api\controller;
|
|
|
|
use think\Controller;
|
|
use think\Db;
|
|
|
|
class UserMessage extends Common
|
|
{
|
|
//系统封面消息接口
|
|
public function get_user_message_cover_info()
|
|
{
|
|
$reslut = model('UserMessage')->get_user_message_cover_info($this->uid);
|
|
return ajaxReturn($reslut['code'], $reslut['msg'], $reslut['data']);
|
|
}
|
|
///消息列表接口
|
|
public function get_user_message_list()
|
|
{
|
|
$type = input('type', 0); //排序规则
|
|
$page = input('page', 1);
|
|
$page_limit = input('page_limit', 30);
|
|
$reslut = model('UserMessage')->get_user_message_list($this->uid, $type, $page, $page_limit);
|
|
return ajaxReturn($reslut['code'], $reslut['msg'], $reslut['data']);
|
|
}
|
|
public function is_private_chat()
|
|
{
|
|
$contribution_level = Db::name('user')->where('uid', $this->uid)->value('contribution_level');
|
|
$is_private_chat = 1;
|
|
if($contribution_level >=2) {
|
|
$is_private_chat = 1;
|
|
}
|
|
$data = ['is_private_chat' => $is_private_chat];
|
|
return ajaxReturn(200, '获取数据成功', $data);
|
|
}
|
|
}
|