截流自动化的商城平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Oa.php 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. namespace app\admin\controller\wechat;
  3. use app\common\basics\AdminBase;
  4. use app\admin\logic\wechat\OaLogic;
  5. use app\common\server\JsonServer;
  6. use app\common\server\ConfigServer;
  7. class Oa extends AdminBase
  8. {
  9. /**
  10. * 公众号设置
  11. */
  12. public function setOa()
  13. {
  14. if($this->request->isAjax()){
  15. $post = $this->request->post();
  16. if(isset($post['qr_code']) && !empty($post['qr_code'])) {
  17. $domain = $this->request->domain();
  18. $post['qr_code'] = str_replace($domain, '', $post['qr_code']);
  19. }else{
  20. $post['qr_code'] = '';
  21. }
  22. OaLogic::setOa($post);
  23. return JsonServer::success('设置成功');
  24. }
  25. $oa = OaLogic::getOa();
  26. return view('setoa', ['oa' => $oa]);
  27. }
  28. /**
  29. * 菜单管理
  30. */
  31. public function oaMenu()
  32. {
  33. $wechat_menu = ConfigServer::get('menu', 'wechat_menu',[]);
  34. return view('oamenu', ['menu' => $wechat_menu]);
  35. }
  36. /**
  37. * 发布菜单
  38. */
  39. public function pulishMenu()
  40. {
  41. $menu = $this->request->post('button');
  42. if(empty($menu)){
  43. return JsonServer::error('请设置菜单');
  44. }
  45. $result = OaLogic::pulishMenu($menu);
  46. if($result){
  47. return JsonServer::success('菜单发布成功');
  48. }
  49. return JsonServer::error(OaLogic::getError());
  50. }
  51. }