2022-03-24 22:53:39 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace app\admin\model;
|
|
|
|
|
|
|
|
use think\model;
|
|
|
|
|
2022-04-23 09:57:29 +00:00
|
|
|
/**
|
|
|
|
* UserRule 模型
|
|
|
|
*/
|
2022-03-24 22:53:39 +00:00
|
|
|
class UserRule extends model
|
|
|
|
{
|
2023-06-23 14:13:55 +00:00
|
|
|
protected $autoWriteTimestamp = true;
|
2022-03-24 22:53:39 +00:00
|
|
|
|
2024-06-02 14:39:10 +00:00
|
|
|
protected static function onAfterInsert($model): void
|
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
|
|
|
}
|
2023-05-12 18:03:01 +00:00
|
|
|
|
|
|
|
public function setComponentAttr($value)
|
|
|
|
{
|
|
|
|
if ($value) $value = str_replace('\\', '/', $value);
|
|
|
|
return $value;
|
|
|
|
}
|
2022-03-24 22:53:39 +00:00
|
|
|
}
|