物品领用
This commit is contained in:
@@ -429,6 +429,8 @@ class InvRequisitionItemReturnService
|
||||
|
||||
// 4. 更新归还记录(状态 + 审核人 + 备注等)
|
||||
$updateResult = $this->logicUpdateBy($config, $data);
|
||||
$resultItem = $this->logicShow($config);
|
||||
InvRequisitionReturn::where('id',$resultItem['status'])->update(['status' => $data['status']]);
|
||||
if ($updateResult === 0) {
|
||||
throw new BusinessException('更新归还申请失败,可能记录不存在或已被处理');
|
||||
}
|
||||
@@ -543,6 +545,11 @@ class InvRequisitionItemReturnService
|
||||
if(isset($p['status'])){
|
||||
$config['where']['status'] = $p['status'];
|
||||
}
|
||||
if(isset($p['handler_id']) && $p['handler_id']=='self'){
|
||||
$config['where']['applicant_id'] = $request->user->uid;
|
||||
}else{
|
||||
$config['where']['handler_id'] = $request->user->uid;
|
||||
}
|
||||
$config['order']['id'] = 'desc';
|
||||
break;
|
||||
case 'show':
|
||||
@@ -572,8 +579,8 @@ class InvRequisitionItemReturnService
|
||||
public function serviceShow(Request $request, string $scene = 'show')
|
||||
{
|
||||
$id = $request->get('id');
|
||||
$return = InvRequisitionReturn::where('id', $id)->first()->toArray();
|
||||
$return['item_return'] = InvRequisitionItemReturn::where('return_id', $return['id'])->orderBy('id', 'desc')->get()->toArray();
|
||||
$return = InvRequisitionReturn::where('id', $id)->first();
|
||||
$return['item_return'] = InvRequisitionItemReturn::where('return_id', $return['id'])->orderBy('id', 'desc')->get();
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user