本文整理汇总了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;
}
}