Initial import
This commit is contained in:
43
one-api/application/controllers/mockup/misc/Nat_to_test.php
Normal file
43
one-api/application/controllers/mockup/misc/Nat_to_test.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?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();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user