本文整理汇总了PHP中Order::getStatus方法的典型用法代码示例。如果您正苦于以下问题:PHP Order::getStatus方法的具体用法?PHP Order::getStatus怎么用?PHP Order::getStatus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Order
的用法示例。
在下文中一共展示了Order::getStatus方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testOrder
/**
* Test "Order"
*/
public function testOrder()
{
// initialize the API client
$order = new Order();
$order->setStatus("placed");
$this->assertSame("placed", $order->getStatus());
}
示例2: handleOrder
/**
* @param Order $order
* @return string
*/
public function handleOrder(Order $order)
{
if ($order->getStatus() === $this->orderStatus) {
return $this->sendNotification($order);
} elseif (!is_null($this->followingOrderNotification)) {
return $this->followingOrderNotification->handleOrder($order);
}
return '';
}
示例3: 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);
}
示例4: canEditOrder
public static function canEditOrder(Order $order, Role $role)
{
$canAcessOrderByStatus = in_array($order->getStatus()->getId(), self::canAccessOrderStatusIds($role));
switch ($role->getId()) {
case Role::ID_STORE_MANAGER:
case Role::ID_SYSTEM_ADMIN:
case Role::ID_PURCHASING:
case Role::ID_SALES:
return $canAcessOrderByStatus;
case Role::ID_ACCOUNTING:
return $canAcessOrderByStatus && !$order->getPassPaymentCheck();
case Role::ID_WAREHOUSE:
return $canAcessOrderByStatus && $order->getPassPaymentCheck();
}
}
示例5:
<tr>
<td><?php
echo $order['id'];
?>
</td>
<td><?php
echo Helper::setDate(1, $order['date']);
?>
</td>
<td class="ta_r">£<?php
echo number_format($order['total'], 2);
?>
</td>
<td class="ta_r">
<?php
$status = $objOrder->getStatus($order['status']);
echo $status['name'];
?>
</td>
<td class="ta_r">
<?php
echo $order['payment_status'] != null ? $order['payment_status'] : "Pending";
?>
</td>
<td class="ta_r">
<?php
if ($order['status'] == 1) {
?>
<a href="/admin/?page=orders&action=remove&id=<?php
echo $order['id'];
?>
示例6: getParams
private function getParams(Order $order)
{
$params = array(':id' => $order->getId(), ':status' => $order->getStatus(), ':assigned_to' => $order->getAssignedTo());
return $params;
}
示例7: foreach
<?php
foreach ($rows as $row) {
?>
<tr>
<td><?php
echo $row['id'];
?>
</td>
<td class="ta_r"><?php
echo Helper::setDate(1, $row['date']);
?>
</td>
<td class="ta_r">
<?php
$status = $objOrder->getStatus($row['status']);
echo $status['name'];
?>
</td>
<td class="ta_r">
£<?php
echo number_format($row['total'], 2);
?>
</td>
<td class="ta_r">
<?php
if ($row['pp_status'] == 1) {
echo '<a href="/?page=invoice&id=';
echo $row['id'];
echo '" target="_blank">Invoice</a>';
} else {
示例8: changeOrderVolume
public static function changeOrderVolume(Order $order, $newVolume)
{
if ($order->getStatus() != OrderStatus::ACTIVE || $newVolume == $order->getVolume()) {
return false;
}
$deal = new Deal();
$deal->findActiveDealByOrderId($order->getId());
$volumeDifference = $order->getVolume() - $newVolume;
if ($deal->getVolume() < $volumeDifference) {
return false;
}
$rate = new Rate();
$rate->findById($order->getRateId());
$purse = new Purse();
if ($order->getType() == OrderType::BUY) {
$purseSelect = Purse::findBy(array('UID' => $order->getUserId(), 'CurId' => $rate->getSecondCurrencyId()));
$purse->findById($purseSelect[0]['id']);
$difference = $order->getPrice() * $volumeDifference * (1.0 + $rate->getFee());
$purse->addValue($difference);
} else {
$purseSelect = Purse::findBy(array('UID' => $order->getUserId(), 'CurId' => $rate->getFirstCurrencyId()));
$purse->findById($purseSelect[0]['id']);
$purse->addValue($volumeDifference);
}
if ($purse->getValue() < 0) {
return false;
}
$purse->save();
$deal->setDate(date("Y-m-d H:i:s"));
$deal->setVolume($newVolume);
$deal->save();
$order->setVolume($newVolume);
$order->updatePart();
$order->save();
return true;
}
示例9: create
/**
*
* @param Customer $customer
* @param string $orderNo
* @param OrderStatus $status
* @param string $orderDate
* @param string $type
* @param string $isFromB2B
* @param Address $shipAddr
* @param Address $billAddr
*/
public static function create(Customer $customer, $type = self::TYPE_ORDER, $orderNo = null, $comments = '', OrderStatus $status = null, $orderDate = null, $isFromB2B = false, Address $shipAddr = null, Address $billAddr = null, $passPaymentCheck = false, $poNo = '', Order $cloneFrom = null)
{
$order = new Order();
$order->setOrderNo(trim($orderNo))->setCustomer($customer)->setStatus($status instanceof OrderStatus ? $status : OrderStatus::get(OrderStatus::ID_NEW))->setOrderDate(trim($orderDate) === '' ? trim(new UDate()) : trim($orderDate))->setIsFromB2B($isFromB2B)->setType(trim($type) === '' ? self::TYPE_ORDER : trim($type))->setShippingAddr($shipAddr instanceof Address ? $shipAddr : $customer->getShippingAddress())->setBillingAddr($billAddr instanceof Address ? $billAddr : $customer->getBillingAddress())->setPassPaymentCheck($passPaymentCheck)->setPONo(trim($poNo));
if ($cloneFrom instanceof Order) {
$counts = intval(OrderInfo::countByCriteria('value = ? and typeId = ?', array($cloneFrom->getOrderNo(), OrderInfoType::ID_CLONED_FROM_ORDER_NO)));
$newOrderNo = $cloneFrom->getOrderNo() . '-' . ($counts + 1);
$order->setOrderNo($newOrderNo);
$cloneFrom->addComment($msg = 'A new order has been clone from this order:' . $newOrderNo, Comments::TYPE_SYSTEM)->addLog($msg, Log::TYPE_SYSTEM);
}
$order->save();
if ($cloneFrom instanceof Order) {
$order->addInfo(OrderInfoType::ID_CLONED_FROM_ORDER_NO, $cloneFrom->getOrderNo(), true)->addComment($msg = 'Cloned from Order:' . $cloneFrom->getOrderNo(), Comments::TYPE_SYSTEM)->addLog($msg, Comments::TYPE_SYSTEM);
}
$order->addComment($comments, Comments::TYPE_NORMAL)->addInfo(OrderInfoType::ID_CUS_EMAIL, $customer->getEmail())->addInfo(OrderInfoType::ID_CUS_NAME, $customer->getName())->addLog('Order (OrderNo.=' . $order->getOrderNo() . ') created with status: ' . $order->getStatus()->getName(), Log::TYPE_SYSTEM, 'Auto Log', __CLASS__ . '::' . __FUNCTION__);
return $order;
}
示例10: update
public function update(Order $order)
{
$id = intval($order->getId());
$id_delivery = intval($order->getDelivery()->getId());
$id_billing = intval($order->getBilling()->getId());
$status = intval($order->getStatus());
$price = floatval($order->getPrice());
$date_update = date('Y-m-d H:i:s', strtotime($order->getDateUpdate()));
$date_pay = date('Y-m-d H:i:s', strtotime($order->getDatePay()));
$date_send = date('Y-m-d H:i:s', strtotime($order->getDateSend()));
$date_reception = date('Y-m-d H:i:s', strtotime($order->getDateReception()));
$query = ' UPDATE order
SET id_delivery = ' . $id_delivery . ',
id_billing = ' . $id_billing . ',
status = ' . $status . ',
price = ' . $price . ',
date_update = ' . $date_update . ',
date_pay = ' . $date_pay . ',
date_send = ' . $date_send . ',
date_reception = ' . $date_reception . '
WHERE id = ' . $id;
$res = $this->db->exec($query);
if ($res) {
return $this->readById($id);
} else {
throw new Exception('Internal server error');
}
}