|
@@ -1356,7 +1356,14 @@ class User extends Api
|
|
|
|
|
|
return $username;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ //查询是否有未读消息
|
|
|
+ public function getreadsysmsg() {
|
|
|
+ $count = Db::name('sys_msg')->where(['user_id' => $this->auth->id, 'is_read' => 0])->count('id');
|
|
|
+
|
|
|
+ $this->success('查询是否有未读消息', $count);
|
|
|
+ }
|
|
|
+
|
|
|
//消息列表
|
|
|
public function sysmsg() {
|
|
|
$list = Db::name('sys_msg')->field('id, title, content, createtime')->where(['user_id' => $this->auth->id])
|
|
@@ -1366,6 +1373,9 @@ class User extends Api
|
|
|
$v['createtime'] = date('Y-m-d H:i', $v['createtime']);
|
|
|
}
|
|
|
|
|
|
+ //更改消息状态
|
|
|
+ Db::name('sys_msg')->where(['user_id' => $this->auth->id, 'is_read' => 0])->setField('is_read', 1);
|
|
|
+
|
|
|
$this->success('消息列表', $list);
|
|
|
}
|
|
|
|