/** * * @SWG\Api( * path="/activity_page", * description="约惠主页(有更新20160308)", * @SWG\Operation( * method="GET", summary="获得约惠主页内容", notes="获得约惠主页内容", * type="ActivityPage", * @SWG\ResponseMessage(code=0, message="成功"), * @SWG\Parameter( * name="user_id", * description="用户id", * paramType="query", * required=false, * allowMultiple=false, * type="integer", * defaultValue=-1 * ) * ) * ) */ public function index(Request $request) { $user_id = $request->input('user_id', -1); $response = new BaseResponse(); $ret = (object) null; $banners = Banner::where('banner_position', 1)->get(); $ret->banners = $banners; //分类 $activityClassification = ActivityClassification::all(); $ret->activityClassification = $activityClassification; //包邮 $freePost = FreePost::all(); $ret->freePost = $freePost; //爆品 $conversionGoods = ConversionGoods::all(); //$conversionGoods=$conversionGoods->toArray(); foreach ($conversionGoods as &$v) { $v->has_collection = 0; if ($user_id != -1) { $collection = Collection::where('user_id', $user_id)->where('type', 0)->where('item_id', $v->goods_id)->first(); if ($collection != null) { $v->has_collection = 1; } } } $ret->conversionGoods = $conversionGoods; $response->Data = $ret; return $response->toJson(); }
/** * * @SWG\Api( * path="/setting/banner", * description="系统设置(更新20160210)", * @SWG\Operation( * method="GET", type="Banner",summary="取得banner", notes="返回的为相对路径,使用时请在前面加上http://120.27.199.121/feise/public", * @SWG\ResponseMessage(code=0, message=""), * @SWG\Parameter( * name="banner_position", * description="banner位置 0-->首页,1-->约惠", * paramType="query", * required=false, * allowMultiple=false, * type="integer", * defaultValue=1 * ) * ) * ) */ public function index(Request $request) { $response = new BaseResponse(); $banner_position = $request->input('banner_position', 0); $banners = Banner::where('banner_position', $banner_position); $response->rows = $banners->get(); $response->total = $banners->count(); return $response->toJson(); }
/** * * @SWG\Api( * path="/home_navigation", * description="首页按钮和banner", * @SWG\Operation( * method="GET", summary="获得首页和banner按钮列表", notes="对于按钮列表点击详情时:当type=0的时候调用 APP WAP 页 中的导航按钮详情图片接口来访问详情,当type=1时,直接跳转action字段中的链接", * type="HomeNavigationAndBanner", * @SWG\ResponseMessage(code=0, message="成功") * ) * ) */ public function index(Request $request) { $response = new BaseResponse(); $ret = (object) null; $button_list = HomeNavigation::orderBy('sort')->orderBy('id')->get(); $banners = Banner::where('banner_position', 0)->get(); $ret->button_list = $button_list; $ret->banner_list = $banners; $response->Data = $ret; return $response->toJson(); }
public function delete($id) { Banner::find($id)->delete(); $ret['meta']['code'] = 1; echo json_encode($ret); }
/** * * @SWG\Api( * path="/wap/banner_detail/{id}", * description="APP WAP 页(新,20160307)", * @SWG\Operation( * method="GET", summary="banner详情wap", notes="banner详情wap", * @SWG\ResponseMessage(code=0, message="成功"), * @SWG\Parameter( * name="id", * description="banner id", * paramType="path", * required=true, * allowMultiple=false, * type="integer", * ) * * ) * ) */ public function bannerDetail($id) { $data['content'] = Banner::find($id)->toArray(); return view('wap.banner_detail', $data); }