mirror of https://gitee.com/karson/fastadmin.git
Compare commits
No commits in common. "1a8f81cc354f61216b4ce12f49f75baf0e4763ed" and "de5c92e78a157760b0d5d29f6ce37636851dbd11" have entirely different histories.
1a8f81cc35
...
de5c92e78a
|
|
@ -2,9 +2,7 @@
|
||||||
protected static function init()
|
protected static function init()
|
||||||
{
|
{
|
||||||
self::afterInsert(function ($row) {
|
self::afterInsert(function ($row) {
|
||||||
if (!$row['{%order%}']) {
|
$pk = $row->getPk();
|
||||||
$pk = $row->getPk();
|
$row->getQuery()->where($pk, $row[$pk])->update(['{%order%}' => $row[$pk]]);
|
||||||
$row->getQuery()->where($pk, $row[$pk])->update(['{%order%}' => $row[$pk]]);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,10 +23,8 @@ class UserRule extends Model
|
||||||
protected static function init()
|
protected static function init()
|
||||||
{
|
{
|
||||||
self::afterInsert(function ($row) {
|
self::afterInsert(function ($row) {
|
||||||
if (!$row['weigh']) {
|
$pk = $row->getPk();
|
||||||
$pk = $row->getPk();
|
$row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
|
||||||
$row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,7 @@ class Category extends Model
|
||||||
protected static function init()
|
protected static function init()
|
||||||
{
|
{
|
||||||
self::afterInsert(function ($row) {
|
self::afterInsert(function ($row) {
|
||||||
if (!$row['weigh']) {
|
$row->save(['weigh' => $row['id']]);
|
||||||
$row->save(['weigh' => $row['id']]);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue