Commit f0d8c083 by Phạm Văn Đoan

customize model của CI_Model

parent 42b6fd72
<?php defined('BASEPATH') or exit('No direct script access allowed');
class MY_Model extends CI_Model
{
public function __construct()
{
parent::__construct();
}
/**
* Hàm ghi ra log php câu lệnh SQL để debug
*
* @param null $action_name
* @param bool $flag
*/
public function sql_log($action_name=null, $flag=true)
{
if ($flag) {
if (empty($action_name)) {
$action_name = date('Y-m-d H:i:s');
}
error_log('['.$action_name.'] SQL: '. $this->db->last_query());
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment