Files
useds/app/common/service/UserService.php
T

40 lines
720 B
PHP
Raw Normal View History

2026-01-05 14:33:21 +08:00
<?php
namespace app\common\service;
2026-01-05 15:49:25 +08:00
use app\common\validate\UserValidate;
2026-01-05 14:33:21 +08:00
use app\common\traits\crud\CrudServiceTrait;
2026-01-05 15:49:25 +08:00
use app\common\model\User;
use support\Request;
2026-01-05 14:33:21 +08:00
class UserService
{
2026-01-05 15:49:25 +08:00
2026-01-05 14:33:21 +08:00
use CrudServiceTrait;
/**
* 指定当前要操作的模型
*/
protected string $modelClass = User::class;
/**
2026-01-05 15:49:25 +08:00
* 验证器
2026-01-05 14:33:21 +08:00
*/
2026-01-05 15:49:25 +08:00
protected $validator = UserValidate::class;
2026-01-05 14:33:21 +08:00
/**
2026-01-05 15:49:25 +08:00
* 获取验证器
2026-01-05 14:33:21 +08:00
*/
2026-01-05 15:49:25 +08:00
public function getValidator()
2026-01-05 14:33:21 +08:00
{
2026-01-05 15:49:25 +08:00
return new $this->validator;
2026-01-05 14:33:21 +08:00
}
public function beforeServiceUpdate($data, Request $request){
unset($data['union_id']);
unset($data['app_id']);
unset($data['name']);
return $data;
}
2026-01-05 14:33:21 +08:00
}