table_name, 'default'); } //关联日志 public function count_log($where) { return $this->select_log($where, '', '', '', '', 1); } public function select_log($where = array(), $order = '', $page = 0, $page_size = 20, $fileds = '', $count = 0) { !$fileds && $fileds = 'lc_app_user_accountlog.*'; $this->db->select($fileds); $this->db->from('lc_app_user_accountlog'); $this->db->join('lc_app_user_account', 'lc_app_user_account.id = lc_app_user_accountlog.account_id', 'left'); if ($where) { $this->db->where($where); } if ($count) { return $this->db->count_all_results(); } if ($order) { $this->db->order_by($order); } if ($page) { $offset = ($page - 1) * $page_size; $limit = $page_size; } else { $offset = null; $limit = null; } $this->db->limit($limit, $offset); return $this->db->get()->result_array(); } }