worked on the new onboarding steps
This commit is contained in:
45
app/Http/Controllers/ReportsController.php
Normal file
45
app/Http/Controllers/ReportsController.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use App\Models;
|
||||
use Session;
|
||||
use Illuminate\Support\Arr;
|
||||
use App\Jobs\SendNewUssdClientEmail;
|
||||
use App\Jobs\SendUssdClientActiveEmail;
|
||||
use App\Jobs\SendNewNotesEmailAlert;
|
||||
use App\Http\Requests;
|
||||
use Carbon\Carbon;
|
||||
|
||||
|
||||
|
||||
class ReportsController extends Controller
|
||||
{
|
||||
public function getRecentClients(){
|
||||
$data = [
|
||||
'page_title' => 'Recent Clients',
|
||||
'current_user' => session('current_user')
|
||||
];
|
||||
return view('reports.recent_clients', $data);
|
||||
|
||||
}
|
||||
public function getRecentClientsJson(){
|
||||
// $clients = Models\Client::where()->get();
|
||||
/*
|
||||
$clients = \DB::table('clients')
|
||||
->whereRaw('week(created_at) = WEEK(NOW())')
|
||||
->with('auth_user_info')
|
||||
->get();
|
||||
*/
|
||||
$clients = \DB::table('clients')
|
||||
->join('auth_users AS aumngr', 'aumngr.id', '=', 'clients.auth_user_id')
|
||||
->select('clients.id','clients.name', 'clients.status', 'clients.country', 'aumngr.name As accountMgr', 'clients.created_at')
|
||||
->whereRaw("week(clients.created_at) = WEEK(NOW())")
|
||||
->orderBy('name', 'ASC')->paginate(50);
|
||||
|
||||
return response()->json($clients);
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user