You've already forked guangan
22 lines
580 B
PHP
22 lines
580 B
PHP
<?php
|
|
|
|
namespace app\custom\controller\api\auth;
|
|
|
|
use app\custom\controller\api\Auth;
|
|
use app\custom\model\CustomMessage;
|
|
|
|
class Message extends Auth
|
|
{
|
|
public function index()
|
|
{
|
|
$pageData = CustomMessage::query()->where('user_id', $this->usid)->order('id', 'desc')->paginate();
|
|
$this->success('获取消息列表', $pageData);
|
|
}
|
|
|
|
public function read()
|
|
{
|
|
$id = $this->request->post('id');
|
|
CustomMessage::query()->where('user_id', $this->usid)->where('id', $id)->update(['status' => 1]);
|
|
$this->success('已读');
|
|
}
|
|
} |