public function group(){
$data=DB::table("manager")->get()->toArray();
$user=DB::table("receiver")->get()->toArray();
$assign=DB::table("assignments")->get()->toArray();
$orderMoney=0;
foreach($data as $k=>&$v){
$f=array();
foreach($user as $c=>$value) {
if ($v->id == $value->mid) {
$f[] = $value;
}
$v->user = $f;
$ass = array();
$num=0;
foreach ($assign as $a => $b) {
if($b->mid == $v->id){
$ass[]=$b;
$num=$num+$b->Actual_amount;
}
}
}
$v->countMoney=number_format($num,2);//分
$v->assignments=$ass;
$v->countUser=count($v->user);
$orderMoney=$orderMoney+$v->countMoney;//总
}
return view('team.group')->with("data",$data);
}