| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094 |
- <?php
- namespace App\Http\Controllers\Admin;
- use App\Model\Adminuser;
- use App\Model\Project;
- use App\Model\Table_eight;
- use App\Model\Table_five;
- use App\Model\Table_four;
- use App\Model\Table_nine;
- use App\Model\Table_one;
- use App\Model\Table_seven;
- use App\Model\Table_six;
- use App\Model\Table_three;
- use App\Model\Table_two;
- use App\Model\Tablelist;
- use App\Http\Controllers\Admin\CommonController;
- use App\Model\User;
- use Illuminate\Support\Facades\DB;
- use Session;
- use Symfony\Component\HttpFoundation\Request;
- class SearchController extends CommonController
- {
- public function table_search(Request $request,$table_type_id)
- {
- $user_data = User::where('role','=','0')->get();
- $input = $request->all();
- if (isset($table_type_id)) {
- switch ($table_type_id) {
- case 1:
- $table_name = '国有土地房屋征收与补偿安置单(货币化安置)';
- $th = [
- '1' => '姓名',
- '2' => '购买存量房面积',
- '3' => '拆迁补偿总金额',
- '4' => '购买存量房总价格',
- '5' => '应交总差额',
- '6' => '应退总差额'
- ];
- //都不搜索 显示表单姓名
- if(empty($input['user_id']) && empty($input['project_id']))
- {
- $table = Table_one::query()
- ->where('status','>','1')
- ->groupBy('bzc_name')
- ->selectRaw('bzc_name')
- ->selectRaw('SUM(home_area+money_bus_area) as area')
- ->selectRaw('SUM(total_money) as total_money')
- ->selectRaw('SUM(money_home_price+money_bus_price) as price')
- ->selectRaw('SUM(money_home_jchae+money_bus_jchae) as jchae ')
- ->selectRaw('SUM(money_home_tchae+money_bus_tchae) as tchae')
- ;
- $table = $input['start_time'] != '' ? $table->where('created_at', '>', $input['start_time']) : $table;
- $table = $input['end_time'] != '' ? $table->where('created_at', '<', $input['end_time']) : $table;
- $table = $table->get();
- }
- //搜索录入人 显示收录人
- if(!empty($input['user_id'])&& empty($input['project_id']))
- {
- $table = Table_one::query()
- ->where('status','>','1')
- ->where('user_id','=',$input['user_id'])
- ->groupBy('id')
- ->selectRaw('user_id')
- ->selectRaw('SUM(home_area+money_bus_area) as area')
- ->selectRaw('SUM(total_money) as total_money')
- ->selectRaw('SUM(money_home_price+money_bus_price) as price')
- ->selectRaw('SUM(money_home_jchae+money_bus_jchae) as jchae ')
- ->selectRaw('SUM(money_home_tchae+money_bus_tchae) as tchae')
- ;
- $th[1] = '收录人';
- $table = $input['start_time'] != '' ? $table->where('created_at', '>', $input['start_time']) : $table;
- $table = $input['end_time'] != '' ? $table->where('created_at', '<', $input['end_time']) : $table;
- $table = $table->get();
- foreach($table as $value){
- $value['bzc_name'] = User::where('id','=',$value['user_id'])->first()->surname;
- }
- }
- //搜索项目 显示项目名
- if(!empty($input['project_id']) && empty($input['user_id'])){
- $table = Table_one::query()
- ->where('project_id','=',$input['project_id'])
- ->where('status','>','1')
- ->groupBy('id')
- ->selectRaw('project_id')
- ->selectRaw('SUM(home_area+money_bus_area) as area')
- ->selectRaw('SUM(total_money) as total_money')
- ->selectRaw('SUM(money_home_price+money_bus_price) as price')
- ->selectRaw('SUM(money_home_jchae+money_bus_jchae) as jchae ')
- ->selectRaw('SUM(money_home_tchae+money_bus_tchae) as tchae')
- ;
- $th[1] = '项目';
- $table = $input['start_time'] != '' ? $table->where('created_at', '>', $input['start_time']) : $table;
- $table = $input['end_time'] != '' ? $table->where('created_at', '<', $input['end_time']) : $table;
- $table = $table->get();
- foreach($table as $value){
- $value['bzc_name'] = Project::where('id','=',$value['project_id'])->first()->project_name;
- }
- }
- //搜索收录人 项目名 显示收录人
- if(!empty($input['project_id']) && !empty($input['user_id'])){
- $table = Table_one::query()
- ->where('status','>','1')
- ->where('user_id','=',$input['user_id'])
- ->where('project_id','=',$input['project_id'])
- ->groupBy('id')
- ->selectRaw('user_id')
- ->selectRaw('SUM(home_area+money_bus_area) as area')
- ->selectRaw('SUM(total_money) as total_money')
- ->selectRaw('SUM(money_home_price+money_bus_price) as price')
- ->selectRaw('SUM(money_home_jchae+money_bus_jchae) as jchae ')
- ->selectRaw('SUM(money_home_tchae+money_bus_tchae) as tchae')
- ;
- $th[1] = '收录人';
- $table = $input['start_time'] != '' ? $table->where('created_at', '>', $input['start_time']) : $table;
- $table = $input['end_time'] != '' ? $table->where('created_at', '<', $input['end_time']) : $table;
- $table = $table->get();
- foreach($table as $value){
- $value['bzc_name'] = User::where('id','=',$value['user_id'])->first()->surname;
- }
- }
- return view('admin.sta.sta_one', compact('user_data','table_name', 'table', 'th', 'table_type_id'));
- break;
- case 2:
- $table_name = '违章建筑自行拆除费用申领表';
- $th = [
- '1' => '姓名',
- '2' => '违章面积',
- '3' => '拆除金额',
- ];
- if(empty($input['user_id']) && empty($input['project_id'])){
- $table = Table_two::query()
- ->where('status','>','1')
- ->groupBy('bzc_name')
- ->selectRaw('bzc_name')
- ->selectRaw('SUM(bzc_area) as area')
- ->selectRaw('SUM(chaichuje)as money')
- ;
- $table = $input['start_time'] != '' ? $table->where('created_at', '>', $input['start_time']) : $table;
- $table = $input['end_time'] != '' ? $table->where('created_at', '<', $input['end_time']) : $table;
- $table = $table->get();
- }
- if(!empty($input['user_id'])&& empty($input['project_id'])){
- $table = Table_two::query()
- ->where('status','>','1')
- ->where('user_id','=',$input['user_id'])
- ->groupBy('id')
- ->selectRaw('user_id')
- ->selectRaw('SUM(bzc_area) as area')
- ->selectRaw('SUM(chaichuje)as money')
- ;
- $th[1] = '收录人';
- $table = $input['start_time'] != '' ? $table->where('created_at', '>', $input['start_time']) : $table;
- $table = $input['end_time'] != '' ? $table->where('created_at', '<', $input['end_time']) : $table;
- $table = $table->get();
- foreach($table as $value){
- $value['bzc_name'] = User::where('id','=',$value['user_id'])->first()->surname;
- }
- }
- if(!empty($input['project_id']) && empty($input['user_id'])){
- $table = Table_two::query()
- ->where('status','>','1')
- ->where('project_id','=',$input['project_id'])
- ->groupBy('id')
- ->selectRaw('project_id')
- ->selectRaw('SUM(bzc_area) as area')
- ->selectRaw('SUM(chaichuje)as money')
- ;
- $table = $input['start_time'] != '' ? $table->where('created_at', '>', $input['start_time']) : $table;
- $table = $input['end_time'] != '' ? $table->where('created_at', '<', $input['end_time']) : $table;
- $table = $table->get();
- foreach($table as $value){
- $value['bzc_name'] = Project::where('id','=',$value['project_id'])->first()->project_name;
- }
- }
- if(!empty($input['project_id']) && !empty($input['user_id'])){
- $table = Table_three::query()
- ->where('status','>','1')
- ->where('user_id','=',$input['user_id'])
- ->where('project_id','=',$input['project_id'])
- ->groupBy('id')
- ->selectRaw('user_id')
- ->selectRaw('SUM(bzc_area) as area')
- ->selectRaw('SUM(chaichuje)as money')
- ;
- $table = $input['start_time'] != '' ? $table->where('created_at', '>', $input['start_time']) : $table;
- $table = $input['end_time'] != '' ? $table->where('created_at', '<', $input['end_time']) : $table;
- $table = $table->get();
- foreach($table as $value){
- $value['bzc_name'] = User::where('id','=',$value['user_id'])->first()->surname;
- }
- }
- return view('admin.sta.sta_two', compact('table_type_id','user_data','table_name', 'table', 'th'));
- break;
- case 3:
- $table_name = '残疾人房征补贴审批确认单';
- $th = [
- '1' => '姓名',
- '2' => '残疾人补贴',
- '3' => '临时安置补贴 ',
- '4' => '搬迁补贴',
- '5' => '合计'
- ];
- if(empty($input['user_id']) && empty($input['project_id'])){
- $table = Table_three::query()
- ->where('status','>','1')
- ->groupBy('bzc_name')
- ->selectRaw('bzc_name')
- ->selectRaw('SUM(canbu) as canbu')
- ->selectRaw('SUM(linshibu)as linshibu')
- ->selectRaw('SUM(banqianbu) as banqianbu')
- ->selectRaw('SUM(total) as total')
- ;
- $table = $input['start_time'] != '' ? $table->where('created_at', '>', $input['start_time']) : $table;
- $table = $input['end_time'] != '' ? $table->where('created_at', '<', $input['end_time']) : $table;
- $table = $table->get();
- }
- if(!empty($input['user_id'])&& empty($input['project_id'])){
- $table = Table_three::query()
- ->where('status','>','1')
- ->where('user_id','=',$input['user_id'])
- ->groupBy('id')
- ->selectRaw('user_id')
- ->selectRaw('SUM(canbu) as canbu')
- ->selectRaw('SUM(linshibu)as linshibu')
- ->selectRaw('SUM(banqianbu) as banqianbu')
- ->selectRaw('SUM(total) as total')
- ;
- $th[1] = '收录人';
- $table = $input['start_time'] != '' ? $table->where('created_at', '>', $input['start_time']) : $table;
- $table = $input['end_time'] != '' ? $table->where('created_at', '<', $input['end_time']) : $table;
- $table = $table->get();
- foreach($table as $value){
- $value['bzc_name'] = User::where('id','=',$value['user_id'])->first()->surname;
- }
- }
- if(!empty($input['project_id']) && empty($input['user_id'])){
- $table = Table_three::query()
- ->where('status','>','1')
- ->where('project_id','=',$input['project_id'])
- ->groupBy('id')
- ->selectRaw('project_id')
- ->selectRaw('SUM(canbu) as canbu')
- ->selectRaw('SUM(linshibu)as linshibu')
- ->selectRaw('SUM(banqianbu) as banqianbu')
- ->selectRaw('SUM(total) as total')
- ;
- $th[1] = '项目';
- $table = $input['start_time'] != '' ? $table->where('created_at', '>', $input['start_time']) : $table;
- $table = $input['end_time'] != '' ? $table->where('created_at', '<', $input['end_time']) : $table;
- $table = $table->get();
- foreach($table as $value){
- $value['bzc_name'] = Project::where('id','=',$value['project_id'])->first()->project_name;
- }
- }
- if(!empty($input['project_id']) && !empty($input['user_id'])){
- $table = Table_three::query()
- ->where('status','>','1')
- ->where('project_id','=',$input['project_id'])
- ->where('user_id','=',$input['user_id'])
- ->groupBy('id')
- ->selectRaw('project_id')
- ->selectRaw('SUM(canbu) as canbu')
- ->selectRaw('SUM(linshibu)as linshibu')
- ->selectRaw('SUM(banqianbu) as banqianbu')
- ->selectRaw('SUM(total) as total')
- ;
- $th[1] = '收录人';
- $table = $input['start_time'] != '' ? $table->where('created_at', '>', $input['start_time']) : $table;
- $table = $input['end_time'] != '' ? $table->where('created_at', '<', $input['end_time']) : $table;
- $table = $table->get();
- foreach($table as $value){
- $value['bzc_name'] = User::where('id','=',$value['user_id'])->first()->surname;
- }
- }
- return view('admin.sta.sta_three', compact('table_type_id','user_data','user_data','table_name', 'table', 'th'));
- break;
- case 4:
- $table_name = '房屋征收提前搬迁奖励单';
- $th = [
- '1' => '姓名',
- '2' => '全额奖励',
- '3' => '差额奖励金',
- '4' => '同住奖励',
- '5' => '奖励总金额',
- ];
- if(empty($input['user_id']) && empty($input['project_id'])){
- $table = Table_four::query()
- ->where('status','>','1')
- ->groupBy('bzc_name')
- ->selectRaw('bzc_name')
- ->selectRaw('SUM(quanj) as quanj')
- ->selectRaw('SUM(chaj)as chaj')
- ->selectRaw('SUM(tongj) as tongj')
- ->selectRaw('SUM(zongj) as zongj')
- ;
- $table = $input['start_time'] != '' ? $table->where('created_at', '>', $input['start_time']) : $table;
- $table = $input['end_time'] != '' ? $table->where('created_at', '<', $input['end_time']) : $table;
- $table = $table->get();
- }
- if(!empty($input['user_id'])&& empty($input['project_id'])){
- $table = Table_four::query()
- ->where('status','>','1')
- ->where('user_id','=',$input['user_id'])
- ->groupBy('id')
- ->selectRaw('user_id')
- ->selectRaw('SUM(quanj) as quanj')
- ->selectRaw('SUM(chaj)as chaj')
- ->selectRaw('SUM(tongj) as tongj')
- ->selectRaw('SUM(zongj) as zongj')
- ;
- $th[1] = '收录人';
- $table = $input['start_time'] != '' ? $table->where('created_at', '>', $input['start_time']) : $table;
- $table = $input['end_time'] != '' ? $table->where('created_at', '<', $input['end_time']) : $table;
- $table = $table->get();
- foreach($table as $value){
- $value['bzc_name'] = User::where('id','=',$value['user_id'])->first()->surname;
- }
- }
- if(!empty($input['project_id']) && empty($input['user_id'])){
- $table = Table_four::query()
- ->where('status','>','1')
- ->where('project_id','=',$input['project_id'])
- ->groupBy('id')
- ->selectRaw('project_id')
- ->selectRaw('SUM(quanj) as quanj')
- ->selectRaw('SUM(chaj)as chaj')
- ->selectRaw('SUM(tongj) as tongj')
- ->selectRaw('SUM(zongj) as zongj')
- ;
- $th[1] = '项目';
- $table = $input['start_time'] != '' ? $table->where('created_at', '>', $input['start_time']) : $table;
- $table = $input['end_time'] != '' ? $table->where('created_at', '<', $input['end_time']) : $table;
- $table = $table->get();
- foreach($table as $value){
- $value['bzc_name'] = Project::where('id','=',$value['project_id'])->first()->project_name;
- }
- }
- if(!empty($input['project_id']) && !empty($input['user_id'])){
- $table = Table_four::query()
- ->where('status','>','1')
- ->where('project_id','=',$input['project_id'])
- ->where('user_id','=',$input['user_id'])
- ->groupBy('id')
- ->selectRaw('user_id')
- ->selectRaw('SUM(quanj) as quanj')
- ->selectRaw('SUM(chaj)as chaj')
- ->selectRaw('SUM(tongj) as tongj')
- ->selectRaw('SUM(zongj) as zongj')
- ;
- $th[1] = '收录人';
- $table = $input['start_time'] != '' ? $table->where('created_at', '>', $input['start_time']) : $table;
- $table = $input['end_time'] != '' ? $table->where('created_at', '<', $input['end_time']) : $table;
- $table = $table->get();
- foreach($table as $value){
- $value['bzc_name'] = User::where('id','=',$value['user_id'])->first()->surname;
- }
- }
- return view('admin.sta.sta_four', compact('table_type_id','user_data','table_name', 'table', 'th'));
- break;
- case 5:
- $table_name = '逾期过渡安置补助费发放单';
- $th = [
- '1' => '姓名',
- '2' => '逾期月数',
- '3' => '补助合计',
- '4' => '逾期补偿金',
- ];
- if(empty($input['user_id']) && empty($input['project_id'])){
- $table = Table_five::query()
- ->where('status','>','1')
- ->groupBy('bzc_name')
- ->selectRaw('bzc_name')
- ->selectRaw('SUM(yuqi_mothe1+yuqi_mothe2+yuqi_mothe3+yuqi_mothe4) as yuqi_mothe')
- ->selectRaw('SUM(total1+total2+total3+total4)as total')
- ->selectRaw('SUM(yuqij) as yuqij')
- ;
- $table = $input['start_time'] != '' ? $table->where('created_at', '>', $input['start_time']) : $table;
- $table = $input['end_time'] != '' ? $table->where('created_at', '<', $input['end_time']) : $table;
- $table = $table->get();
- }
- if(!empty($input['user_id'])&& empty($input['project_id'])){
- $table = Table_five::query()
- ->where('status','>','1')
- ->where('user_id','=',$input['user_id'])
- ->groupBy('id')
- ->selectRaw('user_id')
- ->selectRaw('SUM(yuqi_mothe1+yuqi_mothe2+yuqi_mothe3+yuqi_mothe4) as yuqi_mothe')
- ->selectRaw('SUM(total1+total2+total3+total4)as total')
- ->selectRaw('SUM(yuqij) as yuqij')
- ;
- $th = '收录人';
- $table = $input['start_time'] != '' ? $table->where('created_at', '>', $input['start_time']) : $table;
- $table = $input['end_time'] != '' ? $table->where('created_at', '<', $input['end_time']) : $table;
- $table = $table->get();
- foreach($table as $value){
- $value['bzc_name'] = User::where('id','=',$input['user_id'])->first()->surname;
- }
- }
- if(!empty($input['project_id']) && empty($input['user_id'])){
- $table = Table_five::query()
- ->where('status','>','1')
- ->where('project_id','=',$input['project_id'])
- ->groupBy('id')
- ->selectRaw('project_id')
- ->selectRaw('SUM(yuqi_mothe1+yuqi_mothe2+yuqi_mothe3+yuqi_mothe4) as yuqi_mothe')
- ->selectRaw('SUM(total1+total2+total3+total4)as total')
- ->selectRaw('SUM(yuqij) as yuqij')
- ;
- $th = '项目';
- $table = $input['start_time'] != '' ? $table->where('created_at', '>', $input['start_time']) : $table;
- $table = $input['end_time'] != '' ? $table->where('created_at', '<', $input['end_time']) : $table;
- $table = $table->get();
- foreach($table as $value){
- $value['bzc_name'] = Project::where('id','=',$input['project_id'])->first()->project_name;
- }
- }
- if(!empty($input['project_id']) && !empty($input['user_id'])){
- $table = Table_five::query()
- ->where('status','>','1')
- ->where('user_id','=',$input['user_id'])
- ->where('project_id','=',$input['project_id'])
- ->groupBy('id')
- ->selectRaw('user_id')
- ->selectRaw('SUM(yuqi_mothe1+yuqi_mothe2+yuqi_mothe3+yuqi_mothe4) as yuqi_mothe')
- ->selectRaw('SUM(total1+total2+total3+total4)as total')
- ->selectRaw('SUM(yuqij) as yuqij')
- ;
- $th = '收录人';
- $table = $input['start_time'] != '' ? $table->where('created_at', '>', $input['start_time']) : $table;
- $table = $input['end_time'] != '' ? $table->where('created_at', '<', $input['end_time']) : $table;
- $table = $table->get();
- foreach($table as $value){
- $value['bzc_name'] = User::where('id','=',$input['user_id'])->first()->surname;
- }
- }
- return view('admin.sta.sta_five', compact('table_type_id','user_data','table_name', 'table', 'th'));
- break;
- case 6:
- $table_name = '房屋征收安置补贴单';
- $th = [
- '1' => '姓名',
- '2' => '临时安置费',
- '3' => '搬迁费',
- '4' => '低保补贴',
- '5' => '其他',
- '6' => '补贴总金额',
- ];
- if(empty($input['user_id']) && empty($input['project_id'])){
- $table = Table_six::query()
- ->where('status','>','1')
- ->groupBy('bzc_name')
- ->selectRaw('bzc_name')
- ->selectRaw('SUM(anzhi) as anzhi')
- ->selectRaw('SUM(banqian)as banqian')
- ->selectRaw('SUM(dibu) as dibu')
- ->selectRaw('SUM(other) as other')
- ->selectRaw('SUM(totalj) as totalj')
- ;
- $table = $input['start_time'] != '' ? $table->where('created_at', '>', $input['start_time']) : $table;
- $table = $input['end_time'] != '' ? $table->where('created_at', '<', $input['end_time']) : $table;
- $table = $table->get();
- }
- if(!empty($input['user_id'])&& empty($input['project_id'])){
- $table = Table_six::query()
- ->where('status','>','1')
- ->where('user_id','=',$input['user_id'])
- ->groupBy('id')
- ->selectRaw('user_id')
- ->selectRaw('SUM(anzhi) as anzhi')
- ->selectRaw('SUM(banqian)as banqian')
- ->selectRaw('SUM(dibu) as dibu')
- ->selectRaw('SUM(other) as other')
- ->selectRaw('SUM(totalj) as totalj')
- ;
- $th[1] = '收录人';
- $table = $input['start_time'] != '' ? $table->where('created_at', '>', $input['start_time']) : $table;
- $table = $input['end_time'] != '' ? $table->where('created_at', '<', $input['end_time']) : $table;
- $table = $table->get();
- foreach($table as $value){
- $value['bzc_name'] = User::where('id','=',$input['user_id'])->first()->surname;
- }
- }
- if(!empty($input['project_id']) && empty($input['user_id'])){
- $table = Table_six::query()
- ->where('status','>','1')
- ->where('project_id','=',$input['project_id'])
- ->groupBy('id')
- ->selectRaw('project_id')
- ->selectRaw('SUM(anzhi) as anzhi')
- ->selectRaw('SUM(banqian)as banqian')
- ->selectRaw('SUM(dibu) as dibu')
- ->selectRaw('SUM(other) as other')
- ->selectRaw('SUM(totalj) as totalj')
- ;
- $th[1] = '项目';
- $table = $input['start_time'] != '' ? $table->where('created_at', '>', $input['start_time']) : $table;
- $table = $input['end_time'] != '' ? $table->where('created_at', '<', $input['end_time']) : $table;
- $table = $table->get();
- foreach($table as $value){
- $value['bzc_name'] = Project::where('id','=',$input['project_id'])->first()->project_name;
- }
- }
- if(!empty($input['project_id']) && !empty($input['user_id'])){
- $table = Table_six::query()
- ->where('status','>','1')
- ->where('project_id','=',$input['project_id'])
- ->where('user_id','=',$input['user_id'])
- ->groupBy('id')
- ->selectRaw('user_id')
- ->selectRaw('SUM(anzhi) as anzhi')
- ->selectRaw('SUM(banqian)as banqian')
- ->selectRaw('SUM(dibu) as dibu')
- ->selectRaw('SUM(other) as other')
- ->selectRaw('SUM(totalj) as totalj')
- ;
- $th[1] = '收录人';
- $table = $input['start_time'] != '' ? $table->where('created_at', '>', $input['start_time']) : $table;
- $table = $input['end_time'] != '' ? $table->where('created_at', '<', $input['end_time']) : $table;
- $table = $table->get();
- foreach($table as $value){
- $value['bzc_name'] = User::where('id','=',$input['user_id'])->first()->surname;
- }
- }
- return view('admin.sta.sta_six', compact('table_type_id','user_data','table_name', 'table', 'th'));
- break;
- case 7:
- $table_name = '核算单(货币化安置)';
- $th = [
- '1' => '姓名',
- '2' => '住宅有证面积可置换住宅面积',
- '3' => '住宅有证面积可置换商业面积',
- '4' => '住宅有证面积房务补偿',
- '5' => '无证面积可置换住宅面积',
- '6' => '无证面积可置换商业面积',
- '7' => '无证面积房务补偿',
- ];
- $th1 = [
- '1' => '姓名',
- '2' => '其中住改非可置换住宅面积',
- '3' => '其中住改非可置换商业面积',
- '4' => '其中住改非房务补偿',
- '5' => '商业有证面积可置换住宅面积',
- '6' => '商业有证面积可置换商业面积',
- '7' => '商业有证面积房务补偿',
- ];
- $th2 = [
- '1' => '姓名',
- '2' => '其他项可置换住宅面积',
- '3' => '其他项可置换商业面积',
- '4' => '其他项房务补偿',
- '5' => '可置换住宅面积小计',
- '6' => '可置换商业面积小计',
- '7' => '房务补偿小计',
- ];
- $th3 = [
- '1' => '姓名',
- '2' => '装修补偿额',
- '3' => '庭院补偿额',
- '4' => '停产停业损失补偿额',
- '5' => '构筑物及其他补偿金',
- '6' => '拆迁补偿总金额',
- ];
- if(empty($input['user_id']) && empty($input['project_id'])){
- $table = Table_seven::query()
- ->where('status','>','1')
- ->groupBy('bzc_name')
- ->selectRaw('bzc_name')
- ->selectRaw('SUM(bzc_area) as bzc_area')->selectRaw('SUM(data2)as data2')
- ->selectRaw('SUM(data3+data4) as data3')->selectRaw('SUM(data5) as data5')
- ->selectRaw('SUM(data6) as data6')->selectRaw('SUM(data7+data8) as data7')
- ->selectRaw('SUM(data9) as data9')->selectRaw('SUM(data10) as data10')
- ->selectRaw('SUM(data11+data12) as data11')->selectRaw('SUM(data13) as data13')
- ->selectRaw('SUM(data14) as data14')->selectRaw('SUM(data15+data16) as data15')
- ->selectRaw('SUM(data17) as data17')->selectRaw('SUM(data18) as data18')
- ->selectRaw('SUM(data19+data20) as data19')->selectRaw('SUM(data21) as data21')
- ->selectRaw('SUM(data22) as data22')->selectRaw('SUM(data23+data24) as data23')
- ->selectRaw('SUM(data25) as data25')->selectRaw('SUM(data26) as data26')
- ->selectRaw('SUM(data27) as data27')->selectRaw('SUM(data42) as data42')
- ->selectRaw('SUM(data43) as data43')
- ;
- $table = $input['start_time'] != '' ? $table->where('created_at', '>', $input['start_time']) : $table;
- $table = $input['end_time'] != '' ? $table->where('created_at', '<', $input['end_time']) : $table;
- $table = $table->get();
- }
- if(!empty($input['user_id'])&& empty($input['project_id'])){
- $table = Table_seven::query()
- ->where('status','>','1')
- ->where('user_id','=',$input['user_id'])
- ->groupBy('id')
- ->selectRaw('user_id')
- ->selectRaw('SUM(bzc_area) as bzc_area')->selectRaw('SUM(data2)as data2')
- ->selectRaw('SUM(data3+data4) as data3')->selectRaw('SUM(data5) as data5')
- ->selectRaw('SUM(data6) as data6')->selectRaw('SUM(data7+data8) as data7')
- ->selectRaw('SUM(data9) as data9')->selectRaw('SUM(data10) as data10')
- ->selectRaw('SUM(data11+data12) as data11')->selectRaw('SUM(data13) as data13')
- ->selectRaw('SUM(data14) as data14')->selectRaw('SUM(data15+data16) as data15')
- ->selectRaw('SUM(data17) as data17')->selectRaw('SUM(data18) as data18')
- ->selectRaw('SUM(data19+data20) as data19')->selectRaw('SUM(data21) as data21')
- ->selectRaw('SUM(data22) as data22')->selectRaw('SUM(data23+data24) as data23')
- ->selectRaw('SUM(data25) as data25')->selectRaw('SUM(data26) as data26')
- ->selectRaw('SUM(data27) as data27')->selectRaw('SUM(data42) as data42')
- ->selectRaw('SUM(data43) as data43')
- ;
- $th[1] = '收录人';
- $th1[1] = '收录人';
- $th2[1] = '收录人';
- $th3[1] = '收录人';
- $table = $input['start_time'] != '' ? $table->where('created_at', '>', $input['start_time']) : $table;
- $table = $input['end_time'] != '' ? $table->where('created_at', '<', $input['end_time']) : $table;
- $table = $table->get();
- foreach($table as $value){
- $value['bzc_name'] = User::where('id','=',$input['user_id'])->first()->surname;
- }
- }
- if(!empty($input['project_id']) && empty($input['user_id'])){
- $table = Table_seven::query()
- ->where('status','>','1')
- ->where('project_id','=',$input['project_id'])
- ->groupBy('id')
- ->selectRaw('project_id')
- ->selectRaw('SUM(bzc_area) as bzc_area')->selectRaw('SUM(data2)as data2')
- ->selectRaw('SUM(data3+data4) as data3')->selectRaw('SUM(data5) as data5')
- ->selectRaw('SUM(data6) as data6')->selectRaw('SUM(data7+data8) as data7')
- ->selectRaw('SUM(data9) as data9')->selectRaw('SUM(data10) as data10')
- ->selectRaw('SUM(data11+data12) as data11')->selectRaw('SUM(data13) as data13')
- ->selectRaw('SUM(data14) as data14')->selectRaw('SUM(data15+data16) as data15')
- ->selectRaw('SUM(data17) as data17')->selectRaw('SUM(data18) as data18')
- ->selectRaw('SUM(data19+data20) as data19')->selectRaw('SUM(data21) as data21')
- ->selectRaw('SUM(data22) as data22')->selectRaw('SUM(data23+data24) as data23')
- ->selectRaw('SUM(data25) as data25')->selectRaw('SUM(data26) as data26')
- ->selectRaw('SUM(data27) as data27')->selectRaw('SUM(data42) as data42')
- ->selectRaw('SUM(data43) as data43')
- ;
- $th[1] = '项目';
- $th1[1] = '项目';
- $th2[1] = '项目';
- $th3[1] = '项目';
- $table = $input['start_time'] != '' ? $table->where('created_at', '>', $input['start_time']) : $table;
- $table = $input['end_time'] != '' ? $table->where('created_at', '<', $input['end_time']) : $table;
- $table = $table->get();
- foreach($table as $value){
- $value['bzc_name'] = Project::where('id','=',$input['project_id'])->first()->project_name;
- }
- }
- if(!empty($input['project_id']) && !empty($input['user_id'])){
- $table = Table_seven::query()
- ->where('status','>','1')
- ->where('project_id','=',$input['project_id'])
- ->where('user_id','=',$input['user_id'])
- ->groupBy('id')
- ->selectRaw('user_id')
- ->selectRaw('SUM(bzc_area) as bzc_area')->selectRaw('SUM(data2)as data2')
- ->selectRaw('SUM(data3+data4) as data3')->selectRaw('SUM(data5) as data5')
- ->selectRaw('SUM(data6) as data6')->selectRaw('SUM(data7+data8) as data7')
- ->selectRaw('SUM(data9) as data9')->selectRaw('SUM(data10) as data10')
- ->selectRaw('SUM(data11+data12) as data11')->selectRaw('SUM(data13) as data13')
- ->selectRaw('SUM(data14) as data14')->selectRaw('SUM(data15+data16) as data15')
- ->selectRaw('SUM(data17) as data17')->selectRaw('SUM(data18) as data18')
- ->selectRaw('SUM(data19+data20) as data19')->selectRaw('SUM(data21) as data21')
- ->selectRaw('SUM(data22) as data22')->selectRaw('SUM(data23+data24) as data23')
- ->selectRaw('SUM(data25) as data25')->selectRaw('SUM(data26) as data26')
- ->selectRaw('SUM(data27) as data27')->selectRaw('SUM(data42) as data42')
- ->selectRaw('SUM(data43) as data43')
- ;
- $th[1] = '收录人';
- $th1[1] = '收录人';
- $th2[1] = '收录人';
- $th3[1] = '收录人';
- $table = $input['start_time'] != '' ? $table->where('created_at', '>', $input['start_time']) : $table;
- $table = $input['end_time'] != '' ? $table->where('created_at', '<', $input['end_time']) : $table;
- $table = $table->get();
- foreach($table as $value){
- $value['bzc_name'] = User::where('id','=',$input['user_id'])->first()->suranme;
- }
- }
- return view('admin.sta.sta_seven', compact('table_type_id','user_data','table_name', 'table', 'th', 'th1', 'th2', 'th3'));
- break;
- case 8:
- $table_name = '核算单(产权调换)';
- $th = [
- '1' => '姓名',
- '2' => '住宅有证面积可置换住宅面积',
- '3' => '住宅有证面积可置换商业面积',
- '4' => '住宅有证面积房务补偿',
- '5' => '无证面积可置换住宅面积',
- '6' => '无证面积可置换商业面积',
- '7' => '无证面积房务补偿',
- ];
- $th1 = [
- '1' => '姓名',
- '2' => '其中住改非可置换住宅面积',
- '3' => '其中住改非可置换商业面积',
- '4' => '其中住改非房务补偿',
- '5' => '商业有证面积可置换住宅面积',
- '6' => '商业有证面积可置换商业面积',
- '7' => '商业有证面积房务补偿',
- ];
- $th2 = [
- '1' => '姓名',
- '2' => '其他项可置换住宅面积',
- '3' => '其他项可置换商业面积',
- '4' => '其他项房务补偿',
- '5' => '可置换住宅面积小计',
- '6' => '可置换商业面积小计',
- '7' => '房务补偿小计',
- ];
- $th3 = [
- '1' => '姓名',
- '2' => '装修补偿额',
- '3' => '庭院补偿额',
- '4' => '停产停业损失补偿额',
- '5' => '构筑物及其他补偿金',
- '6' => '拆迁补偿总金额',
- ];
- $th4 = [
- '1' => '姓名',
- '2' => '住宅可调换面积',
- '3' => '住宅实际调换面积',
- '4' => '住宅大于可调换面积',
- '5' => '住宅可调换面积价格核算',
- '6' => '住宅大于可调换面积价格核算',
- '7' => '住宅调换房屋价格',
- ];
- $th5 = [
- '1' => '姓名',
- '2' => '商业可调换面积',
- '3' => '商业实际调换面积',
- '4' => '商业大于可调换面积',
- '5' => '商业可调换面积价格核算',
- '6' => '商业大于可调换面积价格核算',
- '7' => '商业调换房屋价格',
- '8' => '应退差额',
- '9' => '应缴差额',
- ];
- if(empty($input['user_id']) && empty($input['project_id'])){
- $table = Table_eight::query()
- ->where('status','>','1')
- ->groupBy('bzc_name')
- ->selectRaw('bzc_name')
- ->selectRaw('SUM(bzc_area) as bzc_area')->selectRaw('SUM(data2)as data2')
- ->selectRaw('SUM(data3+data4) as data3')->selectRaw('SUM(data5) as data5')
- ->selectRaw('SUM(data6) as data6')->selectRaw('SUM(data7+data8) as data7')
- ->selectRaw('SUM(data9) as data9')->selectRaw('SUM(data10) as data10')
- ->selectRaw('SUM(data11+data12) as data11')->selectRaw('SUM(data13) as data13')
- ->selectRaw('SUM(data14) as data14')->selectRaw('SUM(data15+data16) as data15')
- ->selectRaw('SUM(data17) as data17')->selectRaw('SUM(data18) as data18')
- ->selectRaw('SUM(data19+data20) as data19')->selectRaw('SUM(data21) as data21')
- ->selectRaw('SUM(data22) as data22')->selectRaw('SUM(data23+data24) as data23')
- ->selectRaw('SUM(data25) as data25')->selectRaw('SUM(data26) as data26')
- ->selectRaw('SUM(data27) as data27')->selectRaw('SUM(data42) as data42')
- ->selectRaw('SUM(data43) as data43')->selectRaw('SUM(home_area) as home_area')
- ->selectRaw('SUM(data50) as data50')->selectRaw('SUM(data51) as data51')
- ->selectRaw('SUM(data52) as data52')->selectRaw('SUM(data57) as data57')
- ->selectRaw('SUM(data58) as data58')->selectRaw('SUM(data53) as data53')
- ->selectRaw('SUM(data54) as data54')->selectRaw('SUM(data55) as data55')
- ->selectRaw('SUM(data56) as data56')->selectRaw('SUM(data61) as data61')
- ->selectRaw('SUM(data62) as data62')->selectRaw('SUM(data59) as data59')
- ->selectRaw('SUM(data60) as data60')
- ;
- $table = $input['start_time'] != '' ? $table->where('created_at', '>', $input['start_time']) : $table;
- $table = $input['end_time'] != '' ? $table->where('created_at', '<', $input['end_time']) : $table;
- $table = $table->get();
- }
- if(!empty($input['user_id'])&& empty($input['project_id'])){
- $table = Table_eight::query()
- ->where('status','>','1')
- ->where('user_id','=',$input['user_id'])
- ->groupBy('id')
- ->selectRaw('user_id')
- ->selectRaw('SUM(bzc_area) as bzc_area')->selectRaw('SUM(data2)as data2')
- ->selectRaw('SUM(data3+data4) as data3')->selectRaw('SUM(data5) as data5')
- ->selectRaw('SUM(data6) as data6')->selectRaw('SUM(data7+data8) as data7')
- ->selectRaw('SUM(data9) as data9')->selectRaw('SUM(data10) as data10')
- ->selectRaw('SUM(data11+data12) as data11')->selectRaw('SUM(data13) as data13')
- ->selectRaw('SUM(data14) as data14')->selectRaw('SUM(data15+data16) as data15')
- ->selectRaw('SUM(data17) as data17')->selectRaw('SUM(data18) as data18')
- ->selectRaw('SUM(data19+data20) as data19')->selectRaw('SUM(data21) as data21')
- ->selectRaw('SUM(data22) as data22')->selectRaw('SUM(data23+data24) as data23')
- ->selectRaw('SUM(data25) as data25')->selectRaw('SUM(data26) as data26')
- ->selectRaw('SUM(data27) as data27')->selectRaw('SUM(data42) as data42')
- ->selectRaw('SUM(data43) as data43')->selectRaw('SUM(home_area) as home_area')
- ->selectRaw('SUM(data50) as data50')->selectRaw('SUM(data51) as data51')
- ->selectRaw('SUM(data52) as data52')->selectRaw('SUM(data57) as data57')
- ->selectRaw('SUM(data58) as data58')->selectRaw('SUM(data53) as data53')
- ->selectRaw('SUM(data54) as data54')->selectRaw('SUM(data55) as data55')
- ->selectRaw('SUM(data56) as data56')->selectRaw('SUM(data61) as data61')
- ->selectRaw('SUM(data62) as data62')->selectRaw('SUM(data59) as data59')
- ->selectRaw('SUM(data60) as data60')
- ;
- $th[1] = '收录人';
- $th1[1] = '收录人';
- $th2[1] = '收录人';
- $th3[1] = '收录人';
- $th4[1] = '收录人';
- $th5[1] = '收录人';
- $table = $input['start_time'] != '' ? $table->where('created_at', '>', $input['start_time']) : $table;
- $table = $input['end_time'] != '' ? $table->where('created_at', '<', $input['end_time']) : $table;
- $table = $table->get();
- foreach($table as $value){
- $value['bzc_name'] = User::where('id','=',$input['user_id'])->first()->surname;
- }
- }
- if(!empty($input['project_id']) && empty($input['user_id'])){
- $table = Table_eight::query()
- ->where('status','>','1')
- ->where('project_id','=',$input['project_id'])
- ->groupBy('id')
- ->selectRaw('project_id')
- ->selectRaw('SUM(bzc_area) as bzc_area')->selectRaw('SUM(data2)as data2')
- ->selectRaw('SUM(data3+data4) as data3')->selectRaw('SUM(data5) as data5')
- ->selectRaw('SUM(data6) as data6')->selectRaw('SUM(data7+data8) as data7')
- ->selectRaw('SUM(data9) as data9')->selectRaw('SUM(data10) as data10')
- ->selectRaw('SUM(data11+data12) as data11')->selectRaw('SUM(data13) as data13')
- ->selectRaw('SUM(data14) as data14')->selectRaw('SUM(data15+data16) as data15')
- ->selectRaw('SUM(data17) as data17')->selectRaw('SUM(data18) as data18')
- ->selectRaw('SUM(data19+data20) as data19')->selectRaw('SUM(data21) as data21')
- ->selectRaw('SUM(data22) as data22')->selectRaw('SUM(data23+data24) as data23')
- ->selectRaw('SUM(data25) as data25')->selectRaw('SUM(data26) as data26')
- ->selectRaw('SUM(data27) as data27')->selectRaw('SUM(data42) as data42')
- ->selectRaw('SUM(data43) as data43')->selectRaw('SUM(home_area) as home_area')
- ->selectRaw('SUM(data50) as data50')->selectRaw('SUM(data51) as data51')
- ->selectRaw('SUM(data52) as data52')->selectRaw('SUM(data57) as data57')
- ->selectRaw('SUM(data58) as data58')->selectRaw('SUM(data53) as data53')
- ->selectRaw('SUM(data54) as data54')->selectRaw('SUM(data55) as data55')
- ->selectRaw('SUM(data56) as data56')->selectRaw('SUM(data61) as data61')
- ->selectRaw('SUM(data62) as data62')->selectRaw('SUM(data59) as data59')
- ->selectRaw('SUM(data60) as data60')
- ;
- $th[1] = '项目';
- $th1[1] = '项目';
- $th2[1] = '项目';
- $th3[1] = '项目';
- $th4[1] = '项目';
- $th5[1] = '项目';
- $table = $input['start_time'] != '' ? $table->where('created_at', '>', $input['start_time']) : $table;
- $table = $input['end_time'] != '' ? $table->where('created_at', '<', $input['end_time']) : $table;
- $table = $table->get();
- foreach($table as $value){
- $value['bzc_name'] = Project::where('id','=',$input['project_id'])->first()->project_name;
- }
- }
- if(!empty($input['project_id']) && !empty($input['user_id'])){
- $table = Table_eight::query()
- ->where('status','>','1')
- ->where('project_id','=',$input['project_id'])
- ->where('user_id','=',$input['user_id'])
- ->groupBy('id')
- ->selectRaw('user_id')
- ->selectRaw('SUM(bzc_area) as bzc_area')->selectRaw('SUM(data2)as data2')
- ->selectRaw('SUM(data3+data4) as data3')->selectRaw('SUM(data5) as data5')
- ->selectRaw('SUM(data6) as data6')->selectRaw('SUM(data7+data8) as data7')
- ->selectRaw('SUM(data9) as data9')->selectRaw('SUM(data10) as data10')
- ->selectRaw('SUM(data11+data12) as data11')->selectRaw('SUM(data13) as data13')
- ->selectRaw('SUM(data14) as data14')->selectRaw('SUM(data15+data16) as data15')
- ->selectRaw('SUM(data17) as data17')->selectRaw('SUM(data18) as data18')
- ->selectRaw('SUM(data19+data20) as data19')->selectRaw('SUM(data21) as data21')
- ->selectRaw('SUM(data22) as data22')->selectRaw('SUM(data23+data24) as data23')
- ->selectRaw('SUM(data25) as data25')->selectRaw('SUM(data26) as data26')
- ->selectRaw('SUM(data27) as data27')->selectRaw('SUM(data42) as data42')
- ->selectRaw('SUM(data43) as data43')->selectRaw('SUM(home_area) as home_area')
- ->selectRaw('SUM(data50) as data50')->selectRaw('SUM(data51) as data51')
- ->selectRaw('SUM(data52) as data52')->selectRaw('SUM(data57) as data57')
- ->selectRaw('SUM(data58) as data58')->selectRaw('SUM(data53) as data53')
- ->selectRaw('SUM(data54) as data54')->selectRaw('SUM(data55) as data55')
- ->selectRaw('SUM(data56) as data56')->selectRaw('SUM(data61) as data61')
- ->selectRaw('SUM(data62) as data62')->selectRaw('SUM(data59) as data59')
- ->selectRaw('SUM(data60) as data60')
- ;
- $th[1] = '收录人';
- $th1[1] = '收录人';
- $th2[1] = '收录人';
- $th3[1] = '收录人';
- $th4[1] = '收录人';
- $th5[1] = '收录人';
- $table = $input['start_time'] != '' ? $table->where('created_at', '>', $input['start_time']) : $table;
- $table = $input['end_time'] != '' ? $table->where('created_at', '<', $input['end_time']) : $table;
- $table = $table->get();
- foreach($table as $value){
- $value['bzc_name'] = User::where('id','=',$input['user_id'])->first()->surname;
- }
- }
- return view('admin.sta.sta_eight', compact('table_type_id','user_data','table_name', 'th', 'th1', 'th2', 'th3', 'th4', 'th5', 'table'));
- break;
- case 9:
- $table_name = '核算单(货币补偿)';
- $th = [
- '1' => '姓名',
- '2' => '房1房屋面积',
- '3' => '房2房屋面积',
- '4' => '房3房屋面积',
- '5' => '房4房屋面积',
- '6' => '房5房屋面积',
- '7' => '房6房屋面积',
- '8' => '合计',
- ];
- $th1 = [
- '1' => '姓名',
- '2' => '房1装修',
- '3' => '房2装修',
- '4' => '房3装修',
- '5' => '房4装修',
- '6' => '房5装修',
- '7' => '房6装修',
- '8' => '小计',
- ];
- $th2 = [
- '1' => '姓名',
- '2' => '空院补偿额',
- '3' => '停产停业损失补偿额',
- '4' => '房屋补偿总额',
- '5' => '构筑物及其他补偿金',
- '6' => '拆迁补偿总金额',
- ];
- if(empty($input['user_id']) && empty($input['project_id'])){
- $table = Table_nine::query()
- ->where('status','>','1')
- ->groupBy('bzc_name')
- ->selectRaw('bzc_name')
- ->selectRaw('SUM(data6) as data6')->selectRaw('SUM(data9)as data9')
- ->selectRaw('SUM(data12) as data12')->selectRaw('SUM(data15) as data15')
- ->selectRaw('SUM(data18) as data18')->selectRaw('SUM(data21) as data21')
- ->selectRaw('SUM(data24) as data24')->selectRaw('SUM(data7) as data7')
- ->selectRaw('SUM(data10) as data10')->selectRaw('SUM(data13) as data13')
- ->selectRaw('SUM(data16) as data16')->selectRaw('SUM(data19) as data19')
- ->selectRaw('SUM(data22) as data22')->selectRaw('SUM(data25) as data25')
- ->selectRaw('SUM(data26) as data26')->selectRaw('SUM(data27) as data27')
- ->selectRaw('SUM(data28) as data28')->selectRaw('SUM(data43) as data43')
- ->selectRaw('SUM(data44) as data44')
- ;
- $table = $input['start_time'] != '' ? $table->where('created_at', '>', $input['start_time']) : $table;
- $table = $input['end_time'] != '' ? $table->where('created_at', '<', $input['end_time']) : $table;
- $table = $table->get();
- }
- if(!empty($input['user_id'])&& empty($input['project_id'])){
- $table = Table_nine::query()
- ->where('status','>','1')
- ->where('user_id','=',$input['user_id'])
- ->groupBy('id')
- ->selectRaw('user_id')
- ->selectRaw('SUM(data6) as data6')->selectRaw('SUM(data9)as data9')
- ->selectRaw('SUM(data12) as data12')->selectRaw('SUM(data15) as data15')
- ->selectRaw('SUM(data18) as data18')->selectRaw('SUM(data21) as data21')
- ->selectRaw('SUM(data24) as data24')->selectRaw('SUM(data7) as data7')
- ->selectRaw('SUM(data10) as data10')->selectRaw('SUM(data13) as data13')
- ->selectRaw('SUM(data16) as data16')->selectRaw('SUM(data19) as data19')
- ->selectRaw('SUM(data22) as data22')->selectRaw('SUM(data25) as data25')
- ->selectRaw('SUM(data26) as data26')->selectRaw('SUM(data27) as data27')
- ->selectRaw('SUM(data28) as data28')->selectRaw('SUM(data43) as data43')
- ->selectRaw('SUM(data44) as data44')
- ;
- $th[1] = '收录人';
- $th1[1] = '收录人';
- $th2[1] = '收录人';
- $table = $input['start_time'] != '' ? $table->where('created_at', '>', $input['start_time']) : $table;
- $table = $input['end_time'] != '' ? $table->where('created_at', '<', $input['end_time']) : $table;
- $table = $table->get();
- foreach($table as $value){
- $value['bzc_name'] = User::where('id','=',$value['user_id'])->first()->surname;
- }
- }
- if(!empty($input['project_id']) && empty($input['user_id'])){
- $table = Table_nine::query()
- ->where('status','>','1')
- ->where('project_id','=',$input['project_id'])
- ->groupBy('id')
- ->selectRaw('project_id')
- ->selectRaw('SUM(data6) as data6')->selectRaw('SUM(data9)as data9')
- ->selectRaw('SUM(data12) as data12')->selectRaw('SUM(data15) as data15')
- ->selectRaw('SUM(data18) as data18')->selectRaw('SUM(data21) as data21')
- ->selectRaw('SUM(data24) as data24')->selectRaw('SUM(data7) as data7')
- ->selectRaw('SUM(data10) as data10')->selectRaw('SUM(data13) as data13')
- ->selectRaw('SUM(data16) as data16')->selectRaw('SUM(data19) as data19')
- ->selectRaw('SUM(data22) as data22')->selectRaw('SUM(data25) as data25')
- ->selectRaw('SUM(data26) as data26')->selectRaw('SUM(data27) as data27')
- ->selectRaw('SUM(data28) as data28')->selectRaw('SUM(data43) as data43')
- ->selectRaw('SUM(data44) as data44')
- ;
- $th[1] = '项目';
- $th1[1] = '项目';
- $th2[1] = '项目';
- $table = $input['start_time'] != '' ? $table->where('created_at', '>', $input['start_time']) : $table;
- $table = $input['end_time'] != '' ? $table->where('created_at', '<', $input['end_time']) : $table;
- $table = $table->get();
- foreach($table as $value){
- $value['bzc_name'] = Project::where('id','=',$value['project_id'])->first()->project_name;
- }
- }
- if(!empty($input['project_id']) && !empty($input['user_id'])){
- $table = Table_nine::query()
- ->where('status','>','1')
- ->where('project_id','=',$input['project_id'])
- ->where('user_id','=',$input['user_id'])
- ->groupBy('id')
- ->selectRaw('user_id')
- ->selectRaw('SUM(data6) as data6')->selectRaw('SUM(data9)as data9')
- ->selectRaw('SUM(data12) as data12')->selectRaw('SUM(data15) as data15')
- ->selectRaw('SUM(data18) as data18')->selectRaw('SUM(data21) as data21')
- ->selectRaw('SUM(data24) as data24')->selectRaw('SUM(data7) as data7')
- ->selectRaw('SUM(data10) as data10')->selectRaw('SUM(data13) as data13')
- ->selectRaw('SUM(data16) as data16')->selectRaw('SUM(data19) as data19')
- ->selectRaw('SUM(data22) as data22')->selectRaw('SUM(data25) as data25')
- ->selectRaw('SUM(data26) as data26')->selectRaw('SUM(data27) as data27')
- ->selectRaw('SUM(data28) as data28')->selectRaw('SUM(data43) as data43')
- ->selectRaw('SUM(data44) as data44')
- ;
- $th[1] = '收录人';
- $th1[1] = '收录人';
- $th2[1] = '收录人';
- $table = $input['start_time'] != '' ? $table->where('created_at', '>', $input['start_time']) : $table;
- $table = $input['end_time'] != '' ? $table->where('created_at', '<', $input['end_time']) : $table;
- $table = $table->get();
- foreach($table as $value){
- $value['bzc_name'] = User::where('id','=',$value['user_id'])->first()->surname;
- }
- }
- return view('admin.sta.sta_nine', compact('table_type_id','user_data','table_name', 'table', 'th', 'th1', 'th2'));
- break;
- case 0:
- $table_name = '成本审计汇总表';
- $th = [
- '合同编号',
- '姓名',
- '房栋号',
- '身份证',
- '联系电话',
- '有证面积',
- '无证面积',
- '房屋补偿金',
- '庭院面积',
- '庭院补偿',
- '装修',
- '构筑物及其他',
- '停产停业损失补偿(临街路补偿)',
- '临时安置',
- '搬迁',
- '低保',
- '全额奖励金',
- '整栋奖励',
- '违章自行拆除费',
- '残疾及其他',
- '补偿总额',
- '回迁套数',
- '回迁小区楼栋号',
- '回迁住宅面积',
- '回迁商铺面积',
- '回迁楼房金额',
- '应缴差价',
- '应退差价',
- '签约日期',
- '交房日期',
- '备注',
- ];
- $result = Tablelist::query();
- $data = $request->all();
- $result = $result->where('status', '>', '0');
- $result = $data['name'] != '' ? $result->where('bzc_name','like', '%'.$data['name'].'%') : $result;
- $result = $data['project_name'] != '' ? $result->where('project_name', $data['project_name']) : $result;
- $result = $data['start_time'] != '' ? $result->where('updated_at', '>', $data['start_time']) : $result;
- $result = $data['end_time'] != '' ? $result->where('updated_at', '<', $data['end_time']) : $result;
- return view('admin.sta.sta_all',compact('th','table_name','user_data','table'));
- break;
- }
- } else {
- return redirect('/');
- }
- }
- }
|