You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
804 B
40 lines
804 B
<?php
|
|
|
|
namespace App\Service\v3\Implementations;
|
|
|
|
use App\Constants\v3\ErrorCode;
|
|
use App\Exception\ErrorCodeException;
|
|
use App\Model\v3\User;
|
|
use App\Service\v3\Interfaces\UserInfoServiceInterface;
|
|
|
|
class UserInfoService implements UserInfoServiceInterface
|
|
{
|
|
|
|
/**
|
|
* 更新
|
|
* @param $userId
|
|
* @param $data
|
|
* @return int
|
|
*/
|
|
public function do($userId, $data)
|
|
{
|
|
$user = User::query()->find($userId);
|
|
$res = $user->fill($data)->save();
|
|
|
|
if (!$res) {
|
|
throw new ErrorCodeException(ErrorCode::USER_INFO_UPDATE_ERROR);
|
|
}
|
|
|
|
return $res;
|
|
}
|
|
|
|
public function check($userId)
|
|
{
|
|
// TODO: Implement check() method.
|
|
}
|
|
|
|
public function undo($userId)
|
|
{
|
|
// TODO: Implement undo() method.
|
|
}
|
|
}
|