コード例 #1
0
 public function paymentListInvestorDetail(Investment $invest)
 {
     $investment = Investment::where('id', '=', $invest->id)->first();
     //echo $investment;
     return view('investment/payment_list_investor_detail', compact('investment'));
 }
コード例 #2
0
 public function paymentListBusinessIssuerDetail(Business $busi)
 {
     $business = Business::where('id', '=', $busi->id)->first();
     //find total people of respective investors
     $no_of_investor = Investment::where('business_id', '=', $business->id)->where('agreement', '=', 'accept')->count();
     //find total of eligible offers from respective investors
     // $total_eligible_offers = DB::table('investments')
     // ->where('business_id','=',$business->id)
     // ->where('agreement','=','accept')
     // ->sum('amount_to_invest');
     //get the percentage funded and round up the value
     //$percentage_funded =  round($total_eligible_offers / $business->amount * 100);
     //find the minimum offer from investors
     //$minimum_offer = DB::table('investments')->where('business_id','=',$business->id)->where('agreement','=','accept')->min('amount_to_invest');
     //find the maximum offer from investors
     //$maximum_offer = DB::table('investments')->where('business_id','=',$business->id)->where('agreement','=','accept')->max('amount_to_invest');
     //find the lowest rate offer from investors
     //$lowest_rate_offer = DB::table('investments')->where('business_id','=',$business->id)->where('agreement','=','accept')->min('target_return_rate');
     //find the highest rate offer from investors
     //$highest_rate_offer = DB::table('investments')->where('business_id','=',$business->id)->where('agreement','=','accept')->max('target_return_rate');
     $investment = Investment::where('business_id', '=', $business->id)->where('agreement', '=', 'accept')->get();
     return view('business/payment_list_business_issuer_detail', compact('business', 'no_of_investor', 'investment'));
 }