groupBy('bzc_addr') ->selectRaw('num') ->selectRaw('bzc_addr') ->selectRaw('bzc_name') ->selectRaw('bzc_tel') ->selectRaw('bzc_cardid') ->selectRaw('SUM(total_money) as total_money') ->selectRaw('SUM(money_home_jchae) as money_home_jchae') ->selectRaw('SUM(money_home_tchae) as money_home_tchae') ->selectRaw('SUM(table_time) as table_time') ->selectRaw('SUM(sub_description) as sub_description') ->get(); $table[2] = Table_two::query() ->groupBy('bzc_addr') ->selectRaw('bzc_addr') ->selectRaw('num') ->selectRaw('bzc_name') ->selectRaw('bzc_tel') ->selectRaw('bzc_cardid') ->selectRaw('SUM(chaichuje) as chaichuje') ->selectRaw('SUM(sub_description) as sub_description') ->get(); $table[3] = Table_three::query() ->groupBy('bzc_addr') ->selectRaw('bzc_addr') ->selectRaw('num') ->selectRaw('bzc_name') ->selectRaw('bzc_tel') ->selectRaw('bzc_cardid') ->selectRaw('SUM(canbu) as canbu') ->selectRaw('SUM(linshibu) as linshibu') ->selectRaw('SUM(banqianbu) as banqianbu') ->selectRaw('SUM(total) as total') ->selectRaw('SUM(sub_description) as sub_description') ->get(); $table[4] = Table_four::query() ->groupBy('bzc_addr') ->selectRaw('bzc_addr') ->selectRaw('num') ->selectRaw('bzc_name') ->selectRaw('bzc_tel') ->selectRaw('bzc_cardid') ->selectRaw('SUM(quanj) as quanj') ->selectRaw('SUM(chaj) as chaj') ->selectRaw('SUM(tongj) as tongj') ->selectRaw('SUM(zongj) as zongj') ->selectRaw('SUM(table_time) as table_time') ->selectRaw('SUM(sub_description) as sub_description') ->get(); $table[5] = Table_five::query() ->groupBy('bzc_addr') ->selectRaw('bzc_addr') ->selectRaw('num') ->selectRaw('bzc_name') ->selectRaw('bzc_tel') ->selectRaw('bzc_cardid') ->selectRaw('SUM(yuqij) as yuqij') ->selectRaw('SUM(table_time) as table_time') ->selectRaw('SUM(sub_description) as sub_description') ->get(); $table[6] = Table_six::query() ->groupBy('bzc_addr') ->selectRaw('bzc_addr') ->selectRaw('num') ->selectRaw('bzc_name') ->selectRaw('bzc_tel') ->selectRaw('bzc_cardid') ->selectRaw('SUM(anzhi) as anzhi') ->selectRaw('SUM(banqian) as banqian') ->selectRaw('SUM(dibu) as dibu') ->selectRaw('SUM(other) as other') ->selectRaw('SUM(totalj) as total') ->selectRaw('SUM(table_time) as table_time') ->selectRaw('SUM(sub_description) as sub_description') ->get(); $table[7] = Table_seven::query() ->groupBy('bzc_addr') ->selectRaw('bzc_addr') ->selectRaw('num') ->selectRaw('bzc_name') ->selectRaw('bzc_tel') ->selectRaw('bzc_cardid') ->selectRaw('SUM(data1_1+data1_7) as youzheng_area') ->selectRaw('SUM(data1_3) as wuzheng_area') ->selectRaw('SUM(data24) as fangbu') ->selectRaw('SUM(data25) as zhuangxiu') ->selectRaw('SUM(data26) as tingyuan') ->selectRaw('SUM(data27) as tingchan') ->selectRaw('SUM(data39_13) as gouzhu') ->selectRaw('SUM(table_time) as table_time') ->selectRaw('SUM(data43) as chaiqian') ->selectRaw('SUM(sub_description) as sub_description') ->get(); $table[8] = Table_eight::query() ->groupBy('bzc_addr') ->selectRaw('bzc_addr') ->selectRaw('num') ->selectRaw('bzc_name') ->selectRaw('bzc_tel') ->selectRaw('bzc_cardid') ->selectRaw('SUM(data1_1+data1_7) as youzheng_area') ->selectRaw('SUM(data1_3) as wuzheng_area') ->selectRaw('SUM(data24) as fangbu') ->selectRaw('SUM(data26) as zhangxiu') ->selectRaw('SUM(data25) as tingyuan') ->selectRaw('SUM(data27) as tingchan') ->selectRaw('SUM(data39_13) as gouzhu') ->selectRaw('SUM(data43) as chaiqian') ->selectRaw('SUM(hours) as hours') ->selectRaw('SUM(data63) as huiqian_area') ->selectRaw('SUM(data50) as huiqian_home_area') ->selectRaw('SUM(data55) as huiqian_shang_area') ->selectRaw('SUM(data58 +data62 ) as huiqian') ->selectRaw('SUM(data59) as yingtui') ->selectRaw('SUM(data60) as yingjiao') ->selectRaw('SUM(table_time) as table_time') ->selectRaw('SUM(sub_description) as sub_description') ->get(); $table[9] = Table_nine::query() ->groupBy('bzc_addr') ->selectRaw('bzc_addr') ->selectRaw('num') ->selectRaw('bzc_name') ->selectRaw('bzc_tel') ->selectRaw('bzc_cardid') ->selectRaw('SUM(data25) as fangbu') ->selectRaw('SUM(data26) as kongyuan') ->selectRaw('SUM(data27) as tingye') ->selectRaw('SUM(data27_6) as other') ->selectRaw('SUM(data40_5) as gouzhu') ->selectRaw('SUM(data44) as chaiqian') ->selectRaw('SUM(table_time) as table_time') ->selectRaw('SUM(sub_description) as sub_description') ->get(); return view('admin.print.print_all',compact('table','th','th1','th2','table_name','user_data')); } if(!$table = Tablelist::find($id)) return back()->withErrors('网络错误!'); $type = $table->table_id; $child_id = $table->child_table_id; switch($type){ case 1: if(!$table = Table_one::find($child_id)) return back()->withErrors('可能非法数据库改动造成的数据丢失!'); return view('admin.print.table_4_one',compact('table')); break; case 2: if(!$table = Table_two::find($child_id)) return back()->withErrors('可能非法数据库改动造成的数据丢失!'); return view('admin.print.table_7_two',compact('table')); break; case 3: if(!$table = Table_three::find($child_id)) return back()->withErrors('可能非法数据库改动造成的数据丢失!'); return view('admin.print.table_8_three',compact('table')); break; case 4: if(!$table = Table_four::find($child_id)) return back()->withErrors('可能非法数据库改动造成的数据丢失!'); return view('admin.print.table_6_four',compact('table')); break; case 5: if(!$table = Table_five::find($child_id)) return back()->withErrors('可能非法数据库改动造成的数据丢失!'); return view('admin.print.table_9_five',compact('table')); break; case 6: if(!$table = Table_six::find($child_id)) return back()->withErrors('可能非法数据库改动造成的数据丢失!'); return view('admin.print.table_5_six',compact('table')); break; case 7: if(!$table = Table_seven::find($child_id)) return back()->withErrors('可能非法数据库改动造成的数据丢失!'); return view('admin.print.table_3_seven',compact('table')); break; case 8: if(!$table = Table_eight::find($child_id)) return back()->withErrors('可能非法数据库改动造成的数据丢失!'); $table['jsons'] = json_decode($table->json); return view('admin.print.table_1_eight',compact('table')); break; case 9: if(!$table = Table_nine::find($child_id)) return back()->withErrors('可能非法数据库改动造成的数据丢失!'); return view('admin.print.table_2_nine',compact('table')); break; } } }