buildadmin/app/admin/model/UserRule.php
2023-06-23 22:13:55 +08:00

26 lines
496 B
PHP

<?php
namespace app\admin\model;
use think\model;
/**
* UserRule 模型
* @controllerUrl 'userRule'
*/
class UserRule extends model
{
protected $autoWriteTimestamp = true;
protected static function onAfterInsert($model)
{
$pk = $model->getPk();
$model->where($pk, $model[$pk])->update(['weigh' => $model[$pk]]);
}
public function setComponentAttr($value)
{
if ($value) $value = str_replace('\\', '/', $value);
return $value;
}
}