src/ApiBundle/Api/Resource/Order/OrderLog.php

(开头部分) 1KB

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

<?php

namespace ApiBundle\Api\Resource\Order;

use ApiBundle\Api\ApiRequest;
use ApiBundle\Api\Annotation\Access;
use ApiBundle\Api\Resource\AbstractResource;
use AppBundle\Common\OrderToolkit;

class OrderLog extends AbstractResource
{
    /**
     * @Access(roles="ROLE_ADMIN,ROLE_SUPER_ADMIN")
     */
    public function search(ApiRequest $request, $orderId)
    {
        $orderLogs = $this->getOrderService()->findOrderLogsByOrderId($orderId);

        $orderLogs = OrderToolkit::removeUnneededLogs($orderLogs);

        $total = count($orderLogs);
        $offset = 0;
        $limit = $total;

        if (!empty($orderLogs)) {
            $this->getOCUtil()->replaceWithObjValue(
                $orderLogs,
                array('user_id' => array('nickname' => 'nickname', 'mobile' => 'verifiedMobile')),
                'user'
            );

            $dicts = $this->container->get('codeages_plugin.dict_twig_extension')->getDict('orderLogStatus');

            foreach ($orderLogs as &$orderLog) {
                $orderLog['statusName'] = empty($dicts[$orderLog['status']]) ? '' : $dicts[$orderLog['status']];
            }
        }

        return $this->makePagingObject($orderLogs, $total, $offset, $limit);
    }

    protected function getOrderService()
    {
        return $this->service('Order:OrderService');
    }
}

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

AI 解读 AI

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

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