关于如何在 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();