request->isPost) { $post = $this->request->post(); if (Yii::$app->services->validate->validate($post, [ [['name', 'id_card', 'mobile'], 'required'], ], [ 'name' => '真实姓名', 'id_card' => '身份证', 'mobile' => '手机号码', ]) === false) { return $this->error(Yii::$app->services->validate->getErrorMessage()); } $service = new UserService(['mall_id' => $this->mall_id]); return $service->silentSign($this->user_id, $post['name'], $post['mobile'], $post['id_card']) ? $this->success('ok') : $this->error($service->getError()); } } }