src/AppBundle/Controller/Admin/BillController.php

(开头部分) 1KB

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

<?php

namespace AppBundle\Controller\Admin;

use AppBundle\Common\Paginator;
use AppBundle\Common\ArrayToolkit;
use Biz\Common\CommonException;
use Symfony\Component\HttpFoundation\Request;
use AppBundle\Common\MathToolkit;

class BillController extends BaseController
{
    public function billAction(Request $request, $type)
    {
        if (!in_array($type, array('coin', 'money'))) {
            $this->createNewException(CommonException::ERROR_PARAMETER());
        }

        $account = $this->getAccountService()->getUserBalanceByUserId(0);

        $conditions = $request->query->all();
        $conditions['amount_type'] = $type;
        $conditions['user_id'] = 0;

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

        $cashes = $this->getAccountProxyService()->searchCashflows(
            $conditions,
            array('id' => 'DESC'),
            $paginator->getOffsetCount(),
            $paginator->getPerPageCount()
        );
        $tradeSns = ArrayToolkit::column($cashes, 'trade_sn');
        $trades = $this->getPayService()->findTradesByTradeSn($tradeSns);
        $trades = ArrayToolkit::index($trades, 'trade_sn');

        foreach ($cashes as &$cash) {
            $cash = MathToolkit::multiply($cash, array('amount'), 0.01);
        }
        $buyerIds = ArrayToolkit::column($cashes, 'buyer_id');
        $users = $this->getUserService()->findUsersByIds($buyerIds);

        list($inflow, $outflow) = $this->getInflowAndOutflow($conditions);

        return $this->render("admin/bill/{$type}.html.twig", array(
            'cashes' => $cashes,
            'paginator' => $paginator,
            'users' => $users,
            'account' => $account,
            'outflow' => $outflow,
            'inflow' => $inflow,
            'trades' => $trades,
        ));
    }

    private function getInflowAndOutflow($conditions)

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

AI 解读 AI

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

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