Query类的update和delete方法支持调用cache方法 会自动清除指定key的缓存 配合查询方法的cache方法一起使用 Model类的get方法第三个参数传入true的时候会自动更新缓存

This commit is contained in:
thinkphp
2016-08-17 11:17:03 +08:00
parent f3ff63268a
commit dfb92fa9dd
2 changed files with 7 additions and 3 deletions

View File

@@ -985,9 +985,6 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
*/
public static function get($data = null, $with = [], $cache = false)
{
if (!$cache && $data && is_scalar($data)) {
$cache = true;
}
$query = static::parseQuery($data, $with, $cache);
return $query->find($data);
}