mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
改进Model类的save方法对sequence的支持
This commit is contained in:
@@ -933,6 +933,11 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
|||||||
*/
|
*/
|
||||||
public function save($data = [], $where = [], $sequence = null)
|
public function save($data = [], $where = [], $sequence = null)
|
||||||
{
|
{
|
||||||
|
if (is_string($data)) {
|
||||||
|
$sequence = $data;
|
||||||
|
$data = [];
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($data)) {
|
if (!empty($data)) {
|
||||||
// 数据自动验证
|
// 数据自动验证
|
||||||
if (!$this->validateData($data)) {
|
if (!$this->validateData($data)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user