Merge pull request 'feat(admin): 添加订单导出功能' (#360) from dev into main
Reviewed-on: #360
This commit is contained in:
commit
5fb6b423f2
@ -11,6 +11,7 @@ use app\common\model\purchase_product_offer\PurchaseProductOffer;
|
|||||||
use app\common\model\system_store\SystemStore;
|
use app\common\model\system_store\SystemStore;
|
||||||
use app\common\lists\ListsExcelInterface;
|
use app\common\lists\ListsExcelInterface;
|
||||||
use app\common\model\beforehand_order_cart_info\BeforehandOrderCartInfo;
|
use app\common\model\beforehand_order_cart_info\BeforehandOrderCartInfo;
|
||||||
|
use app\common\model\store_order\StoreOrder;
|
||||||
use app\common\model\warehouse_order\WarehouseOrder;
|
use app\common\model\warehouse_order\WarehouseOrder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -50,6 +51,7 @@ class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInte
|
|||||||
public function lists(): array
|
public function lists(): array
|
||||||
{
|
{
|
||||||
$warehouse_type = $this->request->get('warehouse_type', 0);
|
$warehouse_type = $this->request->get('warehouse_type', 0);
|
||||||
|
$export = $this->request->get('export');
|
||||||
$order_rk = $this->request->get('order_rk', '');
|
$order_rk = $this->request->get('order_rk', '');
|
||||||
$order_ck = $this->request->get('order_ck', '');
|
$order_ck = $this->request->get('order_ck', '');
|
||||||
|
|
||||||
@ -81,7 +83,7 @@ class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInte
|
|||||||
->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(['id', 'order_id', 'order_sn','store_id', 'order_type', 'total_num', 'total_price', 'outbound_id', 'admin_id', 'create_time', 'status', 'mark', 'warehousing_id', 'file'])
|
||||||
->limit($this->limitOffset, $this->limitLength)
|
->limit($this->limitOffset, $this->limitLength)
|
||||||
->order(['id' => 'desc'])
|
->order(['id' => 'desc'])
|
||||||
->select()->each(function ($item) {
|
->select()->each(function ($item)use($export) {
|
||||||
$item['outbound'] = '';
|
$item['outbound'] = '';
|
||||||
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');
|
||||||
@ -129,6 +131,42 @@ class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInte
|
|||||||
if ($item['store_id'] > 0) {
|
if ($item['store_id'] > 0) {
|
||||||
$item->system_store = SystemStore::where(['id' => $item['store_id']])->value('name');
|
$item->system_store = SystemStore::where(['id' => $item['store_id']])->value('name');
|
||||||
}
|
}
|
||||||
|
$pay_type_name = '';
|
||||||
|
$pay_status = '';
|
||||||
|
if($export==2 && $item['order_sn']!=''){
|
||||||
|
$find=StoreOrder::where('order_id',$item['order_sn'])->field('paid,pay_type')->find();
|
||||||
|
if($find){
|
||||||
|
switch ($find['pay_type']) {
|
||||||
|
case 3:
|
||||||
|
$pay_type_name = '余额支付';
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
$pay_type_name = '微信支付';
|
||||||
|
break;
|
||||||
|
case 9:
|
||||||
|
$pay_type_name = '微信条码';
|
||||||
|
break;
|
||||||
|
case 13:
|
||||||
|
$pay_type_name = '支付宝条码';
|
||||||
|
break;
|
||||||
|
case 17:
|
||||||
|
$pay_type_name = '现金支付';
|
||||||
|
break;
|
||||||
|
case 18:
|
||||||
|
$pay_type_name = '采购款支付';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$item['pay_type_name'] = $pay_type_name;
|
||||||
|
if($find['paid']==1){
|
||||||
|
$pay_status = '已付款';
|
||||||
|
}else{
|
||||||
|
$pay_status = '未付款';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$item['pay_status'] = $pay_status;
|
||||||
|
$item['pay_type_name'] = $pay_type_name;
|
||||||
|
|
||||||
})
|
})
|
||||||
->toArray();
|
->toArray();
|
||||||
}
|
}
|
||||||
@ -179,6 +217,8 @@ class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInte
|
|||||||
'mark' => '备注',
|
'mark' => '备注',
|
||||||
'msg' => '通知',
|
'msg' => '通知',
|
||||||
'create_time' => '时间',
|
'create_time' => '时间',
|
||||||
|
'pay_status' => '支付状态',
|
||||||
|
'pay_type_name' => '支付方式',
|
||||||
];
|
];
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user