buildadmin/app/admin/model/UserRule.php

23 lines
440 B
PHP
Raw Normal View History

2022-03-24 22:53:39 +00:00
<?php
namespace app\admin\model;
use think\model;
/**
* UserRule 模型
* @controllerUrl 'userRule'
*/
2022-03-24 22:53:39 +00:00
class UserRule extends model
{
protected $autoWriteTimestamp = 'int';
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
2022-08-23 16:27:21 +00:00
protected static function onAfterInsert($model)
2022-03-24 22:53:39 +00:00
{
2022-08-23 16:27:21 +00:00
$pk = $model->getPk();
$model->where($pk, $model[$pk])->update(['weigh' => $model[$pk]]);
2022-03-24 22:53:39 +00:00
}
}