diff --git a/app/api/controller/FinanceIncome.php b/app/api/controller/FinanceIncome.php index 4e4a86b..176c1ae 100644 --- a/app/api/controller/FinanceIncome.php +++ b/app/api/controller/FinanceIncome.php @@ -178,11 +178,12 @@ class FinanceIncome extends ApiController //查看 public function view() { + $this->uid = JWT_UID; $id = empty(get_params('id')) ? 0 : get_params('id'); $model = new Invoice(); $detail = $model->detail($id); if(empty($detail)){ - throw new \think\exception\HttpException(406, '找不到记录'); + $this->apiError('到账信息不存在'); } $detail['not_income'] = ($detail['amount']*100 - $detail['enter_amount']*100)/100; //已到账的记录 @@ -192,18 +193,17 @@ class FinanceIncome extends ApiController ->where(['i.inid'=>$id,'i.status'=>1]) ->order('i.enter_time desc') ->select(); + $detail['fileArray'] = []; if($detail['file_ids'] !=''){ $fileArray = Db::name('File')->where('id','in',$detail['file_ids'])->select(); $detail['fileArray'] = $fileArray; } - + $detail['fileArrayOther'] = []; if($detail['other_file_ids'] !=''){ $fileArrayOther = Db::name('File')->where('id','in',$detail['other_file_ids'])->select(); $detail['fileArrayOther'] = $fileArrayOther; } - View::assign('uid', $this->uid); - View::assign('detail', $detail); - return view(); + $this->apiSuccess('获取成功', $detail); } //删除到账记录