File tree Expand file tree Collapse file tree 4 files changed +18
-4
lines changed Expand file tree Collapse file tree 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)
113113 protected function prepareParentQuery (ActiveQueryInterface $ query ):ActiveQueryInterface
114114 {
115115 $ userId = Yii::$ app ->user ->id ;
116+ $ condition = [];
116117 $ condition [$ this ->modelTable ().'. ' .$ this ->userIdAttribute ] = $ userId ;
117118 $ query ->where ($ condition );
118119 return $ query ;
Original file line number Diff line number Diff line change @@ -63,8 +63,12 @@ public function setPagination($value):void
6363 if (!$ this ->_pagination instanceof JsonApiPaginator) {
6464 throw new InvalidArgumentException ('Only JsonApiPaginator instance or false allowed ' );
6565 }
66+ $ this ->_pagination ->totalCount = $ this ->getTotalCount ();
6667 } elseif ($ value instanceof JsonApiPaginator || $ value === false ) {
6768 $ this ->_pagination = $ value ;
69+ if ($ value instanceof JsonApiPaginator) {
70+ $ this ->_pagination ->totalCount = $ this ->getTotalCount ();
71+ }
6872 } else {
6973 throw new InvalidArgumentException ('Only JsonApiPaginator instance, configuration array or false is allowed. ' );
7074 }
Original file line number Diff line number Diff line change 5858 'validationErrorFormat ' => JsonApiErrorHandler::ERROR_FORMAT_SPEC
5959 ],
6060 'log ' => [
61- 'traceLevel ' => YII_DEBUG ? 3 : 0 ,
61+ 'traceLevel ' => 3 ,
6262 'targets ' => [
6363 [
6464 'class ' => yii \log \FileTarget::class,
65- 'levels ' => ['error ' , 'warning ' ],
6665 'logFile ' => '/tmp/yii2-fractal-test-error.log ' ,
6766 'logVars ' => ['_GET ' , '_POST ' ]
6867 ],
127126 ],
128127 ],
129128 ],
130- ];
129+ ];
Original file line number Diff line number Diff line change 2424 'password ' => 'dbpass ' ,
2525 'charset ' => 'utf8 ' ,
2626 ],
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+ ],
2737 ],
28- ];
38+ ];
You can’t perform that action at this time.
0 commit comments