|
@@ -0,0 +1,35 @@
|
|
|
|
+<?php
|
|
|
|
+namespace App\Http\Controllers;
|
|
|
|
+use App\Repositories\ConfigStoreTypeRepository;
|
|
|
|
+use App\Transformers\ConfigStoreTypeTransformer;
|
|
|
|
+use Illuminate\Http\Request;
|
|
|
|
+use League\Fractal\Resource\Collection;
|
|
|
|
+use League\Fractal\Manager;
|
|
|
|
+use League\Fractal\Pagination\IlluminatePaginatorAdapter;
|
|
|
|
+/**
|
|
|
|
+ * Created by PhpStorm.
|
|
|
|
+ * User: qinyaer
|
|
|
|
+ * Date: 2019/4/26
|
|
|
|
+ * Time: 下午15:09
|
|
|
|
+ */
|
|
|
|
+
|
|
|
|
+class StoreTypeController extends BaseController
|
|
|
|
+{
|
|
|
|
+ public function __construct(ConfigStoreTypeRepository $configStoreTypeRepository) {
|
|
|
|
+
|
|
|
|
+ $this->configStoreTypeRepository = $configStoreTypeRepository;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //储存方式列表
|
|
|
|
+ public function index(Request $request)
|
|
|
|
+ {
|
|
|
|
+ $cityList = $this->configStoreTypeRepository->index($request->all());
|
|
|
|
+
|
|
|
|
+ $fractal = new Manager();
|
|
|
|
+ $resource = new Collection($cityList , new ConfigStoreTypeTransformer());
|
|
|
|
+ $resource->setPaginator(new IlluminatePaginatorAdapter($cityList));
|
|
|
|
+ $data = $fractal->createData($resource)->toArray();
|
|
|
|
+ return $this->jsonSuccess($data);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+}
|