large commit

This commit is contained in:
Omair Saleh
2019-10-05 14:22:08 +08:00
parent e35e3ffec8
commit f0de0e0f04
+1 -1
View File
@@ -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 [