12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?php
- namespace app\controller\admin\v1\wechat;
- use app\controller\admin\AuthController;
- use app\services\wechat\WechatMenuServices;
- use think\facade\App;
- class Menus extends AuthController
- {
-
- public function __construct(App $app, WechatMenuServices $services)
- {
- parent::__construct($app);
- $this->services = $services;
- }
-
- public function index()
- {
- $menus = $this->services->getWechatMenu();
- return $this->success(compact('menus'));
- }
-
- public function save()
- {
- $buttons = request()->post('button/a', []);
- if (!count($buttons)) return $this->fail('请添加至少一个按钮');
- $this->services->saveMenu($buttons);
- return $this->success('修改成功!');
- }
- }
|