Completed
Push — master ( 1cdde8...6d8ac3 )
by Andrii
03:17
created

BillQuery   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 26
ccs 0
cts 16
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A initSelect() 0 23 1
1
<?php
2
3
namespace hiqdev\billing\hiapi\query;
4
5
class BillQuery extends \hiapi\query\Query
6
{
7
    public function initSelect()
8
    {
9
        return $this->select([
10
                'zb.obj_id as id',
11
                'zb.time',
12
                'zb.quantity    AS "quantity.quantity"',
13
                'zb.sum         AS "sum.amount"',
14
                'cu.name        AS "sum.currency"',
15
                'bt.name        AS "type.name"',
16
                'zc.obj_id      AS "customer.id"',
17
                'zc.login       AS "customer.login"',
18
                'zb.object_id   AS "target.id"',
19
                'oc.name        AS "target.type"',
20
            ])
21
            ->from('zbill           zb')
22
            ->leftJoin('zref        bt', 'bt.obj_id = zb.type_id')
23
            ->leftJoin('purse       zp', 'zp.obj_id = zb.purse_id')
24
            ->leftJoin('zclient     zc', 'zc.obj_id = zp.client_id')
25
            ->leftJoin('zref        cu', 'cu.obj_id = zp.currency_id')
26
            ->leftJoin('obj         zo', 'zo.obj_id = zb.object_id')
27
            ->leftJoin('zref        oc', 'oc.obj_id = zo.class_id')
28
        ;
29
    }
30
}
31