<?php
/*
 * @Author: wang jun
 * @Date: 2022-01-18 10:57:14
 * @Last Modified by: wang jun
 * @Last Modified time: 2022-01-19 10:38:56
 * 微信类
 */
namespace app\index\controller;

use app\index\logic\wechatlogic;
use think\Controller;

class Index extends Base
{
    public function index()
    {
        echo "acidhospital";
    }
    /**
     * 获取openid
     * 20220118
     * wj
     * code 必填
     */
    public function getOpenid()
    {
        $param = request()->param();
        $l_w = new wechatlogic();
        $result = $l_w->getOpenid($param);
        if (1 != $result['status']) {
            return backjson(0, $result['msg']);
        } else {
            return backjson(200, $result['data']);
        }
    }
    /**
     * 保存二维码
     * 20220118
     * wj
     * scene page 必填
     */
    public function create_qrcode()
    {
        $param = request()->param();
        $l_w = new wechatlogic();
        $result = $l_w->create_qrcode($param);
        if (1 != $result['status']) {
            return backjson(0, $result['msg']);
        } else {
            return backjson(200, $result['data']);
        }
    }
    /**
     * 保存并下载二维码 
     * 20220118
     * wj
     * scene page 必填
     */
    /*public function down_qrcode()
    {
        $param = request()->param();
        $l_w = new wechatlogic();
        $result = $l_w->create_qrcode($param);
        if (1 != $result['status']) {
            return backjson(0, $result['msg']);
        }
        $data = $result['data'];
        $path = $data['path'];
    }*/

}
