| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041 |
- <?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;
- }
- } else {
- return redirect('/');
- }
- }
- }
|