|
@@ -21,18 +21,20 @@ class BeanDetailController extends Controller
|
|
|
//排行榜
|
|
|
public function rankingList(Request $request)
|
|
|
{
|
|
|
- $validator = Validator::make($request->all(), [
|
|
|
+ $data = $request->all();
|
|
|
+ $validator = Validator::make($data, [
|
|
|
'type' => ['required',Rule::in([0,1, 2])],
|
|
|
]);
|
|
|
if ($validator->fails()) {
|
|
|
return $this->jsonError($validator->errors()->first());
|
|
|
}
|
|
|
- $top_most = $this->beanRepository->rankingList($request->all());
|
|
|
+ $top_most = $this->beanRepository->rankingList($data);
|
|
|
if ($top_most){
|
|
|
- return $this->jsonSuccess($top_most);
|
|
|
+ return success(['list'=>$top_most]);
|
|
|
}else{
|
|
|
- return $this->jsonSuccess();
|
|
|
+ return success(['list' => []]);
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
//分享/邀请首页
|