mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-08 23:52:49 +08:00
改进Query类的setInc和setDec方法
This commit is contained in:
@@ -565,7 +565,13 @@ class Query
|
|||||||
// 延迟写入
|
// 延迟写入
|
||||||
$guid = md5($this->getTable() . '_' . $field . '_' . serialize($condition));
|
$guid = md5($this->getTable() . '_' . $field . '_' . serialize($condition));
|
||||||
$step = $this->lazyWrite('inc', $guid, $step, $lazyTime);
|
$step = $this->lazyWrite('inc', $guid, $step, $lazyTime);
|
||||||
return false === $step ? true : $this->setField($field, $step);
|
if (false === $step) {
|
||||||
|
// 清空查询条件
|
||||||
|
$this->options = [];
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return $this->setField($field, $step);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return $this->setField($field, ['exp', $field . '+' . $step]);
|
return $this->setField($field, ['exp', $field . '+' . $step]);
|
||||||
}
|
}
|
||||||
@@ -590,7 +596,13 @@ class Query
|
|||||||
// 延迟写入
|
// 延迟写入
|
||||||
$guid = md5($this->getTable() . '_' . $field . '_' . serialize($condition));
|
$guid = md5($this->getTable() . '_' . $field . '_' . serialize($condition));
|
||||||
$step = $this->lazyWrite('dec', $guid, $step, $lazyTime);
|
$step = $this->lazyWrite('dec', $guid, $step, $lazyTime);
|
||||||
return false === $step ? true : $this->setField($field, $step);
|
if (false === $step) {
|
||||||
|
// 清空查询条件
|
||||||
|
$this->options = [];
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return $this->setField($field, $step);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return $this->setField($field, ['exp', $field . '-' . $step]);
|
return $this->setField($field, ['exp', $field . '-' . $step]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user