Index.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. /*
  3. * @Author: wang jun
  4. * @Date: 2022-01-18 10:57:14
  5. * @Last Modified by: wang jun
  6. * @Last Modified time: 2022-01-19 10:38:56
  7. * 微信类
  8. */
  9. namespace app\index\controller;
  10. use app\index\logic\wechatlogic;
  11. use think\Controller;
  12. class Index extends Base
  13. {
  14. public function index()
  15. {
  16. echo "acidhospital";
  17. }
  18. /**
  19. * 获取openid
  20. * 20220118
  21. * wj
  22. * code 必填
  23. */
  24. public function getOpenid()
  25. {
  26. $param = request()->param();
  27. $l_w = new wechatlogic();
  28. $result = $l_w->getOpenid($param);
  29. if (1 != $result['status']) {
  30. return backjson(0, $result['msg']);
  31. } else {
  32. return backjson(200, $result['data']);
  33. }
  34. }
  35. /**
  36. * 保存二维码
  37. * 20220118
  38. * wj
  39. * scene page 必填
  40. */
  41. public function create_qrcode()
  42. {
  43. $param = request()->param();
  44. $l_w = new wechatlogic();
  45. $result = $l_w->create_qrcode($param);
  46. if (1 != $result['status']) {
  47. return backjson(0, $result['msg']);
  48. } else {
  49. return backjson(200, $result['data']);
  50. }
  51. }
  52. /**
  53. * 保存并下载二维码
  54. * 20220118
  55. * wj
  56. * scene page 必填
  57. */
  58. /*public function down_qrcode()
  59. {
  60. $param = request()->param();
  61. $l_w = new wechatlogic();
  62. $result = $l_w->create_qrcode($param);
  63. if (1 != $result['status']) {
  64. return backjson(0, $result['msg']);
  65. }
  66. $data = $result['data'];
  67. $path = $data['path'];
  68. }*/
  69. }