buildadmin/app/admin/model/UserRule.php

19 lines
374 B
PHP
Raw Normal View History

2022-03-24 22:53:39 +00:00
<?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]]);
}
}