src/AppBundle/Controller/Admin/AccountController.php
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
namespace AppBundle\Controller\Admin;
use AppBundle\Common\ArrayToolkit;
use Symfony\Component\HttpFoundation\Request;
use AppBundle\Component\Echats\EchartsBuilder;
class AccountController extends BaseController
{
public function IndexAction(Request $request)
{
$weekAndMonthDate = array(
'weekDate' => $this->getStartTime('week'),
'monthDate' => $this->getStartTime('month'),
'seasonDate' => $this->getStartTime('quarter'),
'yearDate' => $this->getStartTime('year'),
);
return $this->render('admin/operation-analysis/index.html.twig', array(
'dates' => $weekAndMonthDate,
));
}
public function accountAnalysisAction(Request $request)
{
$weekTimeStart = $this->getStartTime('week');
$weekTimeEnd = strtotime(date('Y-m-d', time()));
$weekTotalPrice = $this->getAccountAnalysisData($weekTimeStart, $weekTimeEnd);
$monthTimeStart = $this->getStartTime('month');
$monthTimeEnd = strtotime(date('Y-m-d', time()));
$monthTotalPrice = $this->getAccountAnalysisData($monthTimeStart, $monthTimeEnd);
return $this->render('admin/operation-analysis/account-analysis-dashbord.html.twig', array(
'weekTotalPrice' => $weekTotalPrice,
'monthTotalPrice' => $monthTotalPrice,
));
}
private function getAccountAnalysisData($start, $endTime)
{
$totalPrice = $this->getOrderService()->analysisAmount(array('paidStartTime' => $start, 'paidEndTime' => $endTime, 'status' => 'paid'));
$coinTotalPrice = $this->getOrderService()->analysisAmount(array('paidStartTime' => $start, 'paidEndTime' => $endTime, 'status' => 'paid', 'payment' => 'coin'));
$cashTotalPrice = $totalPrice - $coinTotalPrice;
$courseTotalPrice = $this->getOrderService()->analysisAmount(array('paidStartTime' => $start, 'paidEndTime' => $endTime, 'status' => 'paid', 'targetType' => 'course'));
$classroomTotalPrice = $this->getOrderService()->analysisAmount(array('paidStartTime' => $start, 'paidEndTime' => $endTime, 'status' => 'paid', 'targetType' => 'classroom'));
$vipTotalPrice = $this->getOrderService()->analysisAmount(array('paidStartTime' => $start, 'paidEndTime' => $endTime, 'status' => 'paid', 'targetType' => 'vip'));
return array(
'totalPrice' => $totalPrice,
'coinTotalPrice' => $coinTotalPrice,
'cashTotalPrice' => $cashTotalPrice,
'courseTotalPrice' => $courseTotalPrice,
'classroomTotalPrice' => $classroomTotalPrice,
'vipTotalPrice' => $vipTotalPrice,
);
}
public function rankAction(Request $request)
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。