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


PHP OrderDetail::getOrderDetailsByIDOrder方法代码示例

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


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

示例1: updateOrderHeaderStatusProgress

 private function updateOrderHeaderStatusProgress($idOrder)
 {
     $order = new MasterOrderModel();
     $order->getByID($idOrder);
     $od = OrderDetail::getOrderDetailsByIDOrder($idOrder);
     foreach ($od as $orderDetail) {
         if (!$order->status_progress == $orderDetail->status_progress) {
             $order->status_progress = min($order->status_progress, $orderDetail->status_progress);
         }
     }
     $order->save();
     return $order;
 }
开发者ID:CapsuleCorpIndonesia,项目名称:martabak_revolution,代码行数:13,代码来源:WS.php

示例2: cancelPendingOrder

 public function cancelPendingOrder()
 {
     $idOrder = Generic::mustCheck($_POST['id_order'], "ID Order Not Found");
     $idUser = Generic::mustCheck($_POST['id_user'], "ID User Not Found");
     $order = new MasterOrderModel();
     $order->getByID($idOrder);
     //reject if order already set
     if ($order->order_now == "1") {
         Generic::errorMsg("Order already been set");
     }
     $isLeader = $order->id_user == $idUser;
     if (!$isLeader) {
         $this->removeGuestOrder($idUser, $idOrder);
         $this->success();
     }
     //canceling order
     $order->status = "0";
     $order->save();
     $orderDetails = OrderDetail::getOrderDetailsByIDOrder($idOrder);
     foreach ($orderDetails as $orderDetail) {
         //canceling all detail order
         $oDetail = new OrderDetailModel();
         $oDetail->getByID($orderDetail['id_order']);
         $oDetail->status = "0";
         $oDetail->save();
     }
     $this->success();
 }
开发者ID:CapsuleCorpIndonesia,项目名称:martabak_revolution,代码行数:28,代码来源:FEU.php

示例3: emailExcelReportDayByDayOrder

 public function emailExcelReportDayByDayOrder()
 {
     if (Efiwebsetting::getData('checkOAuth') == 'yes') {
         IMBAuth::checkOAuth();
     }
     $idResto = $this->mustCheck($_GET['id_restaurant'], "NO ID Restaurant");
     $range = $_GET['range'] == null || $_GET['range'] == "" ? 30 : $_GET['range'];
     $extraQ = $this->selectTypeOrder($_GET['type_order']);
     $idServer = $_GET['id_user'];
     $extraQ .= $idServer == null || $idServer == "" || $idServer == "0" ? "" : "AND id_server='{$idServer}'";
     $extraQ .= $_GET['voided'] == null || $_GET['voided'] == "" || $_GET['voided'] == "0" ? " AND status_progress='4' " : "AND status_progress='9' AND voided='1'";
     $extraQ .= $_GET['status_payment'] == null || $_GET['status_payment'] == "" || $_GET['status_payment'] == "999" ? "" : "AND status_payment='" . $_GET['status_payment'] . "'";
     ///EXCEL
     $ex = array();
     $resto = new MasterRestaurantModel();
     $resto->getByID($idResto);
     $text = "Report\t" . $resto->name . "\t" . date('Y-m-d H:i:s') . "\n";
     $text .= "Interval\t{$range} day(s)\n";
     $text .= "Server\t";
     if ($idServer == null || $idServer == "" || $idServer == "0") {
         $text .= "All Server\n";
     } else {
         $sr = new RestaurantUserModel();
         $sr->getByID($idServer);
         $text .= $sr->name . "\n";
     }
     $text .= "Type Order\t" . Generic::selectStringTypeOrder($_GET['type_order']) . "\n";
     $text .= "Order Status\t";
     $text .= $_GET['voided'] == null || $_GET['voided'] == "" || $_GET['voided'] == "0" ? "Finished Order\n" : "Voided Order\n";
     $text .= "Payment Method\t" . $this->selectTypePayment($_GET['status_payment']) . "\n\n";
     for ($i = 0; $i <= $range; $i++) {
         $date = date('Y-m-d', strtotime("-{$i} days"));
         $o = new MasterOrderModel();
         if ($range == 999) {
             $arrO = $o->getWhere("id_restaurant='{$idResto}' {$extraQ}");
         } else {
             $arrO = $o->getWhere("id_restaurant='{$idResto}' AND DATE(datetime_order)='{$date}' {$extraQ}");
         }
         if (count($arrO) == 0) {
             continue;
         }
         $text .= "Order ID " . $arrO[0]->id_order . "\n";
         if ($arrO[0]->id_server != null || $arrO[0]->id_server != "" || $arrO[0]->id_server != "0") {
             unset($sr);
             $sr = new RestaurantUserModel();
             $sr->getByID($idServer);
             $text .= "Server\t" . $sr->name . "\n";
         }
         $text .= "Time Order\t" . leap_mysqldate_isi($arrO[0]->id_server) . "\n";
         $text .= "Total\t" . $arrO[0]->total_cost . "\n";
         $text .= $arrO[0]->disc_mr == 0 ? "" : "Disc MR\t" . $arrO[0]->disc_mr . "\n";
         $text .= $arrO[0]->disc_resto == 0 ? "" : "Disc Resto\t" . $arrO[0]->disc_resto . "\n";
         $text .= $arrO[0]->disc_bank == 0 ? "" : "Disc Bank\t" . $arrO[0]->disc_bank . "\n";
         $text .= $arrO[0]->disc_other == 0 ? "" : "Disc Other\t" . $arrO[0]->disc_other . "\n";
         $text .= $arrO[0]->tax_pb1 == 0 ? "" : "Tax PB 1\t" . $arrO[0]->tax_pb1 . "\n";
         $text .= $arrO[0]->service_charge == 0 ? "" : "Service Charge\t" . $arrO[0]->service_charge . "\n";
         $text .= $arrO[0]->other_charge == 0 ? "" : "Other Charge\t" . $arrO[0]->other_charge . "\n";
         $text .= "Grand Total\t" . $arrO[0]->grand_total . "\n";
         $text .= "ID Details\tDish Name\tQuantity\tPrice\tVoided\tNote\n";
         foreach ($arrO as $or) {
             $ex[] = $or;
             $detailsOrder = OrderDetail::getOrderDetailsByIDOrder($or->id_order);
             foreach ($detailsOrder as $dor) {
                 $text .= $dor['id_order_detail'] . "\t";
                 $text .= $dor['name'] . "\t";
                 $text .= $dor['quantity'] . "\t";
                 $text .= $dor['price'] . "\t";
                 $text .= $dor['voided'] == "1" ? "YES\t" : "NO\t";
                 $text .= $dor['note'] . "\t";
                 $text .= "\n";
             }
         }
         $text .= "\n\n";
     }
     if (count($ex) <= 0) {
         //            Generic::errorMsg("Empty Record");
         $text .= "EMPTY RECORD\n\n";
     }
     $title = "Report_" . $resto->name . "_" . 1000 * strtotime(date('Y-m-d H:i:s'));
     header("Content-Disposition: attachment; filename=\"{$title}\".xls");
     header("Content-Type: application/vnd.ms-excel");
     $file = fopen($title, "w+");
     fwrite($file, $text);
     fclose($file);
     die;
 }
开发者ID:CapsuleCorpIndonesia,项目名称:martabak_revolution,代码行数:86,代码来源:GENI.php

示例4: getNormalDineInOrderByRestoId

 public function getNormalDineInOrderByRestoId()
 {
     $id_restaurant = Generic::mustCheck($_GET["id_restaurant"], "No ID Restaurant Found!");
     $status_progress = Generic::mustCheck($_GET["status_progress"], "No Status Progress Found!");
     $type_order = Generic::mustCheck($_GET["type_order"], "No Type Order Found");
     $date = $_GET["date"];
     $json['status_code'] = 1;
     $queryBuilder = "id_restaurant='{$id_restaurant}' AND status_progress='{$status_progress}' AND type_order ='{$type_order}' ";
     if (isset($date)) {
         $queryBuilder .= " AND datetime_order LIKE '{$date}% '";
     }
     $queryBuilder .= " ORDER BY datetime_order DESC ";
     $o = new MasterOrderModel();
     $arrOrder = $o->getWhere($queryBuilder);
     $isDineIn = $type_order == "0" || $type_order == "1" ? true : false;
     $isAppOrder = $type_order == "1" || $type_order == "3" ? true : false;
     $c = array();
     foreach ($arrOrder as $order) {
         $table = new MasterTableModel();
         $table->getByID($order->id_table);
         $user = new UserModel();
         $user->getByID($order->id_user);
         $isPaid = $order->status_payment == "1" ? true : false;
         $allUsersIds = trim($order->id_user . $order->user_guest_id);
         if (count($allUsersIds) > 0) {
             foreach ($allUsersIds as $userId) {
                 $u[] = User::getUser($userId);
             }
         } else {
         }
         $c[] = array('table_number' => $table->table_number, 'type_order' => $order->type_order, 'server_name' => $order->server_name, 'datetime_order' => $order->datetime_order, 'id_restaurant' => $order->id_restaurant, 'id_user' => $order->id_user, 'user_guest_id' => $order->user_guest_id, 'full_name' => $user->full_name, 'grand_total' => $order->grand_total, 'status_progress' => $order->status_progress, 'status_payment' => $order->status_payment, 'status' => $order->status, 'allUsersIds' => $allUsersIds, 'isDineIn' => $isDineIn, 'IsAppOrder' => $isAppOrder, 'isPaid' => $isPaid, 'detail_orders' => OrderDetail::getOrderDetailsByIDOrder($order->id_order));
     }
     $json['results']["orders"] = $c;
     echo json_encode($json);
     die;
 }
开发者ID:CapsuleCorpIndonesia,项目名称:martabak_revolution,代码行数:36,代码来源:Report.php


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