有关如何在idiorm查询中添加多个列的任何想法
我想获取别名'Due'n'TotDue'的值作为这些指定列的添加,但我继续得到一个致命的错误 我真正理解的任何帮助; 这是我的示例查询;
$d = ORM::for_table('transaction_s')
->select_many(array('ACCT_TYPE'=>'transaction_s.TRANS_TYP',
'ADate'=>'transaction_s.ACCTDATE',
'Str'=>'accounts_master.PHYS_ADDRESS',
'Zone'=>'accounts_master.ZONE_ID',
'Name'=>'customers.CUSTOMER_NAME',
'Address'=>'customers.POST_ADDRESS',
'TelNo'=>'customers.TEL_NO',
'AcctNo'=>'transaction_s.ACCT_NO',
'smscost'=>'transaction_s.INT_AMOUNT',
'Due'=>'(transaction_s.water_DUE+transaction_s.METER_RENT+transaction_s.SEWER+
transaction_s.Conserve+transaction_s.INT_AMOUNT+transaction_s.BIN_HIRE)',
'TotalDue' =>'(transaction_s.water_DUE+transaction_s.METER_RENT+transaction_s.SEWER
+transaction_s.Conserve+transaction_s.PREVBAL
+transaction_s.INT_AMOUNT+transaction_s.BIN_HIRE)',
'OutStanding'=>'transaction_s.water_OUTSTANDING'
)
->inner_join('accounts_master', 'customers.CUSTOMER_NO = accounts_master.CUSTOMER_NO')
->inner_join('customers', 'customers.CUSTOMER_NO = accounts_master.CUSTOMER_NO')
->find_many();