123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- namespace app\controller\admin\system\config;
- use ln\basic\BaseController;
- use app\common\repositories\system\config\ConfigClassifyRepository;
- use app\common\repositories\system\config\ConfigValueRepository;
- use think\App;
- class ConfigValue extends BaseController
- {
-
- private $repository;
-
- public function __construct(App $app, ConfigValueRepository $repository)
- {
- parent::__construct($app);
- $this->repository = $repository;
- }
-
- public function save($key)
- {
- $formData = $this->request->post();
- if (!count($formData)) return app('json')->fail('保存失败');
-
- $make = app()->make(ConfigClassifyRepository::class);
- if (!($cid = $make->keyById($key))) return app('json')->fail('保存失败');
- $this->repository->save($cid, $formData, $this->request->merId());
- return app('json')->success('保存成功');
- }
- }
|