laravel打印sql

来源:互联网 发布:java注释规范整理 编辑:程序博客网 时间:2024/06/04 19:09
以下操作在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() : [];        }    }

0 0
原创粉丝点击