Exemple #1
0
 /**
  * 
  * @return none
  */
 public function personal($id = NULL)
 {
     if ($this->get_method() != 'GET') {
         $this->send_response(405, NULL, '请求的方法不存在');
     }
     $data = $this->get_data();
     if (empty($id)) {
         $this->send_response(400, NULL, '401307:交易ID为空');
     }
     $id = (int) $id;
     $user_info = sns::getuser($id);
     if (!$user_info) {
         $this->send_response(400, NULL, '401311:用户不存在');
     }
     $stat = $this->model->stat($id);
     $deal_lists = $this->model->personal_lists($id, $this->user_id);
     $this->send_response(200, array('id' => (int) $id, 'name' => $user_info['realname'], 'avatar' => sns::getAvatar($id), 'deal_stat' => array('total' => (int) $stat['total'], 'success' => (int) $stat['success']), 'deal_lists' => $deal_lists, 'relationship' => 0, 'social_account' => array('sina_weibo' => '', 'qq_weibo' => '')));
 }