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


PHP Order::destroy方法代碼示例

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


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

示例1: destroy

 public function destroy(Request $request, $id)
 {
     empty($id) && !empty($request->input('id')) && ($id = $request->input('id'));
     $id = (array) $id;
     foreach ($id as $v) {
         $order = Order::destroy($v);
     }
     return $this->success('', count($id) > 5, compact('id'));
 }
開發者ID:unionbt,項目名稱:hanpaimall,代碼行數:9,代碼來源:OrderController.php

示例2: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  *
  * @return Response
  */
 public function destroy($id)
 {
     Order::destroy($id);
     Session::flash('flash_message', 'Order deleted!');
     return redirect('admin/orders');
 }
開發者ID:ercancavusoglu,項目名稱:CRUD-Ecommerce,代碼行數:13,代碼來源:OrdersController.php

示例3: orderDelete

 function orderDelete($order_id)
 {
     if (\App\Order::findOrFail($order_id)) {
         \App\Order::destroy($order_id);
         \App\Item::where('order_id', $order_id)->delete();
         return redirect("users/orders")->with('warning', 'Order deleted successfully!');
     } else {
         return redirect("users/orders")->with('error', 'Unable to find the order. Please try again.');
     }
 }
開發者ID:susmithageorge,項目名稱:aslu_order_system,代碼行數:10,代碼來源:UsersController.php

示例4: deleteOrder

 public function deleteOrder($id)
 {
     Order::destroy($id);
 }
開發者ID:HomeFurnitures,項目名稱:HomeDecoWS,代碼行數:4,代碼來源:OrderService.php

示例5: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy(Request $request)
 {
     $rp_arr = [];
     $user = \Auth::user();
     if ($user->role->name != ('admin' or 'root')) {
         // Permission denied
     } else {
         $data = $request->json()->get('data');
         $lookUpArr = [];
         for ($i = 0; $i < count($data); $i++) {
             /*$from = Carbon::parse($data[$i]['from']);
                             $to = Carbon::parse($data[$i]['to']);
                             $location_id = \App\Location::where('name', $data[$i]['location'])->first()['id'];
             
                             \App\Order::where('from', $from)->where('to', $to)->where('location_id', $location_id)->delete();*/
             $id = $data[$i]['id'];
             $order = \App\Order::findOrFail($id);
             array_push($lookUpArr, ['from' => $order->from, 'to' => $order->to, 'location_id' => $order->location_id]);
             \App\Order::destroy($id);
         }
         $lookUpArr = array_unique($lookUpArr, SORT_REGULAR);
         foreach ($lookUpArr as $value) {
             $from = Carbon::parse($value['from']);
             $to = Carbon::parse($value['to']);
             $location_id = $value['location_id'];
             $num_of_ordered = \App\Order::where('from', $from)->where('to', $to)->where('location_id', $location_id)->count();
             $allowance = \App\Location::findOrFail($location_id)->capacity;
             if ($num_of_ordered < $allowance) {
                 if ($num_of_ordered == 0) {
                     array_push($rp_arr, ['from' => $value['from'], 'to' => $value['to'], 'status' => '-1']);
                 } else {
                     array_push($rp_arr, ['from' => $value['from'], 'to' => $value['to'], 'status' => '1']);
                 }
             } else {
                 array_push($rp_arr, ['from' => $value['from'], 'to' => $value['to'], 'status' => '0']);
             }
         }
     }
     return response()->json(['data' => $rp_arr]);
 }
開發者ID:soniczhangss,項目名稱:Ordering-System,代碼行數:46,代碼來源:OrdersController.php

示例6: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     //
     Order::destroy($id);
     return redirect()->route('orders');
 }
開發者ID:sharpscar,項目名稱:becomeus,代碼行數:12,代碼來源:OrderController.php


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