* Finish task#8865.

This commit is contained in:
leiyong
2021-01-01 11:34:11 +08:00
parent de2769bc5f
commit 0c4afee4ee
9 changed files with 103 additions and 15 deletions
+21
View File
@@ -1175,4 +1175,25 @@ class testtask extends control
$this->view->productID = $productID;
$this->display();
}
/**
* AJAX: return test tasks of a user in html select.
*
* @param int $userID
* @param string $id
* @param string $status
* @access public
* @return void
*/
public function ajaxGetUserTestTasks($userID = '', $id = '', $status = 'all')
{
if($userID == '') $userID = $this->app->user->id;
$user = $this->loadModel('user')->getById($userID, 'id');
$account = $user->account;
$testTasks = $this->testtask->getUserTestTaskPairs($account, 0, $status);
if($id) die(html::select("testTasks[$id]", $testTasks, '', 'class="form-control"'));
die(html::select('testTask', $testTasks, '', 'class=form-control'));
}
}