|
Server : Apache System : Linux server.mata-lashes.com 3.10.0-1160.90.1.el7.x86_64 #1 SMP Thu May 4 15:21:22 UTC 2023 x86_64 User : matalashes ( 1004) PHP Version : 8.1.29 Disable Function : NONE Directory : /home/matalashes/.trash/app.bak.7/Models/ |
Upload File : |
<?php
namespace App\Models;
use CodeIgniter\Model;
use Config\Database;
use Config\Services;
class Reportmutasihasilproduksi extends Model
{
protected $DBGroup = 'default';
protected $table = '';
protected $primaryKey = '';
protected $useAutoIncrement = true;
protected $insertID = 0;
protected $returnType = 'object';
protected $useSoftDeletes = true;
protected $protectFields = true;
protected $allowedFields = [];
// Dates
protected $useTimestamps = true;
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 static function get_report_store($start, $end)
{
if ($start == NULL && $end == NULL) {
$start = date('Y-m-01');
$end = date('Y-m-t');
}
$session = Services::session();
$db = Database::connect();
$builder = $db->table('transaksi_kirimbarang_pro');
$builder->select('*');
$builder->where('tkb_pro_status', 1);
$builder->where('tkb_pro_status_ic', 1);
$builder->where('date(created_at) >=', $start);
$builder->where('date(created_at) <=', $end);
return $builder->get()->getResult();
}
}