|
@@ -0,0 +1,35 @@
|
|
|
+<?php
|
|
|
+namespace App\Http\Controllers\V2;
|
|
|
+use App\Http\Controllers\BaseController;
|
|
|
+use App\Repositories\BannerRepository;
|
|
|
+use Illuminate\Support\Facades\Validator;
|
|
|
+use Illuminate\Http\Request;
|
|
|
+
|
|
|
+/**
|
|
|
+ * Created by PhpStorm.
|
|
|
+ * User: durong
|
|
|
+ * Date: 2019/6/15
|
|
|
+ * Time: 下午5:21
|
|
|
+ */
|
|
|
+
|
|
|
+class BannerController extends BaseController
|
|
|
+{
|
|
|
+ public function __construct(BannerRepository $bannerRepository)
|
|
|
+ {
|
|
|
+ $this->bannerRepository = $bannerRepository;
|
|
|
+ }
|
|
|
+ //根据多个banner ID获取banner数据
|
|
|
+ public function lists(Request $request)
|
|
|
+ {
|
|
|
+ $data = $request->only('ids');
|
|
|
+ $validator = Validator::make($data, [
|
|
|
+ 'ids' => 'required|string'
|
|
|
+ ]);
|
|
|
+ if ($validator->fails()) {
|
|
|
+ return $this->jsonError($validator->errors()->first());
|
|
|
+ }
|
|
|
+ $data['ids'] = urldecode($data['ids']);
|
|
|
+ $bannerLists = $this->bannerRepository->bannerData($data);
|
|
|
+ return $this->jsonSuccess($bannerLists);
|
|
|
+ }
|
|
|
+}
|