File tree 4 files changed +18
-4
lines changed 4 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,7 @@ protected function prepareDataFilter($requestParams)
113
113
protected function prepareParentQuery (ActiveQueryInterface $ query ):ActiveQueryInterface
114
114
{
115
115
$ userId = Yii::$ app ->user ->id ;
116
+ $ condition = [];
116
117
$ condition [$ this ->modelTable ().'. ' .$ this ->userIdAttribute ] = $ userId ;
117
118
$ query ->where ($ condition );
118
119
return $ query ;
Original file line number Diff line number Diff line change @@ -63,8 +63,12 @@ public function setPagination($value):void
63
63
if (!$ this ->_pagination instanceof JsonApiPaginator) {
64
64
throw new InvalidArgumentException ('Only JsonApiPaginator instance or false allowed ' );
65
65
}
66
+ $ this ->_pagination ->totalCount = $ this ->getTotalCount ();
66
67
} elseif ($ value instanceof JsonApiPaginator || $ value === false ) {
67
68
$ this ->_pagination = $ value ;
69
+ if ($ value instanceof JsonApiPaginator) {
70
+ $ this ->_pagination ->totalCount = $ this ->getTotalCount ();
71
+ }
68
72
} else {
69
73
throw new InvalidArgumentException ('Only JsonApiPaginator instance, configuration array or false is allowed. ' );
70
74
}
Original file line number Diff line number Diff line change 58
58
'validationErrorFormat ' => JsonApiErrorHandler::ERROR_FORMAT_SPEC
59
59
],
60
60
'log ' => [
61
- 'traceLevel ' => YII_DEBUG ? 3 : 0 ,
61
+ 'traceLevel ' => 3 ,
62
62
'targets ' => [
63
63
[
64
64
'class ' => yii \log \FileTarget::class,
65
- 'levels ' => ['error ' , 'warning ' ],
66
65
'logFile ' => '/tmp/yii2-fractal-test-error.log ' ,
67
66
'logVars ' => ['_GET ' , '_POST ' ]
68
67
],
127
126
],
128
127
],
129
128
],
130
- ];
129
+ ];
Original file line number Diff line number Diff line change 24
24
'password ' => 'dbpass ' ,
25
25
'charset ' => 'utf8 ' ,
26
26
],
27
+ 'log ' => [
28
+ 'traceLevel ' => 3 ,
29
+ 'targets ' => [
30
+ [
31
+ 'class ' => yii \log \FileTarget::class,
32
+ 'logFile ' => '/tmp/yii2-fractal-test-error.log ' ,
33
+ 'logVars ' => ['_GET ' , '_POST ' ]
34
+ ],
35
+ ],
36
+ ],
27
37
],
28
- ];
38
+ ];
You can’t perform that action at this time.
0 commit comments