[eluser]adwin[/eluser]
I did a research on this
Code:
$this->db->set('measureid',$this->measureid);
$this->db->set('goodsid',$this->goodsid);
$this->db->set('poid',$this->poid);
$this->db->set('qty',$this->qty);
$this->db->set('qty0',$this->qty0);
$this->db->set('unitprice',$this->unitprice);
$this->db->set('discount',$this->discount);
$this->db->set('total', $this->calculatetotal());
echo 'goodsid:'.$this->goodsid ;
print_r($this->db->ar_set);
return false;
it produce this code:
Code:
goodsid:1Array ( [`measureid`] => '1' [`qty`] => 20 [`unitprice`] => '30000' [`discount`] => '300' [`total`] => 599700 )
and something even weird than this
if I change the goodsid into something other that 1 it will produce a correct result:
Code:
goodsid:6Array ( [`measureid`] => '1' [`goodsid`] => '6' [`qty`] => 20 [`unitprice`] => '30000' [`discount`] => '300' [`total`] => 599700 )
... and this one will make you confuse a lot ...
I change the code into this (just changing the place of measureid and goodsid
Code:
$this->db->set('goodsid',$this->goodsid);
$this->db->set('measureid',$this->measureid);
$this->db->set('poid',$this->poid);
$this->db->set('qty',$this->qty);
$this->db->set('qty0',$this->qty0);
$this->db->set('unitprice',$this->unitprice);
$this->db->set('discount',$this->discount);
$this->db->set('total', $this->calculatetotal());
echo ' goodsid: ' .$this->goodsid;
echo ' measureid :' .$this->measureid;
print_r($this->db->ar_set);
return false;
if the goodsid and measureid = 1 the result : (no measureid in the ar_set)
Code:
goodsid: 1 measureid :1 Array ( [`goodsid`] => '1' [`qty`] => 20 [`unitprice`] => '30000' [`discount`] => '300' [`total`] => 599700 )
if the goodsid changed to other than 1 result
Code:
goodsid: 10 measureid :1 Array ( [`goodsid`] => '10' [`measureid`] => '1' [`qty`] => 20 [`unitprice`] => '30000' [`discount`] => '300' [`total`] => 599700 )
I will check on active record set() function after this
so weird ... so true ...