/**
  *    发件箱
  *
  *    @author    Hyber
  *    @return    void
  */
 function outbox()
 {
     $id = is_login();
     if (!$id) {
         $this->error('您还没有登陆', U('User/login'));
     }
     $modelmessage = new MessageModel();
     $newmessage = $modelmessage->where(" to_id= " . $id . " and new =1 ")->count();
     $this->assign('msgtype', '1');
     $this->assign('newmessage', $newmessage);
     $this->assign('messages', $this->_list_message('outbox', $id));
     $this->assign('_page', D('message')->page);
     //分页
     $this->display();
 }
 /**
  * 拒绝
  */
 public function refuse()
 {
     $investormod = M('project_investor');
     $id = I('request.id');
     $status = I('request.status');
     $mtype = I('request.mtype');
     $refuse_reason = I('request.refuse_reason');
     if (empty($id)) {
         $this->error('请选择要操作的数据');
     }
     $data['status'] = $status;
     $data['refuse_reason'] = $refuse_reason;
     $where = array_merge(array('id' => array('in', $id)), (array) $where);
     $msg = array_merge(array('success' => '操作成功!', 'error' => '操作失败!', 'url' => '', 'ajax' => IS_AJAX), (array) $msg);
     if ($investormod->where($where)->save($data) != false) {
         //获取投资信息
         $project_investor = $investormod->find($id);
         $project_id = $project_investor['project_id'];
         $investor_id = $project_investor['investor_id'];
         //获取项目名称
         $project = M('project')->find($project_id);
         $project_name = $project['project_name'];
         //发送消息
         $modelmessage = new MessageModel();
         if ($mtype == 'lintou') {
             $msg_content = '您领头的项目【' . $project_name . '】被拒绝;拒绝理由【' . $refuse_reason . '】';
         } else {
             $msg_content = '您询价的项目【' . $project_name . '】被拒绝;拒绝理由【' . $refuse_reason . '】';
         }
         $ret = $modelmessage->send(0, $investor_id, '', $msg_content, 3);
         $this->success('操作成功');
     } else {
         $this->error('操作失败');
     }
 }