From f0de0e0f04b0d3dcf79091fc69b68c469217fff9 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Sat, 5 Oct 2019 14:22:08 +0800 Subject: [PATCH] large commit --- app/Http/Resources/Company.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Resources/Company.php b/app/Http/Resources/Company.php index 0c56bf3..1137b47 100644 --- a/app/Http/Resources/Company.php +++ b/app/Http/Resources/Company.php @@ -19,7 +19,7 @@ class Company extends JsonResource */ public function toArray($request) { - $billing = $this->addressBook()->where('reference_id', $this->id)->where('type', 1) + $billing = $this->addressBook()->where('reference_id', $this->id)->where('type', 0) ->where('billing', true)->first(); $reports = \App\Models\Order::select(DB::raw('count(*) total'), DB::raw('SUM(CASE WHEN complete = 0 THEN 0 ELSE 1 END) active'))->where('company_id', $this->id)->first(); return [