Update besar apk finance
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class FiscalPeriodModel extends CI_Model
|
||||
{
|
||||
public function find($id)
|
||||
{
|
||||
return $this->db->get_where('accounting_periods', array('id' => (int) $id))->row();
|
||||
}
|
||||
|
||||
public function findByDate($date)
|
||||
{
|
||||
return $this->db
|
||||
->where('start_date <=', $date)
|
||||
->where('end_date >=', $date)
|
||||
->limit(1)
|
||||
->get('accounting_periods')
|
||||
->row();
|
||||
}
|
||||
|
||||
public function allWithFiscalYear()
|
||||
{
|
||||
return $this->db
|
||||
->select('accounting_periods.*, fiscal_years.name fiscal_year_name')
|
||||
->from('accounting_periods')
|
||||
->join('fiscal_years', 'fiscal_years.id = accounting_periods.fiscal_year_id')
|
||||
->order_by('accounting_periods.start_date', 'DESC')
|
||||
->get()
|
||||
->result();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user