|
@@ -23,8 +23,10 @@ class UserRule extends Model
|
|
protected static function init()
|
|
protected static function init()
|
|
{
|
|
{
|
|
self::afterInsert(function ($row) {
|
|
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]]);
|
|
|
|
+ }
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|