mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/izyim.git
synced 2026-08-25 15:33:58 +00:00
Merge branch 'dashboard-3' into 'master'
Omair salih dasherboared See merge request CIEFWorldwideSdnBhd/izyim!12
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
namespace App\Classes\Modules\ControllersLogic\Dashboard;
|
||||
|
||||
use App\Models\Package;
|
||||
use App\Models\Order;
|
||||
use App\Models\PackingList;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class CbmReportLogic
|
||||
@@ -20,8 +22,9 @@ class CbmReportLogic
|
||||
}
|
||||
|
||||
public function execute() {
|
||||
|
||||
$cbm = $this->repository->selectRaw('created_at, ((((width/100) * (length/100) * (height/100))) * quantity) as cbm')->whereYear('created_at', '=', Carbon::now()->year)->whereMonth('created_at', '=', Carbon::now()->month)->orderBy('created_at')->get();
|
||||
$excludedOrders = Order::where('company_id', 349)->pluck('id')->toArray();
|
||||
$excludedPackingLists = PackingList::whereIn('order_id', $excludedOrders)->pluck('id')->toArray();
|
||||
$cbm = $this->repository->selectRaw('created_at, ((((width/100) * (length/100) * (height/100))) * quantity) as cbm')->whereYear('created_at', '=', Carbon::now()->year)->whereMonth('created_at', '=', Carbon::now()->month)->whereNotIn('list_id', $excludedPackingLists)->orderBy('created_at')->get();
|
||||
|
||||
$cbmGroup = $cbm->groupBy(function ($item) {
|
||||
return Carbon::parse($item->created_at)->format('j');
|
||||
|
||||
@@ -22,7 +22,7 @@ class OrdersReportLogic
|
||||
public function execute() {
|
||||
|
||||
$Orders= $this->repository->whereYear('created_at', '=', Carbon::now()->year)
|
||||
->whereMonth('created_at', '=', Carbon::now()->month)->orderBy('created_at')->get();
|
||||
->whereMonth('created_at', '=', Carbon::now()->month)->where('company_id', '!=', 349)->orderBy('created_at')->get();
|
||||
|
||||
$group = $Orders->groupBy(function($item) {
|
||||
return Carbon::parse($item->created_at)->format('j');
|
||||
|
||||
Reference in New Issue
Block a user