本文整理汇总了PHP中Purchase::getStatus方法的典型用法代码示例。如果您正苦于以下问题:PHP Purchase::getStatus方法的具体用法?PHP Purchase::getStatus怎么用?PHP Purchase::getStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Purchase
的用法示例。
在下文中一共展示了Purchase::getStatus方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
public static function save(DB $db, Purchase $p)
{
$stmt = $db->prepare('
UPDATE `purchases`
SET `currency_amount` = :currency_amount,
`bitcoin_amount` = :bitcoin_amount,
`txid` = :txid,
`ntxid` = :ntxid,
`status` = :status,
`message` = :message,
`notice` = :notice,
`email_to_notify` = :email_to_notify
WHERE `id` = :id
');
$result = $stmt->execute(array(':id' => $p->getId(), ':currency_amount' => $p->getCurrencyAmount(), ':bitcoin_amount' => $p->getBitcoinAmount(), ':txid' => $p->getTXID(), ':ntxid' => $p->getNTXID(), ':message' => $p->getMessage(), ':notice' => $p->getNotice(), ':status' => $p->getStatus(), ':email_to_notify' => $p->getEmailToNotify()));
return $result;
}
示例2: executeDsrmulti
public function executeDsrmulti(sfWebRequest $request)
{
$requestparams = $request->getParameter("invoice");
$day = $requestparams["date"]["day"];
$month = $requestparams["date"]["month"];
$year = $requestparams["date"]["year"];
$invoice = new Invoice();
if (!$day or !$month or !$year) {
$invoice->setDate(MyDate::today());
} else {
$invoice->setDate($year . "-" . $month . "-" . $day);
}
$requestparams = $request->getParameter("purchase");
$day = $requestparams["date"]["day"];
$month = $requestparams["date"]["month"];
$year = $requestparams["date"]["year"];
$purchase = new Purchase();
if (!$day or !$month or !$year) {
$purchase->setDate(MyDate::today());
} else {
$purchase->setDate($year . "-" . $month . "-" . $day);
}
$this->form = new InvoiceForm($invoice);
$this->toform = new PurchaseForm($purchase);
$this->purchases = PurchaseTable::fetchByDateRange($invoice->getDate(), $purchase->getDate());
$this->events = EventTable::fetchByDatenParentclass($purchase->getDate(), "Purchase");
$this->cashsales = 0;
$this->chequesales = 0;
$this->creditsales = 0;
$this->cashother = 0;
$this->chequeother = 0;
$this->creditother = 0;
$this->cashtotal = 0;
$this->chequetotal = 0;
$this->credittotal = 0;
$this->deducttotal = 0;
foreach ($this->purchases as $purchase) {
if ($purchase->getStatus() != "Cancelled") {
$this->cashsales += $purchase->getCash();
$this->chequesales += $purchase->getCheque();
$this->creditsales += $purchase->getCredit();
$this->cashtotal += $purchase->getCash();
$this->chequetotal += $purchase->getCheque();
$this->credittotal += $purchase->getCredit();
//$this->deducttotal+=$purchase->getDsrdeduction();
}
}
foreach ($this->events as $event) {
$purchase = $event->getParent();
if ($purchase->getStatus() != "Cancelled") {
$this->cashother += $event->getDetail("cashamt");
$this->chequeother += $event->getDetail("chequeamt");
$this->creditother += $event->getDetail("creditamt");
$this->cashtotal += $event->getDetail("cashamt");
$this->chequetotal += $event->getDetail("chequeamt");
$this->credittotal += $event->getDetail("creditamt");
$this->deducttotal += $event->getDetail3();
}
}
$this->total = $this->cashtotal + $this->chequetotal + $this->credittotal;
}