本文整理匯總了PHP中WapAction::checkAction方法的典型用法代碼示例。如果您正苦於以下問題:PHP WapAction::checkAction方法的具體用法?PHP WapAction::checkAction怎麽用?PHP WapAction::checkAction使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WapAction
的用法示例。
在下文中一共展示了WapAction::checkAction方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: order
public function order()
{
parent::checkAction("Shop-order");
$sn = $_GET['order_sn'];
$order_db = M('b2c_order');
$order_where = array('token' => $this->token, 'sn' => $sn);
if (!empty($this->branch_id)) {
$order_where['branch_id'] = $this->branch_id;
}
$order = $order_db->where($order_where)->find();
$sql = "SELECT p.name ,k.* " . " from tp_b2c_order as k LEFT JOIN tp_partner as p on p.id=k.partner_id" . " where k.token='{$this->token}' AND k.sn='{$sn}'";
$Model = new Model();
// 實例化一個model對象 沒有對應任何數據表
$orders = $Model->query($sql);
$this->assign('orders', $orders);
if ($order) {
$this->assign('order', $order);
$order_id = $order['order_id'];
//已支付的交易
$order_trade_db = M('b2c_trade');
$trade = $order_trade_db->where(array('order_id' => $order_id, 'token' => $this->token, 'status' => 2))->find();
$this->assign('trade', $trade);
$order_logistics_db = M('b2c_logistics');
$logistics = $order_logistics_db->where(array('order_id' => $order_id, 'token' => $this->token))->find();
$this->assign('logistics', $logistics);
$Model = new Model();
$items = $Model->query("select i.product_id, i.count, p.`name`, p.logo_url, i.price from tp_b2c_order_item as i LEFT JOIN tp_b2c_product as p on i.product_id = p.product_id where i.order_id =" . $order_id . " and i.token='{$this->token}'");
$this->assign('products', $items);
$amount = 0;
$total_count = 0;
foreach ($items as $k => $c) {
$price = $c['price'];
$count = $c['count'];
$amount += $price * $count;
$total_count += $count;
}
$this->assign('order_amount', $amount);
$this->assign('order_item_count', $total_count);
if ($_GET['type'] == 'deliveryNote') {
$this->display('deliveryNote');
} else {
$this->display();
}
} else {
exit;
}
}