diff --git a/application/admin/command/Crud/stubs/mixins/modelinit.stub b/application/admin/command/Crud/stubs/mixins/modelinit.stub index 329fb95c..7f1a9929 100644 --- a/application/admin/command/Crud/stubs/mixins/modelinit.stub +++ b/application/admin/command/Crud/stubs/mixins/modelinit.stub @@ -2,7 +2,9 @@ protected static function init() { self::afterInsert(function ($row) { - $pk = $row->getPk(); - $row->getQuery()->where($pk, $row[$pk])->update(['{%order%}' => $row[$pk]]); + if (!isset($row['{%order%}'])){ + $pk = $row->getPk(); + $row->getQuery()->where($pk, $row[$pk])->update(['{%order%}' => $row[$pk]]); + } }); } diff --git a/application/index/view/index/index.html b/application/index/view/index/index.html index 5ef2ba5e..ee8fc7a4 100755 --- a/application/index/view/index/index.html +++ b/application/index/view/index/index.html @@ -17,7 +17,9 @@