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


PHP comment::where方法代码示例

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


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

示例1: show

 public function show($id)
 {
     $articles = new Article();
     $comment = new comment();
     $article = $articles->where('article_id=' . $id)->find();
     $comments = $comment->where('article_id=' . $id)->order('created_at')->select();
     //$comments = $articles->relation(true)->find($id);
     $this->assign('article', $article);
     $this->assign('comments', $comments);
     $this->display('showArticle');
 }
开发者ID:sylvanasGG,项目名称:tpweb,代码行数:11,代码来源:ArticleController.class.php

示例2: index

 public function index()
 {
     Cas::getCurrentUser();
     $user = session('cas_user');
     $client = new \GuzzleHttp\Client();
     // $response = $client->get('http://testserver.strathmore.edu:8082/dataservice/student/getStudent/'.$user);
     $responseStudent = file_get_contents('http://testserver.strathmore.edu:8082/dataservice/student/getStudent/' . $user);
     $responseStaff = file_get_contents('http://testserver.strathmore.edu:8082/dataservice/staff/getStaff/' . $user);
     // check to see if the logged in user is a student
     if ($responseStaff == '' && $responseStudent != '') {
         $student = json_decode($responseStudent, true);
         // check to see if student has already initiated the clearance process
         // if student has not requested to be cleared, he/she is taken to the clear request page
         $std = student::where('studentNo', '=', $user)->first();
         // for testing, delete after test
         // if($student['studentNo'] == '78699'){
         //   return redirect()->intended('/cafeteria');
         // }
         //If the query has a result ...
         if ($std === null) {
             return view('clearance.init')->with('student', $student);
         } else {
             $charge = charges::where('students_studentNo', '=', $user)->first();
             $comment = comment::where('students_studentNo', '=', $user)->first();
             return view('clearance.index')->with('std', $std)->with('charge', $charge)->with('comment', $comment);
         }
     } elseif ($responseStaff != '' && $responseStudent == '') {
         $staffMember = json_decode($responseStaff, true);
         $department_staff_belongs_to = $staffMember['departmentShortName'];
         $check_admin = DB::table('administrators')->where('payroll_number', '=', $staffMember['payroll_number'])->get();
         if ($check_admin == null) {
             return "Not Authorized";
         } else {
             // redirect the staff member to thier page depending on the school they admin..
             $is_auth = DB::table('administrators')->where('payroll_number', '=', $staffMember['payroll_number'])->select('administrators.state')->get();
             if ($is_auth != 'Authorised') {
                 return "Not Authorized";
             } else {
                 if ($department_staff_belongs_to == 'FIT') {
                     return redirect()->intended('/fit');
                 } else {
                     if ($department_staff_belongs_to == "SLS") {
                         return redirect()->intended('/sls');
                     } else {
                         if ($department_staff_belongs_to == "SBS") {
                             return redirect()->intended('/sbs');
                         } else {
                             if ($department_staff_belongs_to == "SFAE") {
                                 return redirect()->intended('/sfae');
                             } else {
                                 if ($department_staff_belongs_to == "CTH") {
                                     return redirect()->intended('/cth');
                                 } else {
                                     if ($department_staff_belongs_to == "SOA") {
                                         return redirect()->intended('/soa');
                                     } else {
                                         if ($department_staff_belongs_to == "MTI") {
                                             return redirect()->intended('/mti');
                                         } else {
                                             if ($department_staff_belongs_to == "SHSS") {
                                                 return redirect()->intended('/shss');
                                             } else {
                                                 if ($department_staff_belongs_to == "SMC") {
                                                     return redirect()->intended('/smc');
                                                 } else {
                                                     // if the admin does not admin a school. Query by department name
                                                     if ($department_staff_belongs_to == "CAFETERIA") {
                                                         return redirect()->intended('/cafeteria');
                                                     } else {
                                                         if ($department_staff_belongs_to == "LIBRARY") {
                                                             return redirect()->intended('/library');
                                                         } else {
                                                             if ($department_staff_belongs_to == "FINANCE") {
                                                                 return redirect()->intended('/finance');
                                                             } else {
                                                                 if ($department_staff_belongs_to == "FINANCIAL AID") {
                                                                     return redirect()->intended('/financialAid');
                                                                 } else {
                                                                     if ($department_staff_belongs_to == "GAMES") {
                                                                         return redirect()->intended('/games');
                                                                     } else {
                                                                         if ($department_staff_belongs_to == "EXTRA CURRICULAR ACTIVITIES") {
                                                                             return redirect()->intended('/extraCurricularActivities');
                                                                         }
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
//.........这里部分代码省略.........
开发者ID:bryan-mwas,项目名称:Clearance101,代码行数:101,代码来源:RedirectController.php

示例3: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $user = Auth::user()->regNo;
     //      Attempts to get details of the student who is logged in.
     $std = student::where('studentNo', '=', $user)->first();
     //        If the query has a result ...
     if ($std != null) {
         $charge = charges::where('students_studentNo', '=', $user)->first();
         $comment = comment::where('students_studentNo', '=', $user)->first();
         if ($std->state == 'Inactive') {
             return view('clearance.init');
         } else {
             return view('clearance.index')->with('std', $std)->with('charge', $charge)->with('comment', $comment);
             //return $charge;
         }
     } else {
         //            For a null result in the above $std query. This block of code executes.
         $admin = DB::table('schools')->where('schools.administrator', '=', $user)->pluck('department_name');
         if ($admin == "FIT") {
             return redirect()->intended('/fit');
         } else {
             if ($admin == "SLS") {
                 return redirect()->intended('/sls');
             } else {
                 if ($admin == "SBS") {
                     return redirect()->intended('/sbs');
                 } else {
                     if ($admin == "SFAE") {
                         return redirect()->intended('/sfae');
                     } else {
                         if ($admin == "CTH") {
                             return redirect()->intended('/cth');
                         } else {
                             if ($admin == "SOA") {
                                 return redirect()->intended('/soa');
                             } else {
                                 if ($admin == "MTI") {
                                     return redirect()->intended('/mti');
                                 } else {
                                     if ($admin == "SHSS") {
                                         return redirect()->intended('/shss');
                                     } else {
                                         if ($admin == "SMC") {
                                             return redirect()->intended('/smc');
                                         } else {
                                             if ($admin == "Cafeteria") {
                                                 return redirect()->intended('/cafeteria');
                                             } else {
                                                 if ($admin == "Library") {
                                                     return redirect()->intended('/library');
                                                 } else {
                                                     if ($admin == "Finance") {
                                                         return redirect()->intended('/finance');
                                                         // return Redirect::route('/finance', array('id' => $admin));
                                                     } else {
                                                         if ($admin == "Financial Aid") {
                                                             return redirect()->intended('/financialAid');
                                                         } else {
                                                             if ($admin == "Games") {
                                                                 return redirect()->intended('/games');
                                                             } else {
                                                                 if ($admin == "Extra-curricular") {
                                                                     return redirect()->intended('/extraCurricularActivities');
                                                                 } else {
                                                                     /*
                                                                      * For test purposes! Nerds ONLY!! ;-)
                                                                      * */
                                                                     return redirect()->intended('/vc');
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }
开发者ID:leloulight,项目名称:Clearance101,代码行数:90,代码来源:ViewsController.php


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