From aefd84d6d54e42466c432817844aa108ef4512e8 Mon Sep 17 00:00:00 2001 From: liugang Date: Thu, 14 Sep 2023 10:01:23 +0800 Subject: [PATCH] * testtask: refactor the ajaxGetUserTestTasks method. --- module/testtask/control.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/module/testtask/control.php b/module/testtask/control.php index ba30e74ee1..ec6feaf4c7 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -1420,11 +1420,14 @@ class testtask extends control * @access public * @return void */ - public function ajaxGetUserTestTasks($userID = '', $id = '', $status = 'all') + public function ajaxGetUserTestTasks(int $userID = 0, string $id = '', string $status = 'all') { - if($userID == '') $userID = $this->app->user->id; - $user = $this->loadModel('user')->getById($userID, 'id'); - $account = $user->account; + $account = $this->app->user->account; + if($userID) + { + $user = $this->loadModel('user')->getById($userID, 'id'); + $account = $user->account; + } $testTasks = $this->testtask->getUserTestTaskPairs($account, 0, $status);