public function indexAct() { $list = \Wechat\Logic\CouponLogic::getAllCoupon(getOpenid()); $weobj = WechatWrap::getInstance(); $userinfo = $weobj->getUserInfo(getOpenid()); $this->assign('subscribe', $userinfo['subscribe']); $this->assign('isTip', \Wechat\Logic\CouponLogic::isTip(getOpenid())); $this->assign('list', $list); $this->display(); }
public function testAllCouponAct() { echo getOpenid(); $dd = \Wechat\Logic\CouponLogic::getAllCoupon(getOpenid()); print_r($dd); }
/** * 确认订单 */ public function sureOrderAct() { $openid = session('openid'); $order_id = I('order_id'); if (!$order_id) { $this->error('参数错误!'); } $orderInfo = D('TicketOrder')->getOrderInfo($order_id); if ($orderInfo['coupon_pay'] == 0) { $ticket_type = D('TicketOrderDetail')->where(array('order_id' => $order_id))->getField('ticket_type'); if ($ticket_type != 3 && $ticket_type != 11) { $couponInfo = \Wechat\Logic\CouponLogic::getAllCoupon($openid); $this->assign('couponInfo', $couponInfo); } if ($couponInfo && $orderInfo['third_party_pay'] > $couponInfo[0]['price']) { $orderInfo['third_party_pay'] = $orderInfo['third_party_pay'] - $couponInfo[0]['price']; } elseif ($couponInfo && $orderInfo['third_party_pay'] <= $couponInfo[0]['price']) { $orderInfo['third_party_pay'] = 0; } } $this->assign('orderticketname', S('orderticketname_' . getOpenid())); $this->assign('orderareaname', S('orderareaname_' . getOpenid())); $this->assign('orderInfo', $orderInfo); $this->display(); }