Merge branch 'dashboard-3' into 'master'

Omair salih dasherboared

See merge request CIEFWorldwideSdnBhd/izyim!12
This commit is contained in:
omair saleh
2019-03-21 03:19:49 +00:00
2 changed files with 6 additions and 3 deletions
@@ -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');