SettingController.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace addons\Wechat\merchant\controllers;
  3. use Yii;
  4. use common\helpers\ArrayHelper;
  5. use addons\Wechat\merchant\forms\HistoryForm;
  6. /**
  7. * Class SettingController
  8. * @package addons\Wechat\merchant\controllers
  9. * @author jianyan74 <751393839@qq.com>
  10. */
  11. class SettingController extends BaseController
  12. {
  13. /**
  14. * @return mixed|string
  15. * @throws \yii\web\NotFoundHttpException
  16. */
  17. public function actionSpecialMessage()
  18. {
  19. if (Yii::$app->request->isPost) {
  20. try {
  21. Yii::$app->services->addonsConfig->setConfig([
  22. 'special' => Yii::$app->request->post('setting')
  23. ]);
  24. return $this->message('修改成功', $this->redirect(['special-message']));
  25. } catch (\Exception $e) {
  26. return $this->message($e->getMessage(), $this->redirect(['special-message']), 'error');
  27. }
  28. }
  29. return $this->render('special-message', [
  30. 'list' => Yii::$app->wechatService->config->specialConfig(),
  31. ]);
  32. }
  33. }
粤ICP备19079148号