store_id = get_store_id(); $form->type = get_params('type'); return $this->asJson($form->getConfig()); } /** * 存储配置 */ public function actionSave() { $store_id = get_store_id(); $form = new WechatConfigForm(); $model = WechatConfig::findOne(['store_id' => $store_id, 'type' => post_params('type')]); if (!$model) { $model = new WechatConfig(); } $form->store_id = $store_id; $form->model = $model; $form->attributes = post_params(); return $this->asJson($form->saveConfig()); } }