Files
im/plugin/admin/app/model/User.php
T
2025-11-22 15:31:01 +08:00

46 lines
1.5 KiB
PHP

<?php
namespace plugin\admin\app\model;
use support\think\Db;
/**
* @property integer $id 主键(主键)
* @property string $username 用户名
* @property string $nickname 昵称
* @property string $password 密码
* @property string $sex 性别
* @property string $avatar 头像
* @property string $email 邮箱
* @property string $mobile 手机
* @property integer $level 等级
* @property string $birthday 生日
* @property integer $money 余额
* @property integer $score 积分
* @property string $last_time 登录时间
* @property string $last_ip 登录ip
* @property string $join_time 注册时间
* @property string $join_ip 注册ip
* @property string $token token
* @property string $created_at 创建时间
* @property string $updated_at 更新时间
* @property integer $role_id 角色
* @property integer $status 禁用
*/
class User extends \app\model\User
{
public static function onAfterUpdate($row){
parent::onAfterUpdate($row);
$changeData = $row->getChangedData();
$orgData = $row->getOrigin();
foreach(Config('site.allow_currencys') as $currency){
if(isset($changeData[$currency])){
$cha = $changeData[$currency] - $orgData[$currency];
if($cha!=0){
\support\Log::channel('cansnow')->alert('管理员手动修改用户余额:'.$row->id.',货币:'.$currency.',修改金额:'.$cha.',原始数据:'.$orgData[$currency].',修改后的数据:'.$changeData[$currency]);
}
}
}
}
}