| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
- namespace addons\StarChain\backend\controllers;
- use addons\StarChain\common\services\SettingService;
- use Yii;
- /**
- * 默认控制器
- *
- * Class DefaultController
- * @package addons\StarChain\backend\controllers
- */
- class DefaultController extends BaseController
- {
- /**
- * 设置
- *
- * @return string
- */
- public function actionIndex()
- {
- if ($this->request->isAjax) {
- $service = new SettingService(['mall_id' => $this->mall_id]);
- return $this->success('ok', $service->getBackendSetting());
- }
- return $this->render('index');
- }
- /**
- * 保存更改
- *
- * @return string
- */
- public function actionEdit()
- {
- if ($this->request->isAjax) {
- $data = $this->request->getBodyParam('setting');
- $service = new SettingService(['mall_id' => $this->mall_id]);
- unset($data['callback_url']);
- return $service->setSetting($data)
- ? $this->success('ok')
- : $this->error($service->error);
- }
- }
- }
|