以下操作在Dao层操作
public function propertyLists($ids, $columns)
{
$this->getconnection()->enableQueryLog(); //开启日志
if(!empty($ids))
{
$data = $this->whereRaw('id=367 OR id=176')->get($columns);
print_r($this->getconnection()->getQueryLog());exit; //打印sql
return $data = !empty($data) ? $data->toArray() : [];
}
}
laravel打印sql
最新推荐文章于 2024-02-28 10:58:32 发布