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

test

上级 feac7dfc
......@@ -93,14 +93,14 @@ class Useage extends Base
}
//生成抄表单
public function create($detail=false){
public function create(){
$em_id = Request::param('id');
if(!(new Em())->checkEmComplete($em_id)){
$this->error('电表信息不完整,需要补充基础信息','/em');
}
$em = (new \app\em\model\Em)->getEmUseageInfoById($em_id,$detail);
$em = (new \app\em\model\Em)->getEmUseageInfoById($em_id,false);
//基站信息
$station_info = Station::getBaseInfoById($em->station_id);
......
......@@ -54,8 +54,6 @@ class Em extends Base
//最后一次抄表记录
if($curr == false){
$ue = Useage::order('create_time desc,id desc')->get(['em_id'=>$id]);
} else {
$ue = Useage::with('photo')->order('create_time desc,id desc')->get(['em_id'=>$id]);
}
//如果没有超过表 不论是峰谷表还是普通表 都是空的
if(!$ue) {
......@@ -68,6 +66,8 @@ class Em extends Base
$ue->last_sum_numb = $ue->current_sum_numb;
$ue->last_date = $ue->current_date;
}
$ue->amount = 0;
}
$ue->price = $em->rule->pricing_type==1 ? $em->rule->pay_price : '';
$em->useage = $ue;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论