超时未上传入账资料筛选
This commit is contained in:
@@ -70,6 +70,16 @@ class FinPaymentApplyController extends BaseController
|
|||||||
$data['enter_file_last'] = date('Y-m-d H:i:s', ($data['claimed_at']+86400)); //入账资料最后提交时间
|
$data['enter_file_last'] = date('Y-m-d H:i:s', ($data['claimed_at']+86400)); //入账资料最后提交时间
|
||||||
$data['claimed_at'] = date('Y-m-d H:i:s', $data['claimed_at']); //认领时间
|
$data['claimed_at'] = date('Y-m-d H:i:s', $data['claimed_at']); //认领时间
|
||||||
}
|
}
|
||||||
|
if (isset($data['id'])){
|
||||||
|
$finPaymentStock = FinPaymentStock::where('payment_apply_id', $data['id'])->get();
|
||||||
|
$stock = [];
|
||||||
|
foreach ($finPaymentStock as $v) {
|
||||||
|
$stock[$v['pi_no']]['pi_no'] = $v['pi_no'];
|
||||||
|
$stock[$v['pi_no']]['stock_id'][] = [$v['stock_id']];
|
||||||
|
}
|
||||||
|
$data['stock'] = array_values($stock);
|
||||||
|
}
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -58,6 +58,11 @@ class FinPaymentApplyService
|
|||||||
$config['where']['account_id'] = $p['account_id'];
|
$config['where']['account_id'] = $p['account_id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 入账资料超时
|
||||||
|
if (isset($p['scene']) && $p['scene'] == 'file_timeout') {
|
||||||
|
$config['where']['claimed_at'] = ['between', [1, time()-24*60*60]];
|
||||||
|
}
|
||||||
|
|
||||||
// 关键字
|
// 关键字
|
||||||
if (isset($p['keyword']) && $p['keyword']) {
|
if (isset($p['keyword']) && $p['keyword']) {
|
||||||
$k = '%' . $p['keyword'] . '%';
|
$k = '%' . $p['keyword'] . '%';
|
||||||
@@ -156,7 +161,8 @@ class FinPaymentApplyService
|
|||||||
$param = $request->all();
|
$param = $request->all();
|
||||||
|
|
||||||
$where = [];
|
$where = [];
|
||||||
|
$orWhere = [];
|
||||||
|
|
||||||
// 汇款国家
|
// 汇款国家
|
||||||
if (isset($param['country_id']) && !empty($param['country_id'])) {
|
if (isset($param['country_id']) && !empty($param['country_id'])) {
|
||||||
$where[] = ['country_id', $param['country_id']];
|
$where[] = ['country_id', $param['country_id']];
|
||||||
@@ -166,6 +172,14 @@ class FinPaymentApplyService
|
|||||||
$where[] = ['account_id', $param['account_id']];
|
$where[] = ['account_id', $param['account_id']];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 入账资料超时
|
||||||
|
if (isset($param['scene']) && $param['scene'] == 'file_timeout') {
|
||||||
|
$where[] = ['claimed_at', '<', time()-24*60*60];
|
||||||
|
$where[] = ['claimed_at', '>', 1];
|
||||||
|
$orWhere[] = ['submit_files', '[]'];
|
||||||
|
$orWhere[] = ['submit_files', ''];
|
||||||
|
}
|
||||||
|
|
||||||
// 关键字
|
// 关键字
|
||||||
if (isset($param['keyword']) && $param['keyword']) {
|
if (isset($param['keyword']) && $param['keyword']) {
|
||||||
$k = '%' . $param['keyword'] . '%';
|
$k = '%' . $param['keyword'] . '%';
|
||||||
@@ -173,7 +187,9 @@ class FinPaymentApplyService
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 构建查询
|
// 构建查询
|
||||||
$query = $this->modelClass::where($where);
|
$query = $this->modelClass::where($where)->where(function($query) use ($orWhere) {
|
||||||
|
$query->orWhere($orWhere);
|
||||||
|
});
|
||||||
|
|
||||||
// 是否已关联收款记录的筛选
|
// 是否已关联收款记录的筛选
|
||||||
$correlation = $param['correlation']??'';
|
$correlation = $param['correlation']??'';
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ namespace app\common\service;
|
|||||||
|
|
||||||
use app\common\logic\FinReceiptLogic;
|
use app\common\logic\FinReceiptLogic;
|
||||||
use app\common\model\FinPaymentApply;
|
use app\common\model\FinPaymentApply;
|
||||||
|
use app\common\model\FinPaymentStock;
|
||||||
use app\common\model\FinReceiptHis;
|
use app\common\model\FinReceiptHis;
|
||||||
use app\common\validate\FinReceiptValidate;
|
use app\common\validate\FinReceiptValidate;
|
||||||
use app\common\traits\crud\CrudServiceTrait;
|
use app\common\traits\crud\CrudServiceTrait;
|
||||||
@@ -295,6 +296,7 @@ class FinReceiptService
|
|||||||
$data = $this->preProcess(ucfirst($scene), $data, $request);
|
$data = $this->preProcess(ucfirst($scene), $data, $request);
|
||||||
$config = $this->buildQueryConfig($request, $scene);
|
$config = $this->buildQueryConfig($request, $scene);
|
||||||
FinPaymentApply::where('id', $payment_apply_id)->update(['receipt_id' => $id, 'claimed_at' => time(), 'claimed_by' => $request->user->uid]);
|
FinPaymentApply::where('id', $payment_apply_id)->update(['receipt_id' => $id, 'claimed_at' => time(), 'claimed_by' => $request->user->uid]);
|
||||||
|
FinPaymentStock::where('payment_apply_id', $payment_apply_id)->update(['receipt_id' => $id]);
|
||||||
|
|
||||||
//折让金额
|
//折让金额
|
||||||
$payment = FinPaymentApply::where('id', $payment_apply_id)->first();
|
$payment = FinPaymentApply::where('id', $payment_apply_id)->first();
|
||||||
|
|||||||
@@ -55,7 +55,9 @@ class Task
|
|||||||
['created_at', '>', time() - 60 * 60 * 48],
|
['created_at', '>', time() - 60 * 60 * 48],
|
||||||
['created_at', '<', time() - 60 * 60 * 24],
|
['created_at', '<', time() - 60 * 60 * 24],
|
||||||
];
|
];
|
||||||
$payment = FinPaymentApply::where($where)->orWhere($orWhere)->orderBy('id', 'desc')->get();
|
$payment = FinPaymentApply::where($where)->where(function($query) use ($orWhere) {
|
||||||
|
$query->orWhere($orWhere);
|
||||||
|
})->orderBy('id', 'desc')->get();
|
||||||
foreach ($payment as $item) {
|
foreach ($payment as $item) {
|
||||||
Log::info('fin_payment_apply submit_files ', [$item->toArray()]);
|
Log::info('fin_payment_apply submit_files ', [$item->toArray()]);
|
||||||
$notice = [
|
$notice = [
|
||||||
|
|||||||
Reference in New Issue
Block a user