[积分商城]用户管理

This commit is contained in:
2026-03-18 19:20:45 +08:00
parent 03b936dd52
commit 64fb6d81c5
7 changed files with 444 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
<?php
namespace app\common\model;
use app\common\model\traits\TimestampInteger;
use support\think\Model;
/**
* 商城用户模型
*/
class MallUser extends Model
{
use TimestampInteger;
protected string $name = 'mall_user';
protected bool $autoWriteTimestamp = true;
public function admin(): \think\model\relation\BelongsTo
{
return $this->belongsTo(\app\admin\model\Admin::class, 'admin_id', 'id');
}
/**
* 重置密码(加密存储)
*/
public function resetPassword(int $id, string $newPassword): bool
{
return $this->where(['id' => $id])->update(['password' => hash_password($newPassword)]) !== false;
}
}