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


PHP Order::setStatus方法代码示例

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


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

示例1: map

 public static function map(Order $order, array $properties)
 {
     if (array_key_exists('id', $properties)) {
         $order->setId($properties['id']);
     }
     if (array_key_exists('user_id', $properties)) {
         $order->setUserId($properties['user_id']);
     }
     if (array_key_exists('business_id', $properties)) {
         $order->setBusinessId($properties['business_id']);
     }
     if (array_key_exists('order_date', $properties)) {
         $formattedDate = $properties['order_date'];
         $orderDate = self::createDateTime($formattedDate);
         if ($orderDate) {
             $order->setDate($orderDate);
         }
     }
     if (array_key_exists('status', $properties)) {
         $order->setStatus($properties['status']);
     }
     if (array_key_exists('assigned_to', $properties)) {
         $order->setAssignedTo($properties['assigned_to']);
     }
     if (array_key_exists('order_details', $properties)) {
         $order->setOrderDetails($properties['order_details']);
     }
 }
开发者ID:beshad,项目名称:dropoff_1_DEC,代码行数:28,代码来源:OrderMapper.php

示例2: createOrder

 public function createOrder(Order $order)
 {
     $order->setId(null);
     $order->setStatus(Order::PENDING);
     $sql = '
         INSERT INTO orders_tb(id,user_id,business_id,order_date,status,order_details)
             VALUES (:id,:user_id,:business_id,:order_date,:status,:order_details)';
     $params = array(':id' => $order->getId(), ':user_id' => $_SESSION['user_id'], ':business_id' => $_POST['business']['id'], ':order_date' => self::formatDateTime($order->getDate()), 'status' => $order->getStatus(), 'order_details' => $order->getOrderDetails());
     return $this->execute($sql, $order, $params);
 }
开发者ID:beshad,项目名称:dropoff_1_DEC,代码行数:10,代码来源:OrderDao.php

示例3: getOrder

 /**
  * @param $orderID
  * @return Order
  */
 public function getOrder($orderID)
 {
     APIWrapper::verifyReadiness();
     $requestURL = "https://app.fetchapp.com/api/v2/orders/" . $orderID;
     $results = APIWrapper::makeRequest($requestURL, "GET");
     if (is_a($results, "SimpleXMLElement")) {
         $tempOrder = new Order();
         $tempOrder->setOrderID($results->id);
         $tempOrder->setVendorID($results->vendor_id);
         $tempOrder->setFirstName($results->first_name);
         $tempOrder->setLastName($results->last_name);
         $tempOrder->setEmailAddress($results->email);
         $tempOrder->setTotal($results->total);
         $tempOrder->setCurrency(Currency::getValue($results->currency));
         $tempOrder->setStatus(OrderStatus::getValue($results->status));
         $tempOrder->setProductCount($results->product_count);
         $tempOrder->setDownloadCount($results->download_count);
         $tempOrder->setExpirationDate(new \DateTime($results->expiration_date));
         $tempOrder->setDownloadLimit($results->download_limit);
         if (!isset($results->custom1['nil'])) {
             $tempOrder->setCustom1($results->custom1);
         } else {
             $tempOrder->setCustom1(null);
         }
         if (!isset($results->custom2['nil'])) {
             $tempOrder->setCustom2($results->custom2);
         } else {
             $tempOrder->setCustom2(null);
         }
         if (!isset($results->custom3['nil'])) {
             $tempOrder->setCustom3($results->custom3);
         } else {
             $tempOrder->setCustom3(null);
         }
         $tempOrder->setCreationDate(new \DateTime($results->created_at));
         $tempOrder->setLink($results->link['href']);
     }
     return $tempOrder;
 }
开发者ID:themgt,项目名称:fetchapp-php-2.0,代码行数:43,代码来源:FetchApp.php

示例4: testOrderException

 /**
  * @expectedException InvalidArgumentException
  */
 public function testOrderException()
 {
     // initialize the API client
     $order = new Order();
     $order->setStatus("invalid_value");
 }
开发者ID:mateuszmackowiak,项目名称:swagger-codegen,代码行数:9,代码来源:OrderTest.php

示例5: Order

$SortName = "";
$SortType = true;
$filterOrd = new Order();
if (isset($_POST['OrderID']) & !empty($_POST['OrderID'])) {
    $filterOrd->setOrderID($_POST['OrderID']);
}
if (isset($_POST['UserID']) & !empty($_POST['UserID'])) {
    require_once "../entities/User.php";
    $filterOrd->setUser(new User($_POST['UserID']));
}
if (isset($_POST['Total']) & !empty($_POST['Total'])) {
    $filterOrd->setTotal($_POST['Total']);
}
if (isset($_POST['Status']) & !empty($_POST['Status'])) {
    require_once "../entities/Status.php";
    $filterOrd->setStatus(new Status($_POST['Status']));
}
if (isset($_POST['SortName']) & !empty($_POST['SortName'])) {
    $SortName = $_POST['SortName'];
}
if (isset($_POST['SortType']) & !empty($_POST['SortType'])) {
    $SortType = $_POST['SortType'];
}
$numberOfRows = $filterOrd->countRecords();
// Số lượng dòng của bảng
$ListOrders = array();
if ($rowsPerPage == -1) {
    // nếu là chọn hiển thị là ALL
    $rowsPerPage = $numberOfRows;
    $ListOrders = $filterOrd->loadLimit($rowsPerPage, 0, $SortName, $SortType);
} else {
开发者ID:luvyatyss,项目名称:nashop,代码行数:31,代码来源:ordersBody.php

示例6: Controls

 $page->addJavascript("assets/js/sweetalert/sweetalert.min.js");
 $page->addJavascript("assets/js/jRange-master/jquery.range.js");
 $page->startBody();
 $update = null;
 $control = new Controls(Controls::Insert);
 //Chưa chọn loại sản phẩm;
 $Order = new Order();
 $maxTotal = Order::getValueMaxColName('Total');
 $maxTotal = empty($maxTotal) ? 0 : ceil($maxTotal / 1000000);
 // /1 triệu đồng
 if (isset($_POST["btnSave"])) {
     if (isset($_POST["txtOrderID"])) {
         $Order->setOrderID($_POST["txtOrderID"]);
     }
     if (isset($_POST["cboStatus"])) {
         $Order->setStatus(new Status($_POST["cboStatus"]));
     }
     $Order->update();
     $update = true;
 } else {
     if (isset($_GET["OrderID"]) && isset($_GET["control"])) {
         $Order = Order::getOrder($_GET["OrderID"]);
         if ($Order != null) {
             echo "<script> \$(function () { \$(window).load(function(){ \$('#modalOrder').modal( { backdrop: 'static', keyboard: false }, 'show');});  });</script>";
         } else {
             require_once '../helper/Utils.php';
             $url = "orders.php";
             Utils::Redirect($url);
         }
     }
 }
开发者ID:luvyatyss,项目名称:nashop,代码行数:31,代码来源:orders.php

示例7: completeOrder

 public function completeOrder($tid)
 {
     $transaction = Transaction::getTransactionBasedOnTID($tid);
     $user = new User($transaction->getUser());
     $order = new Order();
     $order->setTid($transaction->getTid());
     $order->setUser($transaction->getUser());
     $order->setCustomerName($user->getName());
     $order->setUserEmail($user->getEmail());
     $order->setPhone($transaction->getPhone());
     $order->setShippingStreet($transaction->getShippingStreet());
     $order->setShippingCity($transaction->getShippingCity());
     $order->setShippingPostal($transaction->getShippingPostal());
     $order->setShippingProvince($transaction->getShippingProvince());
     $order->setShippingCountry($transaction->getShippingCountry());
     $order->setBillingStreet($transaction->getBillingStreet());
     $order->setBillingCity($transaction->getBillingCity());
     $order->setBillingPostal($transaction->getBillingPostal());
     $order->setBillingProvince($transaction->getBillingProvince());
     $order->setBillingCountry($transaction->getBillingCountry());
     $order->setCostSubtotal($transaction->getCostSubtotal());
     $order->setCostTax($transaction->getCostTax());
     $order->setCostShipping($transaction->getCostShipping());
     $order->setCostTotal($transaction->getCostTotal());
     $order->setIp($transaction->getIp());
     $order->setShippingClass($transaction->getShippingClass());
     $order->setPaymentClass($transaction->getPaymentClass());
     $order->setDeliveryInstructions($transaction->getDeliveryInstructions());
     $order->setStatus('Pending');
     $order->save();
     $cartItems = CartItem::getAll($transaction->getSession());
     foreach ($cartItems as $cartItem) {
         $product = new Product($cartItem->getProduct());
         $orderDetail = new OrderDetail();
         $orderDetail->setOrderNb($order->getId());
         $orderDetail->setProduct($product->getId());
         $orderDetail->setProductName($product->getName());
         $orderDetail->setQuantity($cartItem->getQuantity());
         $orderDetail->save();
         $cartItem->delete();
     }
     $transaction->delete();
     //Send an email to the user
     $this->sendEmailOrderComplete($order->getId());
     return true;
 }
开发者ID:anas,项目名称:feedstore,代码行数:46,代码来源:EComm.php

示例8: makeDealsWith

 private static function makeDealsWith(Deal $deal)
 {
     $order = new Order();
     $order->findById($deal->getOrderId());
     if ($order->getType() == OrderType::SELL) {
         $oppositeDeals = Deal::getOpenedBuyDeals($order->getPrice(), $order->getRateId());
     } else {
         $oppositeDeals = Deal::getOpenedSellDeals($order->getPrice(), $order->getRateId());
     }
     foreach ($oppositeDeals as $oppDeal) {
         $oppositeDeal = new Deal();
         $oppositeDeal->findById($oppDeal['id']);
         $oppositeOrder = new Order();
         $oppositeOrder->findById($oppositeDeal->getOrderId());
         $difference = $deal->getVolume() - $oppositeDeal->getVolume();
         if ($difference == 0) {
             $deal->setPrice($oppositeDeal->getPrice());
             $deal->setDone(1);
             $deal->save();
             $order->setPart(1.0);
             $order->setStatus(OrderStatus::DONE);
             $order->save();
             $oppositeDeal->setDone(1);
             $oppositeDeal->setDate($deal->getDate());
             $oppositeDeal->save();
             $oppositeOrder->setPart(1.0);
             $oppositeOrder->setStatus(OrderStatus::DONE);
             $oppositeOrder->setDate($deal->getDate());
             $oppositeOrder->save();
             self::transferMoney($deal, $oppositeDeal);
             break;
         }
         $intermediateDeal = new Deal();
         $intermediateDeal->setRateId($order->getRateId());
         $intermediateDeal->setDate($deal->getDate());
         $intermediateDeal->setDone(1);
         if ($difference < 0) {
             $deal->setPrice($oppositeDeal->getPrice());
             $deal->setDone(1);
             $deal->save();
             $order->setPart(1.0);
             $order->setStatus(OrderStatus::DONE);
             $order->save();
             $intermediateDeal->setOrderId($oppositeOrder->getId());
             $intermediateDeal->setUserId($oppositeOrder->getUserId());
             $intermediateDeal->setType($oppositeOrder->getType());
             $intermediateDeal->setPrice($oppositeDeal->getPrice());
             $intermediateDeal->setVolume($deal->getVolume());
             $intermediateDeal->insert();
             $oppositeOrder->updatePart();
             $oppositeOrder->setDate($deal->getDate());
             $oppositeOrder->save();
             $oppositeDeal->setVolume(-$difference);
             $oppositeDeal->setDate($deal->getDate());
             $oppositeDeal->save();
             self::transferMoney($deal, $intermediateDeal);
             break;
         } else {
             $deal->setVolume($difference);
             $deal->save();
             $intermediateDeal->setOrderId($order->getId());
             $intermediateDeal->setUserId($order->getUserId());
             $intermediateDeal->setType($order->getType());
             $intermediateDeal->setPrice($oppositeDeal->getPrice());
             $intermediateDeal->setVolume($oppositeDeal->getVolume());
             $intermediateDeal->insert();
             $order->updatePart();
             $order->save();
             $oppositeDeal->setDone(1);
             $oppositeDeal->setDate($deal->getDate());
             $oppositeDeal->save();
             $oppositeOrder->setPart(1.0);
             $oppositeOrder->setStatus(OrderStatus::DONE);
             $oppositeOrder->setDate($deal->getDate());
             $oppositeOrder->save();
             self::transferMoney($intermediateDeal, $oppositeDeal);
         }
     }
 }
开发者ID:Christian1998,项目名称:php_btc_exchange,代码行数:79,代码来源:OrderModel.php


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