src/AppBundle/Controller/My/CoinController.php

(开头部分) 1KB

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

<?php

namespace AppBundle\Controller\My;

use AppBundle\Common\Paginator;
use AppBundle\Common\ArrayToolkit;
use AppBundle\Common\StringToolkit;
use Biz\Card\Service\CardService;
use Biz\User\Service\UserService;
use Biz\Coupon\Service\CouponService;
use Biz\System\Service\SettingService;
use Biz\CloudPlatform\Service\AppService;
use Biz\User\Service\InviteRecordService;
use Codeages\Biz\Pay\Service\AccountService;
use Codeages\Biz\Pay\Service\PayService;
use Symfony\Component\HttpFoundation\Cookie;
use Symfony\Component\HttpFoundation\Request;
use AppBundle\Controller\BaseController;
use Codeages\Biz\Order\Service\OrderService;

class CoinController extends BaseController
{
    public function indexAction(Request $request)
    {
        $user = $this->getCurrentUser();

        if (!$user->isLogin()) {
            return $this->createMessageResponse('error', '用户未登录,请先登录!');
        }

        $coinEnabled = $this->setting('coin.coin_enabled');

        if (empty($coinEnabled) || $coinEnabled == 0) {
            return $this->createMessageResponse('error', '网校虚拟币未开启!');
        }

        $balance = $this->getAccountService()->getUserBalanceByUserId($user->id);
        $chargeCoin = $this->getAppService()->findInstallApp('ChargeCoin');

        $fields = $request->query->all();
        $conditions = array();

        if (!empty($fields)) {
            $conditions = $fields;
        }

        $conditions['amount_type'] = 'coin';
        $conditions['user_id'] = $user->id;
        $conditions['except_user_id'] = 0;

        $conditions['created_time_GTE'] = 0;
        $conditions['created_time_LTE'] = time();

        $paginator = new Paginator(
            $this->get('request'),
            $this->getAccountService()->countCashflows($conditions),
            20
        );

        $cashes = $this->getAccountService()->searchCashflows(

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

AI 解读 AI

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

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