改进Query类的find和select方法的默认值

This commit is contained in:
thinkphp
2016-06-21 10:58:19 +08:00
parent c4669f142d
commit 850376dfe7
3 changed files with 27 additions and 27 deletions

View File

@@ -44,7 +44,7 @@ class Merge extends Model
* @param bool $cache 是否缓存
* @return \think\Model
*/
public static function get($data = '', $with = [], $cache = false)
public static function get($data = null, $with = [], $cache = false)
{
$query = self::parseQuery($data, $with, $cache);
$query = self::attachQuery($query);
@@ -106,7 +106,7 @@ class Merge extends Model
* @param string $with 关联预查询
* @return array|false|string
*/
public static function all($data = [], $with = [], $cache = false)
public static function all($data = null, $with = [], $cache = false)
{
$query = self::parseQuery($data, $with, $cache);
$query = self::attachQuery($query);
@@ -193,7 +193,7 @@ class Merge extends Model
unset($data[$pk]);
}
}
// 处理模型数据
$data = $this->parseData($this->name, $this->data);
// 写入主表数据