request->isAjax) { if (Yii::$app->request->isGet) { $params = Yii::$app->request->get(); // 检查提交的参数 $res = Yii::$app->services->validate->validate($params,[ [['page', 'limit'], 'safe'], [['gift_type', 'title'], 'string'], ]); if($res === false) return $this->error(Yii::$app->services->validate->getErrorMessage()); $data = Gift::getStatisticsList($this->mall_id, AddonsEnum::ADDONS_NAME_USERGIFT, (new UserGiftStatistics()), (new GiftEnum()), $params); $this->success('获取成功', $data); } } else { return $this->render($this->action->id); } } }