checkToken(); if ($token['code'] < 0) return $this->response($token); // 参数获取 $page = input('page', 1); $page_size = input('page_size', PAGE_LIST_ROWS); $message_type = input('message_type',0); // 获取内容 $field = [ 'a.id', 'a.is_see', 'a.order_id', 'a.created_time', 'mc.type', 'mc.message_title', 'mc.message_content', ]; // 条件生成 $condition = [ ['a.site_id','=',$this->site_id], ['a.member_id', '=', $this->member_id ], ]; if($message_type > 0) $condition[] = ['mc.type', '=', $message_type ]; // 表关联 $join = [ ['message_center mc', 'mc.id = a.message_center_id', 'left'], ]; $list = (new MessageRead())->getPageList($condition, $page, $page_size, 'a.created_time desc,a.id desc', $field, 'a', $join); return $this->response($list); } /** * Common: 消息查看 * Author: wu-hui * Time: 2023/03/04 16:31 */ public function see(){ $id = input('id',0); model('message_center_read')->update(['is_see'=>1], ['id'=>$id]); return $this->response($this->success()); } }