Esempio n. 1
0
 public function reportChartProductLike(Request $request)
 {
     $dateRange = $request->input('dateRange', false);
     $type = $request->input('type', 'day');
     $userService = new userService();
     $return = array();
     $return['ok'] = 0;
     try {
         $return['data'] = $userService->getUserProductLikeReport($dateRange, $type);
         $return['ok'] = 1;
     } catch (\Exception $e) {
         if ($request->ajax()) {
             $return['error'] = $e->getMessage();
         } else {
             return view('errors.404', ['error_message' => $e->getMessage()]);
         }
     }
     return response()->json($return);
 }