/** 二维码订单页面 */
 public function actionQrOrder()
 {
     $session = Yii::$app->session;
     $user = $session->get('user');
     $schemes = Scheme::findPayScheme();
     //获取充值方案
     $recommendUser = Users::findRecommendUser($user['recommendUserID']);
     if ($recommendUser && $recommendUser['role'] != Users::ROLE_BIG) {
         //存在推荐用户且不为大客户则需要有返点消息提示,否则没有提示
         $rebateScheme = Scheme::findRebateScheme($recommendUser['role']);
         //获取返点方案
     } else {
         $rebateScheme = "";
     }
     if ($rebateScheme) {
         $msg = '充值金额大于' . $rebateScheme['payMoney'] . '元时可以获得' . $rebateScheme['rebateSelf'] * 100 . '%返点哦~。';
         CommonFunctions::createAlertMessage($msg, "info");
     }
     $orders = [];
     $wxPayFunctions = new WxPayFunctions();
     foreach ($schemes as $scheme) {
         array_push($orders, $wxPayFunctions->generateQrOrder($scheme));
     }
     return $this->render('qr-order', ['schemes' => $schemes, 'orders' => $orders]);
 }
示例#2
0
<?php

defined('YII_DEBUG') or define('YII_DEBUG', false);
defined('YII_ENV') or define('YII_ENV', 'prod');
require __DIR__ . '/../../vendor/autoload.php';
require __DIR__ . '/../../vendor/yiisoft/yii2/Yii.php';
require __DIR__ . '/../../common/config/bootstrap.php';
require __DIR__ . '/../config/bootstrap.php';
$config = yii\helpers\ArrayHelper::merge(require __DIR__ . '/../../common/config/main.php', require __DIR__ . '/../../common/config/main-local.php', require __DIR__ . '/../config/main.php', require __DIR__ . '/../config/main-local.php');
$application = new yii\web\Application($config);
$application->language = isset($_COOKIE['language']) ? htmlspecialchars($_COOKIE['language']) : 'zh-CN';
//$application->run();
$postStr = isset($GLOBALS["HTTP_RAW_POST_DATA"]) ? $GLOBALS["HTTP_RAW_POST_DATA"] : "";
if (!empty($postStr)) {
    \frontend\functions\WxPayFunctions::payNotify($postStr);
} else {
    Yii::info('收到空通知', 'wx');
}