request->get(); $requestType = $get['requestType'] ?? ''; if ($requestType == 'my') { $shopId = $this->shopId; $where = ['launchShopId' => $shopId]; } else { $where = []; } $respond = LlEventClass::getEventList($where); util::success($respond); } public function actionAdd() { $post = Yii::$app->request->post(); $name = $post['name']??''; if(empty($name)){ util::fail('请填写店名或姓名'); } $no = $post['no']??''; if(!empty($no)){ $pattern = '/^(?:\d{15}|\d{17}[\dxX])$/'; $valid = preg_match($pattern, $no); if($valid == false){ util::fail('身份证号错误'); } } $mobile = $post['mobile']??''; $wx = $post['wx']??''; if(empty($wx) && empty($mobile) && empty($no)){ util::fail('手机号、微信号、身份证必填一项'); } $prove = $post['prove']??[]; if(empty($prove)){ util::fail('证据最少要一张'); } $json = json_encode($prove); $intro = $post['intro']??''; util::complete('添加成功'); } }