当前位置: 首页>>代码示例>>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;未经允许,请勿转载。