buildadmin/app/admin/model/UserRule.php
2022-03-25 06:53:39 +08:00

19 lines
374 B
PHP

<?php
namespace app\admin\model;
use think\model;
class UserRule extends model
{
protected $autoWriteTimestamp = 'int';
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
protected static function onAfterInsert($row)
{
$pk = $row->getPk();
$row->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
}
}