Wechat.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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\common;
  10. use app\admin\controller\Auth;
  11. use mall\response\Response;
  12. use think\facade\Request;
  13. use think\facade\View;
  14. use app\admin\service\common\Wechat as WechatService;
  15. class Wechat extends Auth {
  16. /**
  17. * 详情
  18. * @return string
  19. * @throws \think\db\exception\DataNotFoundException
  20. * @throws \think\db\exception\DbException
  21. * @throws \think\db\exception\ModelNotFoundException
  22. */
  23. public function index(){
  24. return View::fetch("common/wechat/" . Request::get("type","text"),WechatService::getContent(Request::param()));
  25. }
  26. /**
  27. * 列表
  28. * @return string|\think\response\Json
  29. */
  30. public function article(){
  31. if(Request::isAjax()){
  32. $list = WechatService::getArticle(Request::param());
  33. return Response::returnArray("ok",0,$list["data"],$list["count"]);
  34. }
  35. return View::fetch();
  36. }
  37. }