Completed
Push — main ( 31a6ce...5c14c4 )
by Emmanuel
01:07
created

Queries::orders_orderby()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
/**
4
 * Author: Emmanuel Paul Mnzava
5
 * Twitter: @epmnzava
6
 * Github: https://github.com/dbrax/bill-me
7
 * Email: [email protected]
8
 * 
9
 */
10
11
namespace Epmnzava\BillMe;
12
13
use Epmnzava\BillMe\Models\Order;
14
use Epmnzava\BillMe\Models\Invoice;
15
use Epmnzava\BillMe\Models\OrderItem;
16
use Epmnzava\BillMe\Mail\Client\Invoices\InvoiceCreated;
17
use Epmnzava\BillMe\Mail\Client\OrderReceived;
18
use Epmnzava\BillMe\Mail\Merchant\NewOrder;
19
20
use Mail;
21
22
class Queries extends Stats
23
{
24
25
    public function orders()
26
    {
27
28
        return Order::all();
29
    }
30
31
32
    public function orders_orderby($orderby)
0 ignored issues
show
Unused Code introduced by
The parameter $orderby is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
33
    {
34
35
    }
36
37
38
39
    public function orders_today()
40
    {
41
        return Order::where('date',date('Y-m-d'))->get();
42
    }
43
44
    public function pending_orders()
45
    {
46
        return Order::where('status',"pending")->get();
47
48
    }
49
50
    public function cancelled_orders()
51
    {
52
        return Order::where('status',"cancelled")->get();
53
54
    }
55
56
    public function completed_orders()
57
    {
58
        return Order::where('status',"complete")->get();
59
60
    }
61
62
    public function getOrderById($orderid)
63
    {
64
        return Order::find($orderid);
65
    }
66
67
    public function getOrdersOnDate($date)
68
    {
69
        return Order::where('date',$date)->get();
70
71
    }
72
    
73
74
    public function getOrdersOnDateRange($startdate, $enddate)
0 ignored issues
show
Unused Code introduced by
The parameter $startdate is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $enddate is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
75
    {
76
    }
77
78
79
    public function getInvoiceById($invoiceid)
80
    {
81
        return Invoice::find($invoiceid);
82
83
    }
84
}
85