Conditions | 3 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
32 | private function getListData(string $tableName, int $recordId, int $page, int $perPage) |
||
33 | { |
||
34 | if (empty($tableName) || empty($recordId)) { |
||
35 | throw new \InvalidArgumentException('Table name and record id should not be empty.'); |
||
36 | } |
||
37 | |||
38 | $list = Db::name('revision') |
||
39 | ->where('table_name', $tableName) |
||
40 | ->where('original_id', $recordId) |
||
41 | ->where('status', 1) |
||
42 | ->order('id', 'desc') |
||
43 | ->paginate([ |
||
44 | 'list_rows' => $perPage, |
||
45 | 'page' => $page |
||
46 | ])->toArray(); |
||
47 | |||
48 | return $list['data'] ?? $list['dataSource'] ?? []; |
||
49 | } |
||
51 |