Merge pull request 'feat(admin): 优化导出功能并添加用户信息字段' (#362) from dev into main
Reviewed-on: https://gitea.lihaink.cn/mkm/multi-store/pulls/362
This commit is contained in:
commit
06ecd55769
@ -79,12 +79,17 @@ class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInte
|
|||||||
$oid=WarehouseOrder::where('financial_pm',0)->where('code','like','%'.$order_ck)->column('oid');
|
$oid=WarehouseOrder::where('financial_pm',0)->where('code','like','%'.$order_ck)->column('oid');
|
||||||
$this->searchWhere[] = ['outbound_id','in',$oid];
|
$this->searchWhere[] = ['outbound_id','in',$oid];
|
||||||
}
|
}
|
||||||
|
$file=['id', 'order_id', 'order_sn','store_id', 'order_type', 'total_num', 'total_price', 'outbound_id', 'admin_id', 'create_time', 'status', 'mark', 'warehousing_id', 'file'];
|
||||||
|
if($export==2){
|
||||||
|
$file=['id', 'order_id', 'order_sn','store_id', 'order_type', 'total_num', 'total_price', 'outbound_id', 'admin_id', 'create_time', 'status', 'mark', 'warehousing_id', 'file','other_data'];
|
||||||
|
}
|
||||||
return BeforehandOrder::where($this->searchWhere)
|
return BeforehandOrder::where($this->searchWhere)
|
||||||
->field(['id', 'order_id', 'order_sn','store_id', 'order_type', 'total_num', 'total_price', 'outbound_id', 'admin_id', 'create_time', 'status', 'mark', 'warehousing_id', 'file'])
|
->field($file)
|
||||||
->limit($this->limitOffset, $this->limitLength)
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
->order(['id' => 'desc'])
|
->order(['id' => 'desc'])
|
||||||
->select()->each(function ($item)use($export) {
|
->select()->each(function ($item)use($export) {
|
||||||
$item['outbound'] = '';
|
$item['outbound'] = '';
|
||||||
|
$item['order_type_name'] = '';
|
||||||
if ($item->admin_id) {
|
if ($item->admin_id) {
|
||||||
$item->admin_name = Admin::where(['id' => $item->admin_id])->value('name');
|
$item->admin_name = Admin::where(['id' => $item->admin_id])->value('name');
|
||||||
} else {
|
} else {
|
||||||
@ -135,6 +140,10 @@ class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInte
|
|||||||
$pay_status = '';
|
$pay_status = '';
|
||||||
$order_rk = '';
|
$order_rk = '';
|
||||||
$order_ck = '';
|
$order_ck = '';
|
||||||
|
$nickname = '';
|
||||||
|
$phone = '';
|
||||||
|
$address = '';
|
||||||
|
$arrival_time = '';
|
||||||
if($export==2 && $item['order_sn']!=''){
|
if($export==2 && $item['order_sn']!=''){
|
||||||
$find=StoreOrder::where('order_id',$item['order_sn'])->field('paid,pay_type')->find();
|
$find=StoreOrder::where('order_id',$item['order_sn'])->field('paid,pay_type')->find();
|
||||||
if($find){
|
if($find){
|
||||||
@ -171,11 +180,19 @@ class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInte
|
|||||||
if($item['outbound_id']>0){
|
if($item['outbound_id']>0){
|
||||||
$order_ck=WarehouseOrder::where('id',$item['outbound_id'])->value('code');
|
$order_ck=WarehouseOrder::where('id',$item['outbound_id'])->value('code');
|
||||||
}
|
}
|
||||||
|
$nickname = $item->other_data?->nickname??'';
|
||||||
|
$phone = $item->other_data?->phone??'';
|
||||||
|
$address= $item->other_data?->address??'';
|
||||||
|
$arrival_time = $item->other_data?->arrival_time??'';
|
||||||
}
|
}
|
||||||
$item['pay_status'] = $pay_status;
|
$item['pay_status'] = $pay_status;
|
||||||
$item['pay_type_name'] = $pay_type_name;
|
$item['pay_type_name'] = $pay_type_name;
|
||||||
$item['order_ck'] = $order_ck;
|
$item['order_ck'] = $order_ck;
|
||||||
$item['order_rk'] = $order_rk;
|
$item['order_rk'] = $order_rk;
|
||||||
|
$item['nickname'] = $nickname;
|
||||||
|
$item['phone'] = $phone;
|
||||||
|
$item['address'] = $address;
|
||||||
|
$item['arrival_time'] = $arrival_time;
|
||||||
|
|
||||||
})
|
})
|
||||||
->toArray();
|
->toArray();
|
||||||
@ -231,6 +248,9 @@ class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInte
|
|||||||
'create_time' => '时间',
|
'create_time' => '时间',
|
||||||
'pay_status' => '支付状态',
|
'pay_status' => '支付状态',
|
||||||
'pay_type_name' => '支付方式',
|
'pay_type_name' => '支付方式',
|
||||||
|
'nickname' => '用户',
|
||||||
|
'phone' => '手机',
|
||||||
|
'address' => '地址',
|
||||||
];
|
];
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user