Fix performance issues
Signed-off-by: fly <merspieler@airmail.cc>
This commit is contained in:
parent
a15af89dd6
commit
7d7aee986a
1 changed files with 4 additions and 12 deletions
|
@ -129,20 +129,12 @@ if ($action == "set")
|
|||
quit();
|
||||
}
|
||||
}
|
||||
else if ($action == "get-job")
|
||||
else if ($action == "get-job" && isset($_POST["type"]) && $_POST["type"] != "")
|
||||
{
|
||||
get_lock($con);
|
||||
if (isset($_POST["additional-type"]) && $_POST["additional-type"] != "")
|
||||
{
|
||||
$sql = "SELECT id FROM tile WHERE status_id = (SELECT id FROM status WHERE name = 'pending') OR status_id = (SELECT id FROM status WHERE name = ?) ORDER BY parent_id LIMIT 1";
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bind_param("s", $_POST["additional-type"]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = "SELECT id FROM tile WHERE status_id = (SELECT id FROM status WHERE name = 'pending') ORDER BY parent_id LIMIT 1";
|
||||
$stmt = $con->prepare($sql);
|
||||
}
|
||||
$sql = "SELECT id FROM tile WHERE status_id = (SELECT id FROM status WHERE name = ?) ORDER BY parent_id LIMIT 1";
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bind_param("s", $_POST["type"]);
|
||||
$stmt->execute();
|
||||
$result = $stmt->get_result();
|
||||
$stmt->close();
|
||||
|
|
Loading…
Reference in a new issue