コード例 #1
0
 public function applyCompanySubmitAction()
 {
     if ($this->request->isPost()) {
         $user_id = $this->request->getPost('user_id');
         //图片上传
         $img_list = array();
         $project_log = array();
         list($img_list, $project_log) = $this->_upload_img();
         $params = array();
         $ubm = new DtbUserBasic();
         $uiom = new DtbInvestorOrgaization();
         $ilm = new DtbInvestLeaderCases();
         $user_data = $ubm->get($user_id);
         if (!$user_data || $user_data->getAccountType() > 0) {
             die('value is invaild');
         }
         $legal_name = $this->request->getPost('legal_name');
         $legal_identity_card = $this->request->getPost('legal_identity_card');
         //            $legal_idc_img1 = $this->request->getPost('legal_idc_img1');
         //            $legal_idc_img2 = $this->request->getPost('legal_idc_img2');
         $legal_idc_img1 = isset($img_list['legal_idc_img1']) ? $img_list['legal_idc_img1'] : '';
         $legal_idc_img2 = isset($img_list['legal_idc_img2']) ? $img_list['legal_idc_img2'] : '';
         $contact_name = $this->request->getPost('contact_name');
         $prov = $this->request->getPost('prov');
         $city = $this->request->getPost('city');
         $dist = $this->request->getPost('dist');
         $address = $this->request->getPost('address');
         $business_licence = $this->request->getPost('business_licence');
         // $bul_img = $this->request->getPost('bul_img');
         $bul_img = isset($img_list['bul_img']) ? $img_list['bul_img'] : '';
         $company = $this->request->getPost('company');
         $gold_fund = $this->request->getPost('gold_fund');
         $singel_invest_range_start = $this->request->getPost('singel_invest_range_start');
         $singel_invest_range_end = $this->request->getPost('singel_invest_range_end');
         $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_company_info = $uiom->getDataByUserId($user_id);
         if ($invest_company_info) {
             die('用户已存在');
         } else {
             $params = array('legal_name' => $legal_name, 'legal_identity_card' => $legal_identity_card, 'legal_idc_img1' => $legal_idc_img1, 'legal_idc_img2' => $legal_idc_img1, 'contact_name' => $contact_name, 'country' => 'china', 'province' => $prov, 'city' => $city, 'dist' => $dist, 'address' => $address, 'business_licence' => $business_licence, 'bul_img' => $bul_img, 'gold_fund' => $gold_fund, 'company' => $company, 'singel_invest_range' => json_encode(array($singel_invest_range_start, $singel_invest_range_end)), 'attention_direct' => $attention_direct, 'invest_idea' => $invest_idea, 'available_extra_price' => $available_extra_price);
             $res = $uiom->applyCompany($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;
 }