userId = $this->userId == 102712? 100968 : $this->userId; $params['openid'] = Member::getField(['id'=> $this->userId],'openid'); // $params['send_at'] = date('Y-m-d',time() - 7*86400); $dataList = Message::getList($params, $pageSize); showJson(1005, 1001, $dataList); } /** * 详情 * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\ModelNotFoundException * @throws \think\exception\DbException */ public function getInfo() { $id = input('id'); $info = Message::getInfo(['id' => $id],'',true); showJson(1005, 1001, $info? $info:['id'=>0]); } /** * 未读数据 */ public function getCount() { $openid = Member::getField(['id'=> $this->userId],'openid'); $data = Message::where(['openid'=> $openid,'status'=>2,'is_read'=>2]) // ->where('send_at','>',date('Y-m-d',time() - 7*86400)) ->count(); showJson(1005, 1001, $data>99? '99+': $data); // showJson(1005, 1001, $data>99? '99+': $data); } } ?>