Mails + Upload
This commit is contained in:
parent
767e84e640
commit
a3bef8d1aa
19 changed files with 151 additions and 200 deletions
|
|
@ -143,7 +143,8 @@ class ReportController extends Controller
|
|||
})
|
||||
->orderColumn('id', 'id $1')
|
||||
->orderColumn('start_date', 'start_date $1')
|
||||
->orderColumn('start_date', 'start_date $1')
|
||||
->orderColumn('end_date', 'end_date $1')
|
||||
->orderColumn('booking_date', 'booking_date $1')
|
||||
->orderColumn('customer.fullName', 'customer.firstname $1')
|
||||
//->orderColumn('lead.status_id', 'lead.status_id $1')
|
||||
//->orderColumn('is_cleared', 'is_cleared $1')
|
||||
|
|
@ -153,9 +154,24 @@ class ReportController extends Controller
|
|||
|
||||
public function bookingsExport(){
|
||||
|
||||
$query = $this->prozessBookingSearch();
|
||||
$query->orderBy("id", 'ASC');
|
||||
|
||||
$query = $this->prozessBookingSearch();
|
||||
|
||||
$order = explode(",", Request::get('order'));
|
||||
$orderByNum = [
|
||||
0 => "id",
|
||||
2 => "merlin_order_number",
|
||||
3 => "price",
|
||||
4 => "price_total",
|
||||
7 => "start_date",
|
||||
8 => "end_date",
|
||||
9 => "booking_date",
|
||||
];
|
||||
if(isset($order[0])) {
|
||||
$column = isset($orderByNum[$order[0]]) ? $orderByNum[$order[0]] : "start_date";
|
||||
$direction = isset($order[1]) ? strtoupper($order[1]) : "ASC";
|
||||
$query->orderBy($column, $direction);
|
||||
}
|
||||
|
||||
$filename = "file-".date('Y-m-d-H-i-s');
|
||||
$exports = $query->get();
|
||||
|
|
@ -273,7 +289,9 @@ class ReportController extends Controller
|
|||
|
||||
private function prozessProvidersSearch(){
|
||||
|
||||
$query = ServiceProviderEntry::with('booking', 'service_provider', 'booking.customer')->select('service_provider_entry.*');
|
||||
$query = ServiceProviderEntry::with('booking', 'service_provider', 'booking.customer')->select('service_provider_entry.*')
|
||||
->join('booking', 'service_provider_entry.booking_id', '=', 'booking.id' );
|
||||
|
||||
if(Request::get('filter_is_cleared') != ""){
|
||||
$query->where('is_cleared', '=', Request::get('filter_is_cleared'));
|
||||
}
|
||||
|
|
@ -292,6 +310,7 @@ class ReportController extends Controller
|
|||
$q->where("start_date", '<=', $travel_date_to);
|
||||
});
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
|
|
@ -385,9 +404,23 @@ class ReportController extends Controller
|
|||
{
|
||||
$query = $this->prozessProvidersSearch();
|
||||
|
||||
$query->whereHas('booking', function ($q) {
|
||||
$q->orderBy("lead_id", 'ASC');
|
||||
});
|
||||
$order = explode(",", Request::get('order'));
|
||||
$orderByNum = [
|
||||
0 => "id",
|
||||
1 => "booking.id", //booking
|
||||
3 => "booking.merlin_order_number",//booking
|
||||
4 => "booking.price",//booking
|
||||
5 => "booking.price_total",//booking
|
||||
8 => "booking.start_date",//booking
|
||||
9 => "booking.end_date",//booking
|
||||
10 => "is_cleared",
|
||||
];
|
||||
|
||||
if(isset($order[0])){
|
||||
$column = isset($orderByNum[$order[0]]) ? $orderByNum[$order[0]] : "start_date";
|
||||
$direction = isset($order[1]) ? strtoupper($order[1]) : "ASC";
|
||||
$query->orderBy($column, $direction);;
|
||||
}
|
||||
|
||||
$filename = "file-".date('Y-m-d-H-i-s');
|
||||
$exports = $query->get();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue