|
|
@@ -33,6 +33,9 @@ class ExportOrder implements Consumer
|
|
|
"4" => "退款中",
|
|
|
"5" => "已关闭",
|
|
|
"6" => "部分退款",
|
|
|
+ "7" => "履约中",
|
|
|
+ "8" => "退款审核中",
|
|
|
+ "9" => "退款审核中",
|
|
|
];
|
|
|
|
|
|
protected array $express = [
|
|
|
@@ -47,7 +50,7 @@ class ExportOrder implements Consumer
|
|
|
try {
|
|
|
if(empty($data['logId'])) return true;
|
|
|
$spreadsheet = new Spreadsheet();
|
|
|
- $title = ['店铺名称','下单人昵称','订单编号','订单状态','发货状态', '收件人', '手机号码', '收货地址','商品ID','商品标题', '创建时间'];
|
|
|
+ $title = ['店铺名称','下单人昵称','订单编号','订单状态','发货状态', '收件人', '手机号码', '收货地址','商品ID','团单标题','兑换商品', '创建时间'];
|
|
|
$sheet = $spreadsheet->getActiveSheet();
|
|
|
$titCol = 'A';
|
|
|
foreach ($title as $key => $value) {
|
|
|
@@ -57,7 +60,9 @@ class ExportOrder implements Consumer
|
|
|
}
|
|
|
$row = 2; // 从第二行开始
|
|
|
$searchKey = (new OrderService)->searchFilter($data['param']);
|
|
|
- $orderData = (new SaasOrder)->where($searchKey)->with(['address','poi','user','product'])->select();
|
|
|
+ $orderData = (new SaasOrder)->where($searchKey)->with(['address' => function($query) {
|
|
|
+ $query->with(['goods']);
|
|
|
+ },'poi','user','product'])->order("create_at","desc")->select();
|
|
|
if ($orderData->isEmpty()) {
|
|
|
(new SystemExport)->where("id",$data['logId'])->update(['status' => 2]);
|
|
|
return true;
|
|
|
@@ -68,6 +73,10 @@ class ExportOrder implements Consumer
|
|
|
if (!empty($item['address'])) {
|
|
|
$address = $item['address']['city_text'].$item['address']['address'];
|
|
|
}
|
|
|
+ $goodsTitle = $item['product']['product_name']??'-';
|
|
|
+ if ($item['product']['is_new'] == 1) {
|
|
|
+ $goodsTitle = "{$item['product']['price']}元代{$item['product']['line_price']}元商场权益券{$item['product']['product_name']}";
|
|
|
+ }
|
|
|
$newData = [
|
|
|
"shop" => $item['poi']['poi_name']??'-', // 店铺名称
|
|
|
"nickname" => $item['user']['nickname']??'-', // 下单人昵称
|
|
|
@@ -78,7 +87,8 @@ class ExportOrder implements Consumer
|
|
|
"mobile" => $item['address']['mobile']??'-',
|
|
|
"address" => $address,
|
|
|
"goods_id" => $item['product']['goods_id']??'-',
|
|
|
- "goods_name" => $item['product']['product_name']??'-',
|
|
|
+ "goods_name" => $goodsTitle,
|
|
|
+ "product" => $item['address']['goods']['title']??'-',
|
|
|
"create_at" => $item['create_at'],
|
|
|
];
|
|
|
foreach ($newData as $value) {
|