Merge pull request 'update' (#197) from zhangwei into dev
Reviewed-on: #197
This commit is contained in:
commit
371b7c2b0e
@ -45,7 +45,7 @@ class ProjectTravelReimbursementLists extends BaseAdminDataLists implements List
|
||||
{
|
||||
return [
|
||||
'=' => ['trip_apply_id', 'project_id', 'reimbursement_type'],
|
||||
'%like%' => ['apply_user'],
|
||||
'%like%' => ['trip_reimbursement_code','apply_user'],
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -209,7 +209,20 @@ class ProjectTravelReimbursementLogic extends BaseLogic
|
||||
*/
|
||||
public static function delete(array $params): bool
|
||||
{
|
||||
return ProjectTravelReimbursement::destroy($params['id']);
|
||||
Db::startTrans();
|
||||
try {
|
||||
$travel_reimbursement_detail_ids = ProjectTravelReimbursementDetail::where('travel_reimbursement_id',$params['id'])->column('id');
|
||||
$travel_reimbursement_invoice_detail_ids = ProjectTravelReimbursementInvoiceDetail::where('travel_reimbursement_id',$params['id'])->column('id');
|
||||
ProjectTravelReimbursement::destroy($params['id']);
|
||||
ProjectTravelReimbursementDetail::destroy($travel_reimbursement_detail_ids);
|
||||
ProjectTravelReimbursementInvoiceDetail::destroy($travel_reimbursement_invoice_detail_ids);
|
||||
Db::commit();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
Db::rollback();
|
||||
self::setError($e->getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user