当前位置: 首页>>代码示例>>PHP>>正文


PHP Comments::where方法代码示例

本文整理汇总了PHP中Comments::where方法的典型用法代码示例。如果您正苦于以下问题:PHP Comments::where方法的具体用法?PHP Comments::where怎么用?PHP Comments::where使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Comments的用法示例。


在下文中一共展示了Comments::where方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: show

 /**
  * Display the specified resource.
  *
  * @param  int  $itemId
  * @param string $key
  * @return Response
  */
 public function show($itemId, $key)
 {
     //
     $retVal = array('status' => 'ERR', 'msg' => 'Invalid Session');
     try {
         $user = \Member::where('session_key', '=', $key)->exists();
         if (!$user) {
             return Response::json($retVal);
         }
         $comment = \Comments::where('itemid', '=', $itemId)->get();
         if ($comment->count() > 0) {
             $retVal = array('status' => 'OK', 'comments' => $comment->toArray());
         } else {
             $retVal = array('status' => 'ERR', 'msg' => 'beyond your imagination :)');
         }
         return Response::json($retVal);
     } catch (ModelNotFoundException $e) {
     }
 }
开发者ID:awidarto,项目名称:bilnatracker,代码行数:26,代码来源:CommentController.php

示例2: editEnrollment

 public function editEnrollment()
 {
     $inputs = Input::all();
     $paymentreminder_data_make_reminder_null = Comments::where('paymentfollowup_id', '=', $inputs['paymentdue_id'])->update(array('reminder_date' => Null));
     $paymentreminder_data = Comments::where('paymentfollowup_id', '=', $inputs['paymentdue_id'])->orderBy('id', 'DESC')->first();
     if ($inputs['enrollmentstatus'] == 'REMINDER_CALL') {
         $commentText = "Reminder call  " . 'on  ' . date('Y-m-d', strtotime($inputs['reminder-date'])) . ' ' . $inputs['customerCommentTxtarea'];
     } elseif ($inputs['enrollmentstatus'] == 'FOLLOW_CALL') {
         $commentText = "Follow call  " . 'on  ' . date('Y-m-d', strtotime($inputs['reminder-date'])) . ' ' . $inputs['customerCommentTxtarea'];
     } elseif ($inputs['enrollmentstatus'] == 'CALL_SPOUSE') {
         $commentText = "Call Spouse " . 'on  ' . date('Y-m-d', strtotime($inputs['reminder-date'])) . ' ' . $inputs['customerCommentTxtarea'];
     } elseif ($inputs['enrollmentstatus'] == 'NOT_AVAILABLE') {
         $commentText = "Not Available  " . 'on  ' . date('Y-m-d') . ' ' . $inputs['customerCommentTxtarea'];
     } elseif ($inputs['enrollmentstatus'] == 'NOT_INTERESTED') {
         $commentText = "NOT_INTERESTED " . 'on  ' . date('Y-m-d') . ' ' . $inputs['customerCommentTxtarea'];
     } elseif ($inputs['enrollmentstatus'] == 'CLOSE_CALL') {
         $commentText = "Followupcall closed on " . date('Y-m-d') . ' ' . $inputs['customerCommentTxtarea'];
     }
     $commentsInput['customerId'] = $paymentreminder_data['customer_id'];
     $commentsInput['student_id'] = $paymentreminder_data['student_id'];
     $commentsInput['paymentfollowup_id'] = $paymentreminder_data['paymentfollowup_id'];
     $commentsInput['followupType'] = $paymentreminder_data['followup_type'];
     $commentsInput['commentStatus'] = $inputs['enrollmentstatus'];
     $commentsInput['commentType'] = $inputs['enrollmenteditAction'];
     $commentsInput['commentText'] = $commentText;
     if ($inputs['enrollmentstatus'] != 'CLOSE_CALL') {
         if ($inputs['enrollmentstatus'] != 'NOT_INTERESTED') {
             if (isset($inputs['reminder-date'])) {
                 $commentsInput['reminderDate'] = $inputs['reminder-date'];
             }
         }
     }
     //return Response::json(array('status'=>$inputs));
     Comments::addComments($commentsInput);
     return Response::json(array('status' => 'success'));
 }
开发者ID:Headrun-php,项目名称:TLG,代码行数:36,代码来源:StudentsController.php

示例3: getReminderCountByFranchiseeId

 static function getReminderCountByFranchiseeId()
 {
     $today = date('Y-m-d');
     return Comments::where("franchisee_id", "=", Session::get('franchiseId'))->where("reminder_date", "!=", "NULL")->where("reminder_date", "LIKE", "" . $today . "%")->count();
     //->get();
 }
开发者ID:Headrun-php,项目名称:TLG,代码行数:6,代码来源:Logs.php

示例4: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     if (Auth::check()) {
         $currentPage = "";
         $mainMenu = "DASHBOARD";
         //customers or Inquiries
         $todaysCustomerReg = Customers::getCustomertodaysRegCount();
         $customerCount = Customers::getCustomerCount();
         //Members or Family Members
         $todaysMemberReg = CustomerMembership::getMembertodaysRegCount();
         $membersCount = CustomerMembership::getMemberCount();
         //Non Members or prospects
         $todaysNonmemberReg = CustomerMembership::getNonMembertodaysRegCount();
         $NonmembersCount = CustomerMembership::getNonMemberCount();
         //Enrolled customers(kids)
         $todaysEnrolledCustomers = StudentClasses::getTodaysEnrolledCustomers();
         $enrolledCustomers = StudentClasses::getEnrolledCustomers();
         //for followups
         $reminderCount = Comments::getReminderCountByFranchiseeId();
         //Introvisit
         $totalIntrovisitCount = IntroVisit::getIntrovistCount();
         $introVisitCount = IntroVisit::getIntrovisitBytoday();
         $allIntrovisits = IntroVisit::getAllActiveIntrovisit();
         for ($i = 0; $i < count($allIntrovisits); $i++) {
             $data = Comments::where('introvisit_id', '=', $allIntrovisits[$i]['id'])->orderBy('id', 'DESC')->first();
             if (isset($data)) {
                 $allIntrovisits[$i]['followup_status'] = $data['followup_status'];
             }
         }
         //for courses
         $totalParentchildCourse = Classes::getallParentchildCourseCount();
         $totalPrekgKindergarten = Classes::getallPrekgKindergartenCount();
         $totalGradeschool = Classes::getallGradeschoolCount();
         $totalCourses = $totalParentchildCourse + $totalPrekgKindergarten + $totalGradeschool;
         //for birthdayparty
         $totalbpartyCount = BirthdayParties::getBpartyCount();
         $todaysbpartycount = BirthdayParties::getBpartyCountBytoday();
         $todaysFollowup = Comments::getAllFollowup();
         $todaysIntrovisit = BatchSchedule::getTodaysIntroVisits();
         $activeRemindersCount = Comments::getAllFollowupActive();
         //get birthday dates
         $startdate = new carbon();
         $startdate->startOfYear();
         $endofyear = new carbon();
         $endofyear = $endofyear->endOfYear();
         $student_id = array();
         $birthday_celebration_data = BirthdayParties::where('created_at', '>=', $startdate->toDateString())->where('created_at', '<=', $endofyear->toDateString())->select('student_id')->get();
         //var_dump($birthday_celebration_data); die();
         for ($i = 0; $i < count($birthday_celebration_data); $i++) {
             $student_id[$i] = $birthday_celebration_data[$i]['student_id'];
         }
         $dat = new carbon();
         $month = $dat->month;
         $presentdate = $dat->day;
         // for rest of the days of month
         $birthday_data = Students::whereNotIn('id', $student_id)->where('student_date_of_birth', '<>', '')->where(DB::raw('MONTH(student_date_of_birth)'), '=', $month)->where(DB::raw('DATE(student_date_of_birth)'), '>', $presentdate)->where('franchisee_id', '=', Session::get('franchiseId'))->orderBy(DB::raw('DAY(student_date_of_birth)'))->get();
         //  echo $month; die();
         for ($i = 0; $i < count($birthday_data); $i++) {
             $customer_data = Customers::where('id', '=', $birthday_data[$i]['customer_id'])->get();
             $birthday_data[$i]['customer_name'] = $customer_data[0]['customer_name'];
             $birthday_data[$i]['mobile_no'] = $customer_data[0]['mobile_no'];
             $birthday_data[$i]['membership'] = CustomerMembership::where('customer_id', '=', $birthday_data[$i]['customer_id'])->count();
         }
         $m = $month;
         $m++;
         while ($m <= 12) {
             $birthday_data_month[] = Students::whereNotIn('id', $student_id)->where('student_date_of_birth', '<>', '')->where(DB::raw('MONTH(student_date_of_birth)'), '=', $m)->where('franchisee_id', '=', Session::get('franchiseId'))->orderBy(DB::raw('DAY(student_date_of_birth)'))->get();
             $m++;
         }
         // for starting months
         $m = 1;
         while ($m < $month) {
             $birthday_data_month[] = Students::whereNotIn('id', $student_id)->where('student_date_of_birth', '<>', '')->where(DB::raw('MONTH(student_date_of_birth)'), '=', $m)->where('franchisee_id', '=', Session::get('franchiseId'))->orderBy(DB::raw('DAY(student_date_of_birth)'))->get();
             $m++;
         }
         for ($i = 0; $i < count($birthday_data_month); $i++) {
             for ($j = 0; $j < count($birthday_data_month[$i]); $j++) {
                 $customer_data = Customers::where('id', '=', $birthday_data_month[$i][$j]['customer_id'])->get();
                 $birthday_data_month[$i][$j]['customer_name'] = $customer_data[0]['customer_name'];
                 $birthday_data_month[$i][$j]['mobile_no'] = $customer_data[0]['mobile_no'];
                 $birthday_data_month[$i][$j]['membership'] = CustomerMembership::where('customer_id', '=', $birthday_data_month[$i][$j]['customer_id'])->count();
             }
         }
         // var_dump($birthday_data_month);exit();
         //for starting days of present month
         $birthday_month_startdays = Students::whereNotIn('id', $student_id)->where('student_date_of_birth', '<>', '')->where(DB::raw('MONTH(student_date_of_birth)'), '=', $month)->where(DB::raw('DATE(student_date_of_birth)'), '<', $presentdate)->where('franchisee_id', '=', Session::get('franchiseId'))->orderBy(DB::raw('DAY(student_date_of_birth)'))->get();
         for ($i = 0; $i < count($birthday_month_startdays); $i++) {
             $customer_data = Customers::where('id', '=', $birthday_month_startdays[$i]['customer_id'])->get();
             $birthday_month_startdays[$i]['customer_name'] = $customer_data[0]['customer_name'];
             $birthday_month_startdays[$i]['mobile_no'] = $customer_data[0]['mobile_no'];
             $birthday_month_startdays[$i]['membership'] = CustomerMembership::where('customer_id', '=', $birthday_month_startdays[$i]['customer_id'])->count();
         }
         //for birthday celebration this week
         $presentdate = new carbon();
         $weeekdate = new carbon();
//.........这里部分代码省略.........
开发者ID:Headrun-php,项目名称:TLG,代码行数:101,代码来源:DashboardController.php


注:本文中的Comments::where方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。