vd/app/Domains/Export/Http/Controllers/ExportController.php
2019-01-17 11:32:21 +08:00

52 lines
1.0 KiB
PHP

<?php
namespace App\Domains\Export\Http\Controllers;
use App\Core\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Storage;
use App\Domains\Export\Services\ExportService;
class ExportController extends Controller
{
protected $request;
protected $exportService;
/**
* 构造函数,自动注入.
*/
public function __construct(Request $request, ExportService $exportService)
{
$this->request = $request;
$this->exportService = $exportService;
}
/**
* 列表.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$conditions = $this->request->all();
$res = $this->exportService->index($conditions);
return res($res, '导出记录', 201);
}
/**
* 删除.
*
* @return \Illuminate\Http\Response
*/
public function destroy()
{
$ids = $this->request->ids();
$this->exportService->destroy($ids);
return res(true, '删除成功');
}
}