mirror of https://gitee.com/karson/fastadmin.git
Merge branch 'develop' of gitee.com:karson/fastadmin into develop
commit
feed46823f
|
|
@ -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 (!$row['{%order%}']) {
|
||||
$pk = $row->getPk();
|
||||
$row->getQuery()->where($pk, $row[$pk])->update(['{%order%}' => $row[$pk]]);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,8 +23,10 @@ class UserRule extends Model
|
|||
protected static function init()
|
||||
{
|
||||
self::afterInsert(function ($row) {
|
||||
$pk = $row->getPk();
|
||||
$row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
|
||||
if (!$row['weigh']) {
|
||||
$pk = $row->getPk();
|
||||
$row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,9 @@ class Category extends Model
|
|||
protected static function init()
|
||||
{
|
||||
self::afterInsert(function ($row) {
|
||||
$row->save(['weigh' => $row['id']]);
|
||||
if (!$row['weigh']) {
|
||||
$row->save(['weigh' => $row['id']]);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue