51 lines
1.0 KiB
PHP
51 lines
1.0 KiB
PHP
<?php
|
|
namespace App\Domains\Stats\Http\Controllers;
|
|
|
|
use App\Core\Controller;
|
|
use Illuminate\Http\Request;
|
|
use App\Domains\Stats\Services\OrderService;
|
|
|
|
class OrderController extends Controller
|
|
{
|
|
protected $request;
|
|
protected $orderService;
|
|
|
|
/**
|
|
* 构造函数,自动注入.
|
|
*/
|
|
public function __construct(Request $request, OrderService $orderService)
|
|
{
|
|
$this->request = $request;
|
|
$this->orderService = $orderService;
|
|
}
|
|
|
|
/**
|
|
* 列表.
|
|
*
|
|
* @return \Illuminate\Http\Response
|
|
*/
|
|
public function index()
|
|
{
|
|
$conditions = $this->request->all();
|
|
|
|
$res = $this->orderService->index($conditions);
|
|
|
|
return res($res, '订单统计', 201);
|
|
}
|
|
|
|
|
|
/**
|
|
* 统计明细.
|
|
*
|
|
* @return \Illuminate\Http\Response
|
|
*/
|
|
public function detail()
|
|
{
|
|
$conditions = $this->request->all();
|
|
|
|
$res = $this->orderService->detail($conditions);
|
|
|
|
return res($res, '统计明细', 201);
|
|
}
|
|
}
|