1 | <?php |
||
24 | class Stats |
||
25 | { |
||
26 | |||
27 | /** |
||
28 | * Gets total count of orders |
||
29 | */ |
||
30 | public function total_orders() |
||
35 | |||
36 | /** |
||
37 | * Gets total count of cancelled orders |
||
38 | */ |
||
39 | public function total_cancelled_orders() |
||
43 | |||
44 | /** |
||
45 | * Gets total count of pending orders |
||
46 | */ |
||
47 | public function total_pending_orders() |
||
51 | |||
52 | /** |
||
53 | * Gets total sum of pending orders |
||
54 | duplicate |
||
55 | |||
56 | public function sum_of_pending_amount() |
||
57 | { |
||
58 | |||
59 | return Invoice::where('status', 'pending')->sum('amount'); |
||
60 | } |
||
61 | */ |
||
62 | |||
63 | public function total_completed_orders() |
||
67 | |||
68 | |||
69 | public function paid_payments(){ |
||
74 | |||
75 | /** |
||
76 | * Gets total count of orders today |
||
77 | */ |
||
78 | |||
79 | public function total_orders_today() |
||
83 | |||
84 | |||
85 | /** |
||
86 | * Gets total count of orders on a particular day |
||
87 | */ |
||
88 | public function total_orders_on_date($date) |
||
92 | |||
93 | /** |
||
94 | * Gets total count of orders on this month |
||
95 | */ |
||
96 | |||
97 | public function total_orders_this_month() |
||
101 | |||
102 | |||
103 | /** |
||
104 | * Gets total count of orders on a particular month and year |
||
105 | */ |
||
106 | public function total_orders_on_month($month, $year) |
||
110 | |||
111 | |||
112 | /** |
||
113 | * Gets total count of orders on given year |
||
114 | */ |
||
115 | public function total_orders_on_year($year) |
||
119 | |||
120 | |||
121 | /** |
||
122 | * Gets total count of invoices |
||
123 | */ |
||
124 | public function total_invoices() |
||
128 | |||
129 | |||
130 | /** |
||
131 | * Gets total count of invoices today |
||
132 | */ |
||
133 | |||
134 | public function total_invoices_today() |
||
138 | |||
139 | |||
140 | /** |
||
141 | * Gets total count of pending orders |
||
142 | */ |
||
143 | public function total_pending_invoices() |
||
147 | |||
148 | /** |
||
149 | * Gets total sum of pending orders |
||
150 | */ |
||
151 | public function sum_of_pending_invoice_amount() |
||
156 | |||
157 | |||
158 | |||
159 | |||
160 | /** |
||
161 | * Gets total count of pending invoices by status |
||
162 | */ |
||
163 | public function total_invoice_count_by_status($status) |
||
167 | |||
168 | |||
169 | |||
170 | |||
171 | /** |
||
172 | * Gets total sum of pending invoices by status |
||
173 | */ |
||
174 | public function sum_of_given_invoice_status_amount($status) |
||
179 | |||
180 | |||
181 | |||
182 | /** |
||
183 | * Gets total count of completed invoices |
||
184 | */ |
||
185 | public function total_completed_invoices() |
||
189 | |||
190 | /** |
||
191 | * Gets total sum of completed invoices |
||
192 | */ |
||
193 | public function sum_of_completed_invoice_amount() |
||
198 | } |
||
199 |