更新到账管理

This commit is contained in:
yaooo 2023-11-04 11:44:16 +08:00
parent 7522e871b2
commit dcc2a64222
1 changed files with 5 additions and 5 deletions

View File

@ -178,11 +178,12 @@ class FinanceIncome extends ApiController
//查看 //查看
public function view() public function view()
{ {
$this->uid = JWT_UID;
$id = empty(get_params('id')) ? 0 : get_params('id'); $id = empty(get_params('id')) ? 0 : get_params('id');
$model = new Invoice(); $model = new Invoice();
$detail = $model->detail($id); $detail = $model->detail($id);
if(empty($detail)){ if(empty($detail)){
throw new \think\exception\HttpException(406, '找不到记录'); $this->apiError('到账信息不存在');
} }
$detail['not_income'] = ($detail['amount']*100 - $detail['enter_amount']*100)/100; $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]) ->where(['i.inid'=>$id,'i.status'=>1])
->order('i.enter_time desc') ->order('i.enter_time desc')
->select(); ->select();
$detail['fileArray'] = [];
if($detail['file_ids'] !=''){ if($detail['file_ids'] !=''){
$fileArray = Db::name('File')->where('id','in',$detail['file_ids'])->select(); $fileArray = Db::name('File')->where('id','in',$detail['file_ids'])->select();
$detail['fileArray'] = $fileArray; $detail['fileArray'] = $fileArray;
} }
$detail['fileArrayOther'] = [];
if($detail['other_file_ids'] !=''){ if($detail['other_file_ids'] !=''){
$fileArrayOther = Db::name('File')->where('id','in',$detail['other_file_ids'])->select(); $fileArrayOther = Db::name('File')->where('id','in',$detail['other_file_ids'])->select();
$detail['fileArrayOther'] = $fileArrayOther; $detail['fileArrayOther'] = $fileArrayOther;
} }
View::assign('uid', $this->uid); $this->apiSuccess('获取成功', $detail);
View::assign('detail', $detail);
return view();
} }
//删除到账记录 //删除到账记录