v.2.25
Small fix
This commit is contained in:
@@ -5,6 +5,7 @@ namespace App\Commands;
|
||||
use App\Component\Models\Dishes;
|
||||
use App\Component\Models\ExchangeActions;
|
||||
use App\Component\Models\ExchangeDeleted;
|
||||
use App\Component\Models\ExchangeItems;
|
||||
use App\Component\Models\ExchangeOrders;
|
||||
use App\Component\Models\ExchangeShifts;
|
||||
use App\Component\Models\Reasons;
|
||||
@@ -739,6 +740,36 @@ class GETDataReport extends HRCCommand implements HRCCommandInterface
|
||||
'deleted' => $deleted
|
||||
];
|
||||
}
|
||||
if ($input['type'] == 'abc') {
|
||||
if (isset($input['start_date']) && isset($input['end_date'])) {
|
||||
$end_date = date('Y-m-d H:i:s', strtotime($input['end_date']));
|
||||
$start_date = date('Y-m-d H:i:s', strtotime($input['start_date']));
|
||||
$orders_shifts = ExchangeOrders::where('opened', '>=', $start_date)
|
||||
->where('closed', '=<', $end_date)
|
||||
->where('is_deleted', 0)
|
||||
->where('is_returned', 0)
|
||||
->where('is_closed', 1)
|
||||
->groupBy('shift_id')
|
||||
->get();
|
||||
$orders = ExchangeOrders::where('opened', '>=', $start_date)
|
||||
->where('closed', '=<', $end_date)
|
||||
->where('is_deleted', 0)
|
||||
->where('is_returned', 0)
|
||||
->where('is_closed', 1)
|
||||
->get();
|
||||
$revenue = 0;
|
||||
foreach ($orders_shifts as $orders_shift) {
|
||||
$shift_revenue = ExchangeShifts::where('shift_id', $orders_shift['shift_id'])
|
||||
->first();
|
||||
$revenue += $shift_revenue['revenue'];
|
||||
}
|
||||
foreach ($orders as $order) {
|
||||
$order_items = ExchangeItems::where('order_code', $order['code'])
|
||||
->where('shift_id', $order['shift_id'])
|
||||
->get();
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return [
|
||||
'status' => 'success',
|
||||
|
||||
Reference in New Issue
Block a user