12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- <?php
- /*
- * @Author: wang jun
- * @Date: 2022-01-18 10:57:14
- * @Last Modified by: wang jun
- * @Last Modified time: 2022-01-18 14:03:44
- * 微信类
- */
- namespace app\index\controller;
- use app\index\logic\wechatlogic;
- use think\Controller;
- class Index extends Base
- {
- /**
- * 设置请求数据规则
- * 20220107
- * wj
- */
- protected function setrules()
- {
- $list = [
- 'getOpenid' => [
- ['name' => 'code', 'title' => 'code', 'require' => true, 'type' => 'string'],
- ],
- 'create_qrcode' => [
- ['name' => 'scene', 'title' => 'scene', 'require' => true, 'type' => 'string'],
- ['name' => 'page', 'title' => 'page', 'require' => true, 'type' => 'string'],
- ],
- 'down_qrcode' => [
- ['name' => 'scene', 'title' => 'scene', 'require' => true, 'type' => 'string'],
- ['name' => 'page', 'title' => 'page', 'require' => true, 'type' => 'string'],
- ],
- ];
- return $list;
- }
- public function index()
- {
- echo "recruit";
- }
- /**
- * 获取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->down_qrcode($param);
- if (1 != $result['status']) {
- return backjson(0, $result['msg']);
- } else {
- return backjson(200, $result['data']);
- }
- }
- }
|