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

修复抄表单列表页曝移动电量没有乘以倍率的错误

上级 aecfd567
...@@ -223,22 +223,25 @@ class Useage extends Base ...@@ -223,22 +223,25 @@ class Useage extends Base
$uid = Request::param('useage_id'); $uid = Request::param('useage_id');
$useage = (new \app\em\model\Useage)->alias('u') $useage = (new \app\em\model\Useage)->alias('u')
->field('u.*') ->field('u.*,em.rate')
->field('(u.current_sum_numb - u.last_sum_numb) as repo_numb')
->field('emr.pricing_type') ->field('emr.pricing_type')
->leftJoin(['em'],'em.id=u.em_id') ->leftJoin(['em'],'em.id=u.em_id')
->leftJoin(['em_rule'=>'emr'],'emr.em_id=em.id') ->leftJoin(['em_rule'=>'emr'],'emr.em_id=em.id')
->where('u.useage_id','=',$uid) ->where('u.useage_id','=',$uid)
->find(); ->find();
$em = (new \app\em\model\Em())->getBaseInfo($useage->em_id); $em = (new \app\em\model\Em())->getBaseInfo($useage->em_id);
$user = Session::get('user'); $user = Session::get('user');
if($useage){ if($useage){
$this->assign('staffs',(new Staff())->getStaffs($user['is_admin'],$useage->staff_id)); $this->assign('staffs',(new Staff())->getStaffs($user['is_admin'],$useage->staff_id));
} else { } else {
$this->assign('staffs',(new Staff())->getStaffs($user['is_admin'])); $this->assign('staffs',(new Staff())->getStaffs($user['is_admin']));
} }
$useage->repo_numb = round(round($useage->current_sum_numb - $useage->last_sum_numb,2) * $useage->rate,2);
$this->assign('em',$em); $this->assign('em',$em);
$this->assign('useage',$useage); $this->assign('useage',$useage);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论