|
@@ -0,0 +1,38 @@
|
|
|
+<?php
|
|
|
+namespace App\Http\Controllers\V1;
|
|
|
+use App\Repositories\MemberRepository;
|
|
|
+use Illuminate\Http\Request;
|
|
|
+use Illuminate\Support\Facades\Validator;
|
|
|
+use Illuminate\Validation\Rule;
|
|
|
+/**
|
|
|
+ * Created by PhpStorm.
|
|
|
+ * User: durong
|
|
|
+ * Date: 2019/6/19
|
|
|
+ * Time: 下午12:25
|
|
|
+ */
|
|
|
+
|
|
|
+class BeanDetailController extends Controller
|
|
|
+{
|
|
|
+ public function __construct(MemberRepository $memberRepository)
|
|
|
+ {
|
|
|
+ $this->memberRepository = $memberRepository;
|
|
|
+ }
|
|
|
+
|
|
|
+ //获取指定时间彩虹豆收支明细
|
|
|
+ public function beanDetail(Request $request)
|
|
|
+ {
|
|
|
+ $validator = Validator::make($request->all(), [
|
|
|
+ 'type' => ['required',Rule::in([0,1, 2])],
|
|
|
+ ]);
|
|
|
+ if ($validator->fails()) {
|
|
|
+ return $this->jsonError($validator->errors()->first());
|
|
|
+ }
|
|
|
+
|
|
|
+ $beanDetail = $this->memberRepository->beanDetail($request->all());
|
|
|
+ if ($beanDetail){
|
|
|
+ return $this->jsonSuccess($beanDetail);
|
|
|
+ }else{
|
|
|
+ return $this->jsonError('没有找到对应彩虹豆明细');
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|