mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 07:02:47 +08:00
模型类的get方法第一个参数必须 如果传入null则返回null
This commit is contained in:
@@ -1294,11 +1294,15 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
|||||||
* @param mixed $data 主键值或者查询条件(闭包)
|
* @param mixed $data 主键值或者查询条件(闭包)
|
||||||
* @param array|string $with 关联预查询
|
* @param array|string $with 关联预查询
|
||||||
* @param bool $cache 是否缓存
|
* @param bool $cache 是否缓存
|
||||||
* @return static
|
* @return static|null
|
||||||
* @throws exception\DbException
|
* @throws exception\DbException
|
||||||
*/
|
*/
|
||||||
public static function get($data = null, $with = [], $cache = false)
|
public static function get($data, $with = [], $cache = false)
|
||||||
{
|
{
|
||||||
|
if (is_null($data)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
if (true === $with || is_int($with)) {
|
if (true === $with || is_int($with)) {
|
||||||
$cache = $with;
|
$cache = $with;
|
||||||
$with = [];
|
$with = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user