src/Biz/RewardPoint/Service/Impl/AccountServiceImpl.php

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php

namespace Biz\RewardPoint\Service\Impl;

use Biz\BaseService;
use Biz\Common\CommonException;
use Biz\RewardPoint\AccountException;
use Biz\System\Service\LogService;
use Biz\System\Service\SettingService;
use Biz\User\Service\UserService;
use Biz\RewardPoint\Dao\AccountDao;
use Biz\RewardPoint\Service\AccountFlowService;
use Biz\RewardPoint\Service\AccountService;
use AppBundle\Common\ArrayToolkit;
use Biz\User\UserException;

class AccountServiceImpl extends BaseService implements AccountService
{
    public function createAccount($account)
    {
        $this->validateFields($account);
        $account = $this->filterFields($account);
        $this->checkUserExist($account['userId']);
        $this->checkUserAccountOpened($account['userId']);

        $account = $this->getAccountDao()->create($account);
        $this->getLogService()->info('reward_point_account', 'create', '积分账户', $account);

        return $account;
    }

    public function updateAccount($id, $fields)
    {
        $account = $this->checkAccountExist($id);
        if (!empty($account) && !empty($fields['userId'])) {
            $this->checkUserExist($fields['userId']);
            $this->checkUserCorrect($account['userId'], $fields['userId']);
        }
        $fields = $this->filterFields($fields);

        return $this->getAccountDao()->update($id, $fields);
    }

    public function deleteAccount($id)
    {
        $this->checkAccountExist($id);

        $result = $this->getAccountDao()->delete($id);
        $this->getLogService()->info('reward_point_account', 'delete', '积分账户', array('id' => $id, 'result' => $result));

        return $result;
    }

    public function deleteAccountByUserId($userId)
    {
        $this->checkAccountExistByUserId($userId);

        $result = $this->getAccountDao()->deleteByUserId($userId);
        $this->getLogService()->info('reward_point_account', 'delete', '积分账户', array('userId' => $userId, 'result' => $result));

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。