當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Sections::find方法代碼示例

本文整理匯總了PHP中Sections::find方法的典型用法代碼示例。如果您正苦於以下問題:PHP Sections::find方法的具體用法?PHP Sections::find怎麽用?PHP Sections::find使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Sections的用法示例。


在下文中一共展示了Sections::find方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: postDeleteSections

 public function postDeleteSections()
 {
     $section_id = Input::get('section_id');
     $section_name = Input::get('section_name');
     $class_id = Input::get('class_id');
     if ($section_id) {
         $sections = Sections::find($section_id);
     } else {
         $sections = Sections::where('section_name', '=', $section_name)->where('class_id', '=', $class_id);
     }
     if ($sections->delete()) {
         $response = array('status' => 'success', 'msg' => 'Setting created successfully', 'deleted_item_id' => $section_id);
         return Response::json($response);
     } else {
         $response = array('status' => 'failed', 'msg' => 'Item is Not deleted', 'Item_id' => $section_id);
         return Response::json($response);
     }
 }
開發者ID:vivekjaiswal90,項目名稱:schoolopedia,代碼行數:18,代碼來源:AdminTimeTableController.php

示例2: getDelete

 public function getDelete($id = '')
 {
     if ($id == '') {
         return Redirect::to($this->route)->with('msg_error', Lang::get('messages.sections_display_err'));
     } else {
         $section = Sections::find($id);
         $delete = Sections::destroy($id);
         if (!$delete) {
             return Redirect::to($this->route . '/trash')->with('msg_error', Lang::get('messages.sections_delete_err', array('title' => $section->title, 'description' => $section->description, 'file' => $section->file)));
         } else {
             return Redirect::to($this->route . '/trash')->with('msg_success', Lang::get('messages.sections_delete', array('title' => $section->title, 'description' => $section->description, 'file' => $section->file)));
         }
     }
 }
開發者ID:nagyist,項目名稱:abge,代碼行數:14,代碼來源:SectionController.php

示例3: getSchoolStudents

 public function getSchoolStudents()
 {
     $query = "select\n                        users.id,\n                        users.school_id,\n                        user_details.username,\n                        user_details.first_name,\n                        user_details.last_name,\n                        users_to_class.class_id,\n                        users_to_class.section_id,\n                        user_details.pic\n                  from users\n                  join users_groups\n                  on users.id=users_groups.user_id and users_groups.groups_id=? and users.school_id=?\n                  join user_details\n                  on users.id=user_details.user_id\n                  join users_to_class\n                  on users_to_class.user_id=users.id";
     $all_school_users = DB::select($query, array(2, $this->getSchoolId()));
     $i = 0;
     foreach ($all_school_users as $all_school_user) {
         $class = Classes::find($all_school_user->class_id)->get()->first();
         $all_users[$i]['class_name'] = $class->class;
         $section = Sections::find($all_school_user->section_id);
         $all_users[$i]['section_name'] = $section->section_name;
         $all_users[$i]['username'] = $all_school_user->username;
         $all_users[$i]['first_name'] = $all_school_user->first_name;
         $all_users[$i]['last_name'] = $all_school_user->last_name;
         $all_users[$i]['pic'] = $all_school_user->pic;
         $all_users[$i]['id'] = $all_school_user->id;
         $all_users[$i]['school_id'] = $all_school_user->school_id;
         $i++;
     }
     return View::make('admin.school-students')->with('users', $all_users);
 }
開發者ID:vivekjaiswal90,項目名稱:schoolopedia,代碼行數:20,代碼來源:SchoolSettingsController.php


注:本文中的Sections::find方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。