コード例 #1
0
 /**
  * 获取约谈记录详情
  */
 public function interViewShow()
 {
     $interview_id = $this->request->get('id');
     $interview = Interview::select('id', 'investor_id', 'interview_date', 'interview_time', 'interview_address', 'interview_desc')->find($interview_id);
     if (is_null($interview)) {
         return return_rest('0', array('interview' => array()), '该记录不存在');
     }
     $interview = $interview->toArray();
     //获取投资人信息
     $interview['investor'] = Customer::select('id', 'name', 'user_name', 'avatar', 'brief')->find($interview['investor_id']);
     //获取投资人投资领域
     $interview['investor']['invest_field'] = DB::table('customer_invest_field')->select('invest_field_name as name')->where('customer_id', $interview['investor_id'])->get();
     //获取投资人拓展信息
     $interview_extend = Customer\CustomerInvestor::select('currency', 'amount', 'finance_round')->where('customer_id', $interview['investor_id'])->first();
     $interview['investor']['finance_round'] = $this->financeName($interview_extend->finance_round);
     $interview['investor']['currency'] = $interview_extend->currency;
     $interview['investor']['amount'] = $interview_extend->amount;
     //获取该用户投资的项目
     $invest_projects = InvestProject::where('customer_id', $interview['investor_id'])->get();
     $interview['investor']['invest_project'] = array();
     if (($interview['investor']['invest_project_count'] = count($invest_projects)) > 0) {
         $invest_projects = $invest_projects->toArray();
         //获取用户投资的项目
         $i = 0;
         foreach ($invest_projects as $project) {
             $project_detail = CompanyProject::find($project['project_id']);
             $list[$i] = $project_detail->toArray();
             $i++;
         }
         $interview['investor']['invest_project'] = $list;
     }
     return return_rest('1', compact('interview'), '约谈详情');
 }