feat: 修改财务流水列表功能,调整查询条件和展示内容
This commit is contained in:
parent
98cdcb682e
commit
18f82d040f
@ -82,7 +82,7 @@ class StoreFinanceFlowLists extends BaseAdminDataLists implements ListsSearchInt
|
|||||||
})->toArray();
|
})->toArray();
|
||||||
|
|
||||||
foreach ($data as $key => $item) {
|
foreach ($data as $key => $item) {
|
||||||
$list1= StoreFinanceFlow::where('order_id' ,$item['order_id'])->where('financial_type','>', 1)->field($field)->order('financial_pm','desc')->select()->each(function ($item) {
|
$list1 = StoreFinanceFlow::where('order_id', $item['order_id'])->where('financial_type', '>', 1)->field($field)->select()->each(function ($item) {
|
||||||
if ($item['user_id'] <= 0) {
|
if ($item['user_id'] <= 0) {
|
||||||
$item['nickname'] = '游客';
|
$item['nickname'] = '游客';
|
||||||
} else {
|
} else {
|
||||||
@ -103,9 +103,9 @@ class StoreFinanceFlowLists extends BaseAdminDataLists implements ListsSearchInt
|
|||||||
$item['store_name'] = $item['store_id'] > 0 ? SystemStore::where('id', $item['store_id'])->value('name') : '';
|
$item['store_name'] = $item['store_id'] > 0 ? SystemStore::where('id', $item['store_id'])->value('name') : '';
|
||||||
$item['pay_type_name'] = PayEnum::getPaySceneDesc($item['pay_type']);
|
$item['pay_type_name'] = PayEnum::getPaySceneDesc($item['pay_type']);
|
||||||
});
|
});
|
||||||
$list2=UserSign::where('order_id',$item['order_sn'])->whereIn('user_ship',[2,3])->select();
|
$list2 = UserSign::where('order_id', $item['order_sn'])->whereIn('user_ship', [0, 2, 3])->select();
|
||||||
foreach ($list2 as $k => $v) {
|
foreach ($list2 as $k => $v) {
|
||||||
$list2[$k]['id']='jf'.$v['id'];
|
$list2[$k]['id'] = 'JF' . $v['id'];
|
||||||
$list2[$k]['order_sn'] = $item['order_sn'];
|
$list2[$k]['order_sn'] = $item['order_sn'];
|
||||||
$list2[$k]['store_name'] = $item['store_name'];
|
$list2[$k]['store_name'] = $item['store_name'];
|
||||||
$list2[$k]['financial_pm'] = 0;
|
$list2[$k]['financial_pm'] = 0;
|
||||||
@ -113,9 +113,14 @@ class StoreFinanceFlowLists extends BaseAdminDataLists implements ListsSearchInt
|
|||||||
$list2[$k]['number'] = '+' . $v['number'];
|
$list2[$k]['number'] = '+' . $v['number'];
|
||||||
$list2[$k]['financial_type_name'] = $v['title'];
|
$list2[$k]['financial_type_name'] = $v['title'];
|
||||||
$list2[$k]['pay_type_name'] = PayEnum::getPaySceneDesc($item['pay_type']);
|
$list2[$k]['pay_type_name'] = PayEnum::getPaySceneDesc($item['pay_type']);
|
||||||
|
|
||||||
}
|
}
|
||||||
$data[$key]['list']=array_merge($list1->toArray(),$list2->toArray());
|
$list3 = array_merge($list1->toArray(), $list2->toArray());
|
||||||
|
// 提取 financial_pm 字段到单独的数组
|
||||||
|
$financial_pm = array_column($list3, 'financial_pm');
|
||||||
|
|
||||||
|
// 对 financial_pm 数组进行排序,这将影响原始数组
|
||||||
|
array_multisort($financial_pm, SORT_ASC, $list3);
|
||||||
|
$data[$k]['list']=$list3;
|
||||||
}
|
}
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user