Completed
Push — main ( c27ac2...4966f7 )
by Aspirant
17s queued 11s
created

RevisionQuery::query()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 5
c 1
b 0
f 1
nc 1
nop 2
dl 0
loc 7
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace aspirantzhang\octopusRevision;
6
7
use think\facade\Db;
8
9
class RevisionQuery
10
{
11
    public function query(int $page = 1, $perPage = 5)
12
    {
13
        $list = Db::name('revision')->where('status', 1)->order('id', 'desc')->paginate([
14
            'list_rows' => $perPage,
15
            'page' => $page
16
        ])->toArray();
17
        return $list['data'] ?? [];
18
    }
19
}
20