Qrcode.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | A3Mall
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2020 http://www.a3-mall.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Author: xzncit <158373108@qq.com>
  8. // +----------------------------------------------------------------------
  9. namespace app\admin\controller\wechat;
  10. use app\admin\controller\Auth;
  11. use think\facade\Request;
  12. use think\facade\View;
  13. use mall\response\Response;
  14. use app\admin\service\wechat\Qrcode as QrcodeService;
  15. class Qrcode extends Auth {
  16. /**
  17. * 列表
  18. * @return string|\think\response\Json
  19. * @throws \think\db\exception\DataNotFoundException
  20. * @throws \think\db\exception\DbException
  21. * @throws \think\db\exception\ModelNotFoundException
  22. */
  23. public function index(){
  24. if(Request::isAjax()){
  25. $list = QrcodeService::getList(Request::param());
  26. return Response::returnArray("ok",0,$list['data'],$list['count']);
  27. }
  28. return View::fetch();
  29. }
  30. /**
  31. * 删除
  32. * @return \think\response\Json
  33. */
  34. public function delete(){
  35. try {
  36. QrcodeService::delete(Request::get("id",0,"intval"));
  37. return Response::returnArray("删除成功");
  38. } catch (\Exception $ex) {
  39. return Response::returnArray($ex->getMessage(),0);
  40. }
  41. }
  42. /**
  43. * 清空
  44. * @return \think\response\Json
  45. */
  46. public function remove(){
  47. try {
  48. QrcodeService::clear();
  49. return Response::returnArray("操作成功");
  50. } catch (\Exception $ex) {
  51. return Response::returnArray($ex->getMessage(),0);
  52. }
  53. }
  54. }