diff --git a/application/admin/command/Crud/stubs/mixins/modelinit.stub b/application/admin/command/Crud/stubs/mixins/modelinit.stub index 329fb95c503667b9246779ccb5791d1ce6548b92..7f1a9929664243ce6a49a95e17b922b1c3240145 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 5ef2ba5e889f0f6794951c7ceea58adfcd32814a..ee8fc7a4dabb1abd4e524b24a28fa13d0c09b33c 100755 --- a/application/index/view/index/index.html +++ b/application/index/view/index/index.html @@ -17,7 +17,9 @@