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