Example #1
0
 public function applyPersonSubmitAction()
 {
     if ($this->request->isPost()) {
         //图片上传
         $img_list = array();
         $project_log = array();
         list($img_list, $project_log) = $this->_upload_img();
         $user_id = $this->request->getPost('user_id');
         $params = array();
         $ubm = new DtbUserBasic();
         $uipm = new DtbInvestorPerson();
         $ilm = new DtbInvestLeaderCases();
         $user_data = $ubm->get($user_id);
         if (!$user_data || $user_data->getAccountType() > 0) {
             die('value is invaild');
         }
         $real_name = $this->request->getPost('real_name');
         $identity_card = $this->request->getPost('identity_card');
         $prov = $this->request->getPost('prov');
         $city = $this->request->getPost('city');
         $dist = $this->request->getPost('dist');
         $address = $this->request->getPost('address');
         // $idc_img1 = $this->request->getPost('idc_img1');
         //$idc_img2 = $this->request->getPost('idc_img2');
         $idc_img1 = isset($img_list['idc_img1']) ? $img_list['idc_img1'] : '';
         $idc_img2 = isset($img_list['idc_img2']) ? $img_list['idc_img2'] : '';
         $income_y = $this->request->getPost('income_y');
         $company = $this->request->getPost('company');
         $position = $this->request->getPost('position');
         $person_fund = $this->request->getPost('person_fund');
         $singel_invest_range_start = $this->request->getPost('singel_invest_range_start');
         $singel_invest_range_end = $this->request->getPost('singel_invest_range_end');
         $invest_exp = $this->request->getPost('invest_exp');
         $attention_direct = $this->request->getPost('attention_direct');
         $invest_idea = $this->request->getPost('invest_idea');
         $available_extra_price = $this->request->getPost('available_extra_price');
         #案列
         $project_logo = $this->request->getPost('project_logo');
         $project_name = $this->request->getPost('project_name');
         $web_url = $this->request->getPost('web_url');
         $project_desc = $this->request->getPost('project_desc');
         $invest_person_info = $uipm->getDataByUserId($user_id);
         if ($invest_person_info) {
             die('用户已存在');
         } else {
             $params = array('real_name' => $real_name, 'identity_card' => $identity_card, 'idc_img1' => $idc_img1, 'idc_img2' => $idc_img2, 'country' => 'china', 'province' => $prov, 'city' => $city, 'dist' => $dist, 'address' => $address, 'income_y' => $income_y, 'company' => $company, 'position' => $position, 'person_fund' => $person_fund, 'singel_invest_range' => json_encode(array($singel_invest_range_start, $singel_invest_range_end)), 'person_fund' => $person_fund, 'invesrt_exp' => json_encode($invest_exp), 'attention_direct' => $attention_direct, 'invest_idea' => $invest_idea, 'available_extra_price' => $available_extra_price);
             $res = $uipm->applyPerson($user_id, $params);
             if ($res) {
                 if ($this->request->getPost('check_leader') == 1) {
                     //申请领头人
                     $project_name_list = $this->request->getPost('project_name');
                     $web_url_list = $this->request->getPost('web_url');
                     $project_desc_list = $this->request->getPost('project_desc');
                     $this->_add_leader_cases($user_id, $project_name_list, $web_url_list, $project_desc_list, $project_log);
                 }
                 $this->flash->success('认证成功');
                 return $this->response->redirect('/user/center');
                 return $this->dispatcher->forward(array('controller' => 'user', 'action' => 'center'));
             }
         }
         $check_value = true;
     }
 }