public function getcontestmobile() { $timezone = Input::get('timezone'); $contestid = Input::get('contestid'); $contest = contestModel::where('status', 1)->find($contestid); if ($contest != '') { $contest['conteststartdate']; $interestdetails = contestinterestModel::select('interest_category.interest_id', 'interest_category.Interest_name')->where('contest_id', $contestid)->LeftJoin('interest_category', 'interest_category.interest_id', '=', 'contest_interest_categories.category_id')->where('interest_category.status', 1)->get(); $contest->themephoto = url() . '/public/assets/upload/contest_theme_photo/' . $contest->themephoto; $contest->sponsorphoto = url() . '/public/assets/upload/sponsor_photo/' . $contest->sponsorphoto; $contest->conteststartdate = timezoneModel::convert($contest->conteststartdate, 'UTC', $timezone, 'Y-m-d H:i:s'); $contest->contestenddate = timezoneModel::convert($contest->contestenddate, 'UTC', $timezone, 'Y-m-d H:i:s'); $contest->votingstartdate = timezoneModel::convert($contest->votingstartdate, 'UTC', $timezone, 'Y-m-d H:i:s'); $contest->votingenddate = timezoneModel::convert($contest->votingenddate, 'UTC', $timezone, 'Y-m-d H:i:s'); $contest->createddate = timezoneModel::convert($contest->createddate, 'UTC', $timezone, 'Y-m-d H:i:s'); $contest->interest = $interestdetails; $Response = array('success' => '1', 'message' => 'Contest Details fetched Successfully', 'msgcode' => "c113"); $contestparticipantcount = contestparticipantModel::where('contest_id', $contestid)->get()->count(); $contestparticipantcount = array('contestparticipantcount' => $contestparticipantcount); $final = array("response" => $Response, "contest Details" => $contest, "contestparticipantcount" => $contestparticipantcount); return json_encode($final); } else { $Response = array('success' => '0', 'message' => 'Inactive contest', 'msgcode' => "c197"); $final = array("response" => $Response); return json_encode($final); } }
public function getcontestmobile() { $timezone = Input::get('timezone'); $contestid = Input::get('contestid'); $contest = contestModel::find($contestid); //return $contest; $contest['conteststartdate']; $interestdetails = contestinterestModel::select('interest_category.interest_id', 'interest_category.Interest_name')->where('contest_id', $contestid)->LeftJoin('interest_category', 'interest_category.interest_id', '=', 'contest_interest_categories.category_id')->get(); $contest->conteststartdate = timezoneModel::convert($contest->conteststartdate, 'UTC', $timezone, 'Y-m-d H:i:s'); $contest->contestenddate = timezoneModel::convert($contest->contestenddate, 'UTC', $timezone, 'Y-m-d H:i:s'); $contest->votingstartdate = timezoneModel::convert($contest->votingstartdate, 'UTC', $timezone, 'Y-m-d H:i:s'); $contest->votingenddate = timezoneModel::convert($contest->votingenddate, 'UTC', $timezone, 'Y-m-d H:i:s'); $contest->createddate = timezoneModel::convert($contest->createddate, 'UTC', $timezone, 'Y-m-d H:i:s'); $contest->interest = $interestdetails; $Response = array('success' => '1', 'message' => 'Contest Details fetched Successfully'); $contestparticipantcount = contestparticipantModel::where('contest_id', $contestid)->get()->count(); $contestparticipantcount = array('contestparticipantcount' => $contestparticipantcount); //$final=array("response"=>$Response,"contestdetails"=>$contestDetails); $final = array("response" => $Response, "contest Details" => $contest, "contestparticipantcount" => $contestparticipantcount); return json_encode($final); }