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


PHP DB::delete方法代码示例

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


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

示例1: KisiSil

 function KisiSil()
 {
     \Auth::logout();
     \Session::flush();
     \DB::delete('delete from users WHERE name = ?', [\Request::input('isim')]);
     return \Redirect::to('auth/register');
 }
开发者ID:hramose,项目名称:Laravel5-Admin-3,代码行数:7,代码来源:TekinController.php

示例2: show

 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     \DB::delete('delete from levels where id = ?', [$id]);
     return redirect('level');
 }
开发者ID:Taufik10,项目名称:Orgz_chart,代码行数:11,代码来源:LevelController.php

示例3: postEditload

 public function postEditload($id)
 {
     if (\Auth::check()) {
         $action = \Input::get('action');
         $data = \Input::all();
         //  dd($data);
         if ($action == 'delete') {
             \DB::delete('delete from faculty_load where id =' . $id);
         } else {
             if ($action == 'save') {
                 \DB::table('faculty_load')->where('id', $id)->update(array('subject' => $data['subject'], 'class' => $data['section'], 'semester' => $data['semester'], 'subj_code' => $data['subcode'], 'school_year_sy' => $data['sy'], 'school_year_users_id' => $data['id'], 'units' => $data['units']));
                 // \DB::update('update faculty_load set subject = .'.$data['subject'].',class=.$data['section'].', semester, subj_code, school_year_sy, school_year_users_id, year, units where id =' . $id);
             }
         }
     }
     return \Redirect::back();
 }
开发者ID:must-classrecord,项目名称:must-classrecord.github.io,代码行数:17,代码来源:MainController.php

示例4: moderationRecord

 public function moderationRecord($p_id, $status)
 {
     if (\Auth::user()->admin == true) {
         if (\DB::select('select 1 from moderation where p_id = ?', [$p_id])) {
             $p_admin = \Auth::user()->name;
             $date = new \DateTime();
             $results = \DB::select('select * from moderation where p_id = ?', [$p_id]);
             if ($status == 'approve') {
                 foreach ($results as $result) {
                     \DB::insert('insert into public.log_moderation (p_id, p_cat, p_admin, p_status, created_at, updated_at) values (?, ?, ?, ?, ?, ?)', [$p_id, $result->p_cat, $p_admin, 'available', $date, $date]);
                     \DB::insert('insert into stream.stream_' . $result->p_cat . ' (p_id, p_cat, p_ouser, p_title, p_caption, p_imgurl, p_status, p_reported, p_rating, created_at, updated_at) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', [$result->p_id, $result->p_cat, $result->p_ouser, $result->p_title, $result->p_caption, $result->p_imgurl, 'available', $result->p_reported, $result->p_rating, $result->created_at, $date]);
                     \DB::delete('delete from public.moderation where p_id = ?', [$p_id]);
                     // Membuat tabel baru.
                     \Schema::create('comment.comment_' . $result->p_id, function ($table) {
                         $table->string('c_ouser', 120);
                         $table->string('c_favor');
                         $table->text('c_comment', 1000);
                         $table->string('avatar');
                         $table->timestamps();
                     });
                 }
                 $messages = 'The publication has been approved.';
                 return redirect('/admin/moderation')->with('messages', $messages);
             } elseif ($status == 'deny') {
                 foreach ($results as $result) {
                     \DB::insert('insert into public.log_moderation (p_id, p_cat, p_admin, p_status, created_at, updated_at) values (?, ?, ?, ?, ?, ?)', [$p_id, $result->p_cat, $p_admin, 'denied', $date, $date]);
                     \DB::insert('insert into stream.stream_' . $result->p_cat . ' (p_id, p_cat, p_ouser, p_title, p_caption, p_imgurl, p_status, p_reported, p_rating, created_at, updated_at) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', [$result->p_id, $result->p_cat, $result->p_ouser, $result->p_title, $result->p_caption, $result->p_imgurl, 'denied', $result->p_reported, $result->p_rating, $result->created_at, $date]);
                     \DB::delete('delete from public.moderation where p_id = ?', [$p_id]);
                 }
                 $messages = 'The publication has been denied.';
                 return redirect('/admin/moderation')->with('messages', $messages);
             } else {
                 $messages = 'The processing status is not valid, only "approve" or "deny".';
                 return redirect('/admin/moderation')->with('messages', $messages);
             }
         } else {
             $messages = 'There is no such publication, or publication has been processed.';
             return redirect('/admin/moderation')->with('messages', $messages);
         }
     } else {
         $messages = 'You are not an admin. No rights to access administration area.';
         return redirect('/system/notification')->with('messages', $messages);
     }
 }
开发者ID:chandrairawan,项目名称:nosproject,代码行数:44,代码来源:AdminController.php

示例5: getConfirmWithParam

 public function getConfirmWithParam($action, $id)
 {
     if ($action == 1) {
         if (\DB::table('auth_telegram')->where('id', $id)->where('confirmed', false)->update(['confirmed' => true])) {
             $messages = 'A User is Confirmed.';
             return redirect('/confirm')->with('messages', $messages);
         } else {
             $messages = 'Error.';
             return redirect('/confirm')->with('messages', $messages);
         }
     } elseif ($action == 2) {
         if (\DB::table('auth_telegram')->where('id', $id)->where('confirmed', true)->update(['confirmed' => false])) {
             $messages = 'A User is Released.';
             return redirect('/confirm')->with('messages', $messages);
         } else {
             $messages = 'Error.';
             return redirect('/confirm')->with('messages', $messages);
         }
     } elseif ($action == 3) {
         if (\DB::delete('delete from auth_telegram where id = ? and confirmed = false', [$id])) {
             $messages = 'A User is Deleted.';
             return redirect('/confirm')->with('messages', $messages);
         } else {
             $messages = 'Error.';
             return redirect('/confirm')->with('messages', $messages);
         }
     } else {
         $messages = 'Error.';
         return redirect('/confirm')->with('messages', $messages);
     }
 }
开发者ID:taufiky1994,项目名称:BotAutomation,代码行数:31,代码来源:UserController.php

示例6: edit

 public function edit()
 {
     //check for integer in quantity
     if (!(Input::get('quantity') >= 0 && Input::get('quantity') < 1000)) {
         Session::flash('type', "danger");
         Session::flash('message', "Please enter a quantity between 1 and 1000");
         return Redirect::back();
     }
     if (!Auth::check()) {
         //create unregistered user and a new make for them
         $user = new User();
         $user->save();
         Auth::login($user);
     }
     //save cookes for new user
     if (!Session::has('order')) {
         //create new order
         $order = new Order();
         $order->user_id = Auth::user()->id;
         $order->status = 'Open';
         $order->save();
         Session::put('order', $order->id);
         Session::put('orderCount', 0);
     }
     //return Session::has('order');
     $quantity = Input::get('quantity');
     $product_id = Input::get('product_id');
     $colour_hex = Input::get('colour_hex');
     $colour_name = Input::get('colour_name');
     $action_id = Input::get('action_id');
     $order = Order::with('product')->find(Session::get('order'));
     //if order bnot open then send to dash with message
     if ($order->status !== 'Quote' && $order->status !== 'Open') {
         Session::flash('message', 'This order is locked. Please click \'Start a new quote\' below to begin another order');
         Session::flash('alert-class', "alert-danger");
         return Redirect::to('users/dashboard');
     }
     //return $order;
     //derach product is the same as existing
     //$order->product()->detach($product_id, ['hex' => $colour_hex]);
     \DB::delete('delete from order_product where order_id = ? AND product_id = ? AND hex = ?', array($order->id, $product_id, $colour_hex));
     //attach if not 0
     if (Input::get('quantity') != 0) {
         $order->product()->attach($product_id, ['quantity' => $quantity, 'colour' => $colour_name, 'hex' => $colour_hex]);
     }
     //count them again
     $updatedOrder = Order::with('product')->find(Session::get('order'));
     $orderCount = 0;
     foreach ($updatedOrder->product as $products) {
         $orderCount = $orderCount + 1;
     }
     //return $orderCount;
     Session::put('orderCount', $orderCount);
     //set message depending od whethet order is open or quote
     if ($order->status !== 'Open') {
         Session::flash('registerMessage', "You are updating an existing quote. When you are happy please click the green button below to confirm your update.");
         Session::flash('type', "danger");
         return redirect()->route('orders.show', [$order->id]);
     }
     //updating quantities
     if ($action_id == 'update') {
         return redirect()->route('orders.show', [$order->id]);
     }
     Session::flash('message', $quantity . " of these have been added to your quote");
     Session::flash('type', "success");
     return Redirect::back()->withCookie(cookie('user_id', Auth::user()->id, 3600));
     //return $quantity;
 }
开发者ID:tommarshallandrews,项目名称:gloseventhire,代码行数:68,代码来源:OrdersController.php


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