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


PHP OrderDetail::getOrderDetailsByIDOrderAndUserID方法代碼示例

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


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

示例1: scandinein

 public function scandinein()
 {
     if (Efiwebsetting::getData('checkOAuth') == 'yes') {
         IMBAuth::checkOAuth();
     }
     $json = array();
     $json['status_code'] = 1;
     $id_user = isset($_GET['id_user']) ? addslashes($_GET['id_user']) : "";
     if (!$id_user) {
         Generic::errorMsg("Please login!");
     }
     if (!User::checkUserID($id_user)) {
         Generic::errorMsg("ID User not found!");
     }
     $QR = isset($_GET['QR']) ? addslashes($_GET['QR']) : "";
     if (!$QR) {
         Generic::errorMsg("No QR found!");
     }
     $id_order = isset($_GET['id_order']) ? addslashes($_GET['id_order']) : "";
     if (!id_order) {
         Generic::errorMsg("id_order not found!");
     }
     if (!MasterOrder::isIdorderValid($id_order)) {
         Generic::errorMsg("id_order not found!");
     }
     $objTableHlp = Mastertable::getTableBYQR($QR);
     $objTable = new MasterTableModel();
     $objTable->getByID($objTableHlp[0]->id_table);
     $objTable->appOrder = "1";
     $objTable->id_order = $id_order;
     $objTable->status = "0";
     $objTable->waitingOrder = "2";
     $objTable->load = 1;
     $objTable->save();
     $objOrder = new MasterOrderModel();
     $objOrder->getByID($id_order);
     $objOrder->id_table = $objTableHlp[0]->id_table;
     $objOrder->type_order = "1";
     $objOrder->load = 1;
     $objOrder->save();
     $objOrderHlp = new MasterOrderModel();
     $arrOrder = $objOrderHlp->getWhere("id_user='{$id_user}' AND status_progress < 3 OR status_payment='0'");
     Generic::checkCountWithMsg($arrOrder, "No ID Order from the ID User found");
     $id_order = $arrOrder[0]->id_order;
     $order = MasterOrder::getOrder($id_order);
     $arrOrderDetails = OrderDetail::getOrderDetailsByIDOrderAndUserID($id_order, $id_user);
     $order['Order_Details'] = $arrOrderDetails;
     $order['restaurant'] = User::getRestaurant($order['id_restaurant']);
     $json['results'][] = $order;
     echo json_encode($json);
     die;
 }
開發者ID:CapsuleCorpIndonesia,項目名稱:martabak_revolution,代碼行數:52,代碼來源:Push.php

示例2: tambahOrder

 private function tambahOrder($idOrder, $idUser, $idDish, $qty)
 {
     echo "Tambah ORDER";
     $o = OrderDetail::getOrderDetailsByIDOrderAndUserID($idOrder, $idUser);
     pr($o);
 }
開發者ID:CapsuleCorpIndonesia,項目名稱:martabak_revolution,代碼行數:6,代碼來源:WS.php

示例3: reduceOrderInPendingOrder

 public function reduceOrderInPendingOrder()
 {
     if (Efiwebsetting::getData('checkOAuth') == 'yes') {
         IMBAuth::checkOAuth();
     }
     $json = array();
     $json['status_code'] = 1;
     $id_user = isset($_GET['id_user']) ? addslashes($_GET['id_user']) : "";
     if (!$id_user) {
         Generic::errorMsg("Please login!");
     }
     $id_order = isset($_GET['id_order']) ? addslashes($_GET['id_order']) : "";
     if (!$id_order) {
         Generic::errorMsg("ID Order not found!");
     }
     $id_dish = isset($_GET['id_dish']) ? addslashes($_GET['id_dish']) : "";
     if (!$id_dish) {
         Generic::errorMsg("ID Dish not found!");
     }
     $objOrder = new MasterOrderModel();
     $objOrder->getByID($id_order);
     $objOrderDetail = new OrderDetail();
     $isLeader = false;
     //     getcurrent qty dr iddish
     $currQuantity = OrderDetail::getQuantityUserByID_dish($id_dish, $id_order, $id_user);
     //        pr($currQuantity);
     //TODO CHECK apakah userId ini adalah leader, kalau iya set $isLeader = true
     if ($id_user == $objOrder->id_user) {
         $isLeader = true;
     }
     if ($isLeader) {
     } else {
         $objOrderDetail->getOrderDetailsByIDOrderAndUserID($id_order, $id_user);
         //TODO kalau sudah  0 ERROR message, else Kurangi quantity order sendiri
     }
     if ($currQuantity < 0) {
         Generic::errorMsg("remove order failed!");
         //TODO kalau sum order semua user dengan dish ini 0, ERROR message
         //TODO kalau order sendiri 0, kurangi order orang lain
         //TODO, else Kurangi quantity order sendiri
     } elseif ($currQuantity == 0) {
         Generic::errorMsg("remove order failed!");
     } else {
         $id = $this->addOrderDetails($id_order, $id_user, $id_dish, $currQuantity - 1);
         if (!$id) {
             Generic::errorMsg("remove order failed!");
         }
     }
     $objOrder = new MasterOrderModel();
     $objOrder->getByID($id_order);
     $invoice = $this->calcRechnung($objOrder->id_restaurant, $id_order);
     $this->setInvoiceInOrder($objOrder, $invoice);
     $objOrder->load = 1;
     $id_updateOrder = $objOrder->save();
     if (!$id_updateOrder) {
         Generic::errorMsg("Update Order failed!");
     }
     $json['results']['messages'] = "Success";
     $json['results']['invoice'] = $invoice;
     echo json_encode($json);
     die;
 }
開發者ID:CapsuleCorpIndonesia,項目名稱:martabak_revolution,代碼行數:62,代碼來源:MasterOrder.php


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