Migracia a male opravy
- csrf ocharana, vypnutie pre /log - oprava loggovania pamate - pridanie vue skriptov
This commit is contained in:
29
app/Http/Controllers/DataController.php
Executable file
29
app/Http/Controllers/DataController.php
Executable file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\User;
|
||||
use Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class DataController extends Controller
|
||||
{
|
||||
/**
|
||||
* Show the profile for the given user.
|
||||
*
|
||||
* @param int $computer_id
|
||||
*/
|
||||
public function get($id=null)
|
||||
{
|
||||
$where = [];
|
||||
$computer_id = Request::input('computer_id');
|
||||
$from = Request::input('from');
|
||||
$to = Request::input('to');
|
||||
$where[] = ["computer_id", '=', $computer_id];
|
||||
if ($from) $where[] = ["created_at", '>=', $from];
|
||||
if ($to) $where[] = ["created_at", '<=', $to];
|
||||
$queries = DB::table('values')->where($where)->get();
|
||||
return response()->json($queries);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user