修改认领
This commit is contained in:
@@ -120,44 +120,59 @@ class OfficeClerkController extends BaseController
|
|||||||
$type = $request->get('type');
|
$type = $request->get('type');
|
||||||
if ($type == 'unclaimed') {
|
if ($type == 'unclaimed') {
|
||||||
$list = Db::table('fin_payment_apply')
|
$list = Db::table('fin_payment_apply')
|
||||||
->where('doc_user_id', $request->user->uid)
|
->join('sys_currency', 'fin_payment_apply.currency_id', '=', 'sys_currency.id')
|
||||||
->where('receipt_id', 0)
|
->where('fin_payment_apply.doc_user_id', $request->user->uid)
|
||||||
->select(
|
->where('fin_payment_apply.receipt_id', 0)
|
||||||
'apply_no',
|
->get([
|
||||||
'amount',
|
'fin_payment_apply.id',
|
||||||
'created_at'
|
'fin_payment_apply.created_at',
|
||||||
)
|
'fin_payment_apply.doc_user_id',
|
||||||
->get()
|
'fin_payment_apply.payment_entity',
|
||||||
->map(function($item) {
|
'fin_payment_apply.payment_account',
|
||||||
return [
|
'fin_payment_apply.currency_id',
|
||||||
'apply_no' => $item->apply_no,
|
'sys_currency.currency_name',
|
||||||
'amount' => $item->amount,
|
'fin_payment_apply.amount',
|
||||||
'created_at' => date('Y-m-d H:i:s', $item->created_at)
|
'fin_payment_apply.apply_no'
|
||||||
];
|
]);
|
||||||
})
|
foreach ($list as $key => &$val) {
|
||||||
->toArray();
|
$val->created_at = date('Y-m-d H:i:s', $val->created_at);
|
||||||
|
}
|
||||||
|
unset($val);
|
||||||
} else {
|
} else {
|
||||||
$twentyFourHoursAgo = time() - (24 * 3600);
|
$twentyFourHoursAgo = time() - (24 * 3600);
|
||||||
$list = Db::table('fin_payment_apply')
|
$list = Db::table('fin_payment_apply')
|
||||||
->where('doc_user_id', $request->user->uid)
|
->join('user', 'fin_payment_apply.doc_user_id', '=', 'user.id')
|
||||||
->whereNotNull('submit_files')
|
->join('sys_currency', 'fin_payment_apply.currency_id', '=', 'sys_currency.id')
|
||||||
->whereJsonLength('submit_files', '>', 0)
|
->where('fin_payment_apply.doc_user_id', $request->user->uid)
|
||||||
->where('receipt_id', '>', 0)
|
->whereNotNull('fin_payment_apply.submit_files')
|
||||||
->where('claimed_at', '<', $twentyFourHoursAgo)
|
->whereJsonLength('fin_payment_apply.submit_files', '>', 0)
|
||||||
->select(
|
->where('fin_payment_apply.receipt_id', '>', 0)
|
||||||
'apply_no',
|
->where('fin_payment_apply.claimed_at', '<', $twentyFourHoursAgo)
|
||||||
'amount',
|
->get([
|
||||||
'created_at'
|
'fin_payment_apply.id',
|
||||||
)
|
'fin_payment_apply.created_at',
|
||||||
->get()
|
'fin_payment_apply.doc_user_id',
|
||||||
->map(function($item) {
|
'user.name',
|
||||||
return [
|
'fin_payment_apply.payment_entity',
|
||||||
'apply_no' => $item->apply_no,
|
'fin_payment_apply.payment_account',
|
||||||
'amount' => $item->amount,
|
'fin_payment_apply.currency_id',
|
||||||
'created_at' => date('Y-m-d H:i:s', $item->created_at)
|
'sys_currency.currency_name',
|
||||||
];
|
'fin_payment_apply.amount',
|
||||||
})
|
'fin_payment_apply.apply_no'
|
||||||
->toArray();
|
]);
|
||||||
|
|
||||||
|
foreach ($list as $key => &$val) {
|
||||||
|
$stockIds = Db::table('fin_payment_stock')
|
||||||
|
->where('payment_apply_id', $val->id)
|
||||||
|
->pluck('stock_id')
|
||||||
|
->toArray();
|
||||||
|
$val->order_no = Db::table('stock_orders')
|
||||||
|
->whereIn('id', $stockIds)
|
||||||
|
->pluck('order_no')
|
||||||
|
->toArray();
|
||||||
|
$val->created_at = date('Y-m-d H:i:s', $val->created_at);
|
||||||
|
}
|
||||||
|
unset($val);
|
||||||
}
|
}
|
||||||
return $this->success($list);
|
return $this->success($list);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user