ria/app/Models/TrpAbstractModel.php
2025-03-04 11:37:42 +05:30

74 lines
1.8 KiB
PHP

<?php
namespace App\Models;
use CodeIgniter\Model;
class TrpAbstractModel extends Model
{
protected $table = 't_trp_abstract';
protected $primaryKey = 'id';
protected $useAutoIncrement = true;
protected $returnType = 'array';
protected $useSoftDeletes = false;
protected $protectFields = true;
protected $allowedFields = [
'date','particulars','opening_stock','physical_stock','remarks'
];
protected bool $allowEmptyInserts = false;
protected bool $updateOnlyChanged = true;
protected array $casts = [];
protected array $castHandlers = [];
// Dates
protected $useTimestamps = false;
protected $dateFormat = 'datetime';
protected $createdField = 'created_at';
protected $updatedField = 'updated_at';
protected $deletedField = 'deleted_at';
// Validation
protected $validationRules = [];
protected $validationMessages = [];
protected $skipValidation = false;
protected $cleanValidationRules = true;
// Callbacks
protected $allowCallbacks = true;
protected $beforeInsert = [];
protected $afterInsert = [];
protected $beforeUpdate = [];
protected $afterUpdate = [];
protected $beforeFind = [];
protected $afterFind = [];
protected $beforeDelete = [];
protected $afterDelete = [];
public function currentMonthTrpAbstract($startDate,$endDate){
$currentMonthTrpAbstract = $this->db->table('t_trp_abstract')
->where('date',$startDate)
->where('date',$endDate)
->get()
->getResultArray();
return $currentMonthTrpAbstract;
}
}