提交 d7e5341b authored 作者: chengye's avatar chengye

test

上级 2770b156
......@@ -16,53 +16,29 @@ class EmPayment extends Base
public function getPaymentList($map,$Nowpage,$limits){
//先找到账单
// $data = self::alias('pay')
// ->field('pay.*')
// ->field('case pay.status
// when 0 then "未缴费"
// when 1 then "已缴费"
// when 2 then "已上传发票"
// when 3 then "凭证完整"
// when 4 then "已审核"
// end as status')
// ->field('epi.invoice_id')
// ->field('em.em_numb')
// ->field('r.region_name,station.station_name')
// ->leftJoin(['em_account'=>'ea'],'ea.account_id=pay.account_id')
// ->leftJoin(['em_payment_invoice'=>'epi'],'epi.payment_id = pay.payment_id')
// ->leftJoin(['em'],'em.id=ea.em_id')
// ->leftJoin(['station_info'=>'station'],'station.station_id=em.station_id')
// ->leftJoin(['region'=>'r'],'station.area_id = r.id')
// ->where($map)
// ->order('pay.id desc')
// ->page($Nowpage, $limits)
// ->select()
// ->toarray();
$m = new EmInvoice();
$data = $m->alias('e')
->field('e.invoice_id,pay.*')
->field('case pay.status
when 0 then "未缴费"
when 1 then "已缴费"
when 2 then "已上传发票"
when 3 then "凭证完整"
when 4 then "已审核"
end as status')
->field('em.em_numb,r.region_name,station.station_name')
->join(['em_payment_invoice'=>'epi'],'epi.invoice_id = e.invoice_id')
->leftJoin(['em_payment'=>'pay'],'epi.payment_id = pay.payment_id')
->join(['em_account'=>'ea'],'ea.account_id = e.account_id')
->join(['em'],'em.id = ea.em_id')
->join(['station_info'=>'station'],'station.station_id=em.station_id')
->join(['region'=>'r'],'station.area_id = r.id')
->where($map)
->order('pay.id desc')
->page($Nowpage, $limits)
->select()
->toarray();
$data = self::alias('pay')
->field('pay.*')
->field('case pay.status
when 0 then "未缴费"
when 1 then "已缴费"
when 2 then "已上传发票"
when 3 then "凭证完整"
when 4 then "已审核"
end as status')
->field('epi.invoice_id')
->field('em.em_numb')
->field('r.region_name,station.station_name')
->leftJoin(['em_account'=>'ea'],'ea.account_id=pay.account_id')
->leftJoin(['em_payment_invoice'=>'epi'],'epi.payment_id = pay.payment_id')
->leftJoin(['em'],'em.id=ea.em_id')
->leftJoin(['station_info'=>'station'],'station.station_id=em.station_id')
->leftJoin(['region'=>'r'],'station.area_id = r.id')
->where($map)
->order('pay.id desc')
->page($Nowpage, $limits)
->select()
->toarray();
dd($m->getLastSql());
foreach ($data as $k=>$item){
$data[$k]['amount'] = round($data[$k]['amount'],3);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论