test fixes

This commit is contained in:
Dennis Eichhorn 2023-09-24 00:08:27 +00:00
parent 69e1527483
commit c6255aface

View File

@ -50,12 +50,20 @@ final class BackendController extends Controller
$view->setTemplate('/Modules/Exchange/Theme/Backend/exchange-log-list');
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1007001001, $request, $response);
$mapper = ExchangeLogMapper::getAll()
->with('exchange')
->with('createdBy')
->limit(50);
if ($request->getData('ptype') === 'p') {
$view->data['logs'] = ExchangeLogMapper::getAll()->where('id', $request->getDataInt('id') ?? 0, '<')->limit(25)->execute();
$view->data['logs'] = $mapper->where('id', $request->getDataInt('id') ?? 0, '<')
->execute();
} elseif ($request->getData('ptype') === 'n') {
$view->data['logs'] = ExchangeLogMapper::getAll()->where('id', $request->getDataInt('id') ?? 0, '>')->limit(25)->execute();
$view->data['logs'] = $mapper->where('id', $request->getDataInt('id') ?? 0, '>')
->execute();
} else {
$view->data['logs'] = ExchangeLogMapper::getAll()->where('id', 0, '>')->limit(25)->execute();
$view->data['logs'] = $mapper->where('id', 0, '>')
->execute();
}
return $view;