mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
改进Model的延迟写入方法
This commit is contained in:
@@ -565,9 +565,7 @@ class Query
|
||||
// 延迟写入
|
||||
$guid = md5($this->getTable() . '_' . $field . '_' . serialize($condition));
|
||||
$step = $this->lazyWrite('inc', $guid, $step, $lazyTime);
|
||||
if (false === $step) {
|
||||
return true; // 等待下次写入
|
||||
}
|
||||
return false === $step ? true : $this->setField($field, $step);
|
||||
}
|
||||
return $this->setField($field, ['exp', $field . '+' . $step]);
|
||||
}
|
||||
@@ -592,10 +590,7 @@ class Query
|
||||
// 延迟写入
|
||||
$guid = md5($this->getTable() . '_' . $field . '_' . serialize($condition));
|
||||
$step = $this->lazyWrite('dec', $guid, $step, $lazyTime);
|
||||
if (false === $step) {
|
||||
return true; // 等待下次写入
|
||||
}
|
||||
$step = -$step;
|
||||
return false === $step ? true : $this->setField($field, $step);
|
||||
}
|
||||
return $this->setField($field, ['exp', $field . '-' . $step]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user