Beispiel #1
1
 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);
 }
Beispiel #2
0
 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();
 }
Beispiel #3
0
 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();
 }
Beispiel #4
0
 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));
 }
Beispiel #5
0
 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);
 }
Beispiel #6
0
 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);
 }