Files
BE_IBL/application/controllers/mockup/misc/Nat_to_test.php
2026-04-15 15:24:12 +07:00

43 lines
1.2 KiB
PHP
Executable File

<?php
class Nat_to_test extends MY_Controller
{
var $db_smartone;
function __construct()
{
parent::__construct();
$this->db_smartone = $this->load->database('onedev');
}
function generate()
{
// truncate
$this->db_smartone->query("TRUNCATE");
$parents =
$this->db_smartone->select("DISTINCT(Nat_RelationParentID) parentid", false)
->join('nat_test', 'Nat_RelationParentID = Nat_TestID')
->where("Nat_RelationIsActive", "Y")
->order_by('Nat_TestSequence')
->get('nat_relation')
->result_array();
foreach ($parents as $k => $v)
{
// INSERT top parent
$this->db_smartone->query("");
$parent_1 =
$this->db_smartone->select()
->join('nat_test', 'Nat_RelationParentID = Nat_TestID')
->where('Nat_RelationParentID', $v['parentid'])
->where('Nat_RelationIsActive', "Y")
->order_by('Nat_TestSequence')
->get('nat_relation')
->result_array();
}
}
}
?>