request->isAjax && Yii::$app->request->isPost) { $post = Yii::$app->request->post(); $where = [['=', 'mall_id', $this->mall_id], ['<>', 'status' , StatusEnum::DELETE]]; if (isset($post['material_id']) && $post['material_id']) { $where[] = ['=', 'material_id', $post['material_id']]; } if (isset($post['title']) && $post['title']) { $material_ids = BusinessCardMaterials::find() ->orWhere(['like', 'title', "%" . $post['title'] . "%", false]) ->select('id') ->asArray() ->column(); $where[] = ['in', 'material_id', $material_ids]; } $params = [ 'limit' => 10, 'with' => 'material', 'where' => $where, 'order' => 'id desc' ]; $list = BusinessCardMaterialsStatistics::listPage($params); return $this->success('操作成功', $list); } else { return $this->render('index'); } } }