*/ class AuthController extends BaseController { use MerchantCurd; /** * @var \yii\db\ActiveRecord */ public $modelClass = Auth::class; /** * 首页 * * @return string * @throws \yii\web\NotFoundHttpException */ public function actionIndex() { $searchModel = new SearchModel([ 'model' => $this->modelClass, 'scenario' => 'default', 'partialMatchAttributes' => ['realname', 'mobile'], // 模糊查询 'defaultOrder' => [ 'id' => SORT_DESC ], 'pageSize' => $this->pageSize ]); $dataProvider = $searchModel ->search(Yii::$app->request->queryParams); $dataProvider->query ->andWhere(['status' => StatusEnum::ENABLED]) ->andWhere(['>', 'member_id', 0]) ->andWhere(['member_type' => MemberTypeEnum::MEMBER]) ->andFilterWhere(['merchant_id' => $this->getMerchantId()]); return $this->render($this->action->id, [ 'dataProvider' => $dataProvider, 'searchModel' => $searchModel, ]); } }