public function investorDetail() { $customer_id = $this->request->get('id'); //获取投资人信息 $investor = Customer::select('id', 'name', 'user_name', 'avatar', 'brief')->find($customer_id); //获取投资人投资领域 $investor['invest_field'] = DB::table('customer_invest_field')->select('invest_field_name as name')->where('customer_id', $customer_id)->get(); //获取投资人拓展信息 $interview_extend = Customer\CustomerInvestor::select('currency', 'amount', 'finance_round')->where('customer_id', $customer_id)->first(); $investor['finance_round'] = $this->financeName($interview_extend->finance_round); $investor['currency'] = $interview_extend->currency; $investor['amount'] = $interview_extend->amount; //获取该用户投资的项目 $invest_projects = InvestProject::where('customer_id', $customer_id)->get(); $investor['invest_project'] = array(); if (($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++; } $investor['invest_project'] = $list; } return return_rest('1', compact('investor'), '投资人详情'); }