TP打印输出SQL语句

模型 -> getLastSql();

//TP打印SQL语句
$data = $this->field($field)->where($condition)->select();
echo $this->getLastSql();//输出 SELECT `id`,`title`,materialUrl as outerUrl,image as img,`type`,`sort`,`status`,`source` FROM `ims_push` WHERE `type` = 2

return $data ? $data->toArray() : [];
原文地址:https://www.cnblogs.com/camg/p/12019956.html