public function index(Request $request)
 {
     $start = $request->input('start', 0);
     $length = $request->input('length', 5);
     $draw = $request->input('draw', 1);
     $total = ActivityClassification::count();
     $activityClassification = ActivityClassification::skip($start)->take($length)->orderBy('sort')->orderBy('id');
     echo json_encode(array("draw" => intval($draw), "recordsTotal" => intval($total), "recordsFiltered" => intval($total), "data" => $activityClassification->get()->toArray()));
 }
 /**
  *
  * @SWG\Api(
  *   path="/activity_classifications",
  *   description="活动",
  *   @SWG\Operation(
  *     method="GET", summary="获得活动分类列表", notes="获得活动分类列表",
  *     type="ActivityClassification",
  *     @SWG\ResponseMessage(code=0, message="成功"),
  *     @SWG\Parameter(
  *         name="PageNum",
  *         description="分页开始位置",
  *         paramType="query",
  *         required=false,
  *         allowMultiple=false,
  *         type="integer",
  *         defaultValue=1
  *     ),@SWG\Parameter(
  *         name="PerPage",
  *         description="取得长度",
  *         paramType="query",
  *         required=false,
  *         allowMultiple=false,
  *         type="integer",
  *         defaultValue=10
  *     )
  *
  *   )
  * )
  */
 public function index(Request $request)
 {
     //
     $start = $request->input('PageNum', 0);
     $length = $request->input('PerPage', 5);
     $start = ($start - 1) * $length;
     $response = new BaseResponse();
     $home = ActivityClassification::skip($start)->take($length)->orderBy('sort')->orderBy('id', 'desc');
     $response->rows = $home->get();
     $response->total = ActivityClassification::count();
     return $response->toJson();
 }