function getMyList() { $this->load->model('muser'); $this->muser->check() or noRights(); $res = $this->db->where("id in (SELECT yid FROM yue_people WHERE uid=" . UID . ")", null, FALSE)->select("id,uid,(SELECT name FROM user WHERE user.id=uid) authorName,(SELECT avatar FROM user WHERE user.id=uid) authorAvatar,title,time")->get('yue')->result_array(); ajax(0, '', $res); }
function feedback() { $this->load->model('muser'); $this->muser->check() or noRights(); $data = $this->input->post('content', TRUE) or errInput(); $this->db->insert('feedback', ['content' => $data, 'uid' => UID]) ? ajax() : busy(); }
function comment() { $this->load->model('muser'); $this->muser->check() or noRights(); $data = $this->input->post(['bid', 'content'], TRUE) or errInput(); $bbs = ['time' => time(), 'reply' => 'reply+1']; $this->db->where('id', $data['bid'])->set($bbs, '', FALSE)->update('bbs') or ajax(4001, '帖子不存在'); $data['time'] = $bbs['time']; $data['uid'] = UID; $this->db->insert('bcomment', $data) ? ajax() : busy(); }
function getListFriend() { $this->load->model('muser', 'user'); if (!$this->user->check()) { noRights(); } $input = ['type' => 1, 'page' => $this->input->post('page', FALSE, 0), 'count' => $this->input->post('count', FALSE, 20)]; ajax(0, '', $this->m->getList($input)); }
function myFans() { if (!$this->m->check()) { noRights(); } $id = $this->input->post('id'); $id = $id ? (int) $id : UID; $res = $this->db->where("id in (SELECT fromid FROM attention WHERE toid={$id})", NULL, FALSE)->select('id,name,avatar,sign,fans,cared')->get('user')->result_array(); foreach ($res as $key => $value) { $res[$key]['relation'] = $this->db->where(['fromId' => UID, 'toId' => $value['id']])->get('attention')->num_rows() == 1; } ajax(0, '', $res); }
function myScoreList() { $this->load->model('muser', 'user'); if (!$this->user->check()) { noRights(); } $input = ['page' => $this->input->post('page', FALSE, 0), 'count' => $this->input->post('count', FALSE, 20)]; $this->load->model('mplace', 'm'); $data = $this->m->myScoreList($input); ajax(0, '', $data); }