【发布时间】:2015-07-08 06:25:40
【问题描述】:
这是我的查询
$this->db->select('amount AS SavingAmount');
$query = $this->db->get_where('cashman_trial_balance',array('category_id'=>'176','clientId'=>$user['UserID'],'year'=>$year));
在浏览器中检查它会在下面生成此查询
SELECT *, *, `amount` AS SavingAmount FROM (`cashman_trial_balance`) WHERE `category_id` = '176' AND `clientId` = '122' AND `year` = '2015/2016'
我不知道这两颗星星是从哪里来的?
控制器代码
$som_var = $this->client->statistics();
型号代码
function statistics()
{
/* Some other queries */
$b = $this->get_balances();
}
function get_balances()
{
$this->db->select('amount AS SavingAmount');
$query = $this->db->get_where('cashman_trial_balance',array('category_id'=>'176','clientId'=>$user['UserID'],'year'=>$year));
return $query->result();
}
【问题讨论】:
标签: codeigniter