request; if ($retuest->isAjax) { if ($retuest->isPost) { $params = \Yii::$app->request->post(); $res = \Yii::$app->services->validate->validate($params,[ [['not_allow_apply_hour','is_no_restrictions','person',], 'safe'], [['bg_img','page','is_enable','type'],'safe'], ]); if($res === false) return $this->error(\Yii::$app->services->validate->getErrorMessage()); $config = \Yii::$app->services->setting->addons->set($this->mall_id, PkEnum::ADDONS_NAME, ['basic' => $params]); $this->success('保存成功', $config); } else { // 获取配置 $config = \Yii::$app->services->setting->addons->get($this->mall_id, PkEnum::ADDONS_NAME, 'basic'); $Platform_config = PlatformSetting::getConfByGroup( 'system', true); $config['web_url'] = $Platform_config['h5_url']['value'].'/#/plugins2/Pk/index?sign='.$this->mall['mall_sign']; $this->success('获取成功',$config); } } return $this->render($this->action->id); } public function actionSmsDetail() { $params = \Yii::$app->request->get(); $mall_id = $this->mall_id; $one = PkSms::find()->where(['sms_key' => $params['sms_key'], 'mall_id' => $mall_id])->one(); if (!$one) { $one = PkSms::def(); } return $this->success('success', $one); } public function actionSmsEdit() { $params = \Yii::$app->request->post(); $params['mall_id'] = $this->mall_id; $model = PkSms::setData($params); return $this->success('success', $model); } }