admin/app/shop/controller/branch/Activity.php
@@ -6,6 +6,7 @@
use app\shop\model\branch\Activity as ActivityModel;
use app\shop\model\branch\Category as CategoryModel;
use app\shop\model\user\User as UserModel;
use app\common\service\qrcode\BranchActivityService;
/**
 * 活动控制器
@@ -134,4 +135,20 @@
        return $this->renderSuccess('操作成功');
    }
    /**
     * 核销二维码
     */
    public function qrcode($activity_id, $source)
    {
        $detail = ActivityModel::detail($activity_id);
        $Qrcode = new BranchActivityService($detail, [], $source);
        $fullPath = $Qrcode->getVerifyImage();
        header('Content-Type: image/png');
        header('Content-disposition: attachment; filename='. $detail['name'] .'_.png');
        readfile($fullPath);
        header('Content-Length: ' .filesize($fullPath));
    }
}