creato filtro per tag
This commit is contained in:
parent
3faeebc929
commit
03b0c5a27f
@ -338,6 +338,23 @@ class MovimentiController extends Controller
|
||||
return (new FastExcel($row))->download('report_al_'.date('d-m-Y').'.xls');
|
||||
}
|
||||
|
||||
public function filterByTag(Request $tag)
|
||||
{
|
||||
$mov=DB::table('movimentis')
|
||||
->where('mov_fk_tags','=',$tag['tag'])
|
||||
->join('categories','movimentis.mov_fk_categoria','=','categories.id')
|
||||
->join('tags','movimentis.mov_fk_tags','=','tags.id')
|
||||
->leftJoin('documentis', 'movimenti_id','=','movimentis.id')
|
||||
->select('movimentis.id','mov_data','mov_descrizione','mov_importo','cat_name','tag_name', DB::raw('Count(movimenti_id) as quanti'))
|
||||
->groupBy('movimentis.id','mov_data','mov_descrizione','mov_importo','cat_name','tag_name')
|
||||
->get();
|
||||
return view('conti.movimenti.list',
|
||||
[
|
||||
'movimenti'=> $mov,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
public function apiList()
|
||||
{
|
||||
$movments = DB::table('movimentis')
|
||||
|
@ -26,7 +26,7 @@
|
||||
<tbody>
|
||||
@foreach($tags as $tag)
|
||||
<tr>
|
||||
<td>{{ $tag->tag_name; }}</td>
|
||||
<td><a href="movimenti/filter/tags?tag={{ $tag->id }}">{{ $tag->tag_name; }}</a></td>
|
||||
<td>
|
||||
<a class="btn btn-primary" href="/admin/tagmodify?id={{ $tag->id; }}"><i class="fa fa-pencil-square-o fw"></i></a>
|
||||
<a class="btn btn-danger" href="/admin/tagdelete?id={{ $tag->id; }}"><i class="fa fa-trash-o fa-fw"></i></a>
|
||||
|
@ -56,6 +56,7 @@ Route::get('/', [MovimentiController::class,'dashboard']);
|
||||
|
||||
Route::get('lettureenel', [ContatoreEnElController::class,'listLettureEnel'])->name('enel');
|
||||
Route::post('lettureenel', [ContatoreEnElController::class,'insLettureEnel']);
|
||||
Route::get('movimenti/filter/tags',[MovimentiController::class,'filterByTag']);
|
||||
|
||||
Route::get('movimenti/report/movimenti_categoria', [MovimentiController::class,'listMovPerCateg']);
|
||||
Route::get('movimenti/report/movimentibycat', [MovimentiController::class,'listMovbyCat']);
|
||||
|
Loading…
Reference in New Issue
Block a user