$query = User::find() ->where(['id'=>[1,2,3,4]) ->select(['username']) // get the AR raw sql in YII2 $commandQuery = clone $query; echo $commandQuery->createCommand()->getRawSql(); $users = $query->all();
posted on 2018-08-08 08:09 dongruiha 阅读(385) 评论(0) 编辑 收藏 举报