Merge branch 'feature/fin' into develop
# Conflicts: # app/common/service/FinReceiptService.php
This commit is contained in:
@@ -218,7 +218,7 @@ class FinReceiptService
|
||||
// 构建查询
|
||||
$query = $this->modelClass::where($where);
|
||||
|
||||
// 没有付款记录的收款记录
|
||||
// 收款记录绑定情况
|
||||
if (isset($param['payment_apply']) && $param['payment_apply'] == 'not') {
|
||||
$query->where('payment_apply_id', 0);
|
||||
} elseif (isset($param['payment_apply']) && $param['payment_apply'] == 'already') {
|
||||
@@ -228,7 +228,18 @@ class FinReceiptService
|
||||
$query->where('created_at', '<' ,time() - 24*60*60);
|
||||
}
|
||||
|
||||
if (isset($param['scene']) && $param['scene'] == 'list') {
|
||||
if($param['scene'] == 'pending'){ //待入账列表
|
||||
$query->where('payment_apply_id', '>' ,'0');
|
||||
$query->where('submit_files','!=','');
|
||||
}
|
||||
|
||||
if($param['scene'] == 'delete'){ //查询作废数据
|
||||
$query->onlyTrashed();
|
||||
}elseif ($param['scene'] == 'all'){ //查询包含作废数据的全量数据
|
||||
$query->withTrashed();
|
||||
}
|
||||
|
||||
if (isset($param['scene']) && ($param['scene'] == 'list' ||$param['scene'] == 'pending')) {
|
||||
return $query->paginate($limit, ['*'], 'page', $page);
|
||||
}
|
||||
|
||||
@@ -288,6 +299,13 @@ class FinReceiptService
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
||||
public function delete($id)
|
||||
{
|
||||
$res = FinReceipt::where('id', $id)->delete();
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新:绑定收款记录,计算折让金额
|
||||
* @param Request $request
|
||||
@@ -308,8 +326,10 @@ class FinReceiptService
|
||||
$payment = FinPaymentApply::where('id', $payment_apply_id)->first();
|
||||
$receipt = FinReceipt::find($id);
|
||||
$data['discount_amount'] = $payment->amount - $receipt->amount ?? 0;
|
||||
$data['submit_files'] = $payment->submit_files ?? '';
|
||||
|
||||
$updated = $this->logicUpdateBy($config, $data);
|
||||
return $this->postProcess(ucfirst($scene), $data);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user