Example #1
0
 public function getQrCode()
 {
     $base = Yii::getPathOfAlias('webroot');
     $urlPath = '/images/user_boxes/qr/' . $this->user_box_id . '.png';
     $filePath = $base . $urlPath;
     $url = 'http://' . Yii::app()->request->serverName;
     $url .= Yii::app()->createUrl('customerBox/setDelivered', array('id' => $this->user_box_id));
     Yii::import('boxomatic.extensions.qrcode.QRCode');
     $code = new QRCode($url);
     $code->create($filePath);
     return Yii::app()->request->baseUrl . $urlPath;
 }
Example #2
0
 public function actionQrcode()
 {
     $orderId = Yii::app()->request->getParam('orderId', 0);
     $dpid = Yii::app()->request->getParam('dpid', 0);
     $url = 'http://menu.wymenu.com/wymenuv2/product/weixPayOrder/orderId/' . $orderId . '?dpid=' . $dpid;
     $imgurl = './qrcode/wxpay/wxpay' . $dpid . '-' . $orderId . '.png';
     $code = new QRCode($url);
     $code->create($imgurl);
     echo $imgurl;
     exit;
 }