weizong song 1 month ago
parent 62d56f0358
commit cdaf526c6e

@ -385,7 +385,6 @@ class StatisticsController extends CommonController
"orders.to_date",
"orders.contact",
"orders.mobile",
"orders.status",
"customers.mobile",
"patient.name"
)
@ -400,15 +399,6 @@ class StatisticsController extends CommonController
"orders.contact",
"orders.mobile as contact_mobile",
DB::raw("'" . $before_datetime_text . "' as point_time"),
DB::raw("
CASE orders.status
WHEN " . Orders::STATUS_UNCONFIRMED . " THEN '" . Orders::TEXT_UNCONFIRMED . "'
WHEN " . Orders::STATUS_UNASSIGNED . " THEN '" . Orders::TEXT_UNASSIGNED . "'
WHEN " . Orders::STATUS_ONGOING . " THEN '" . Orders::TEXT_ONGOING . "'
WHEN " . Orders::STATUS_FINISHED . " THEN '" . Orders::TEXT_FINISHED . "'
ELSE orders.status
END as status_name
"),
"customers.mobile as customer_mobile",
"patient.name as patient_name",
DB::raw("COALESCE(SUM(balance.money), 0) as balance"),
@ -421,14 +411,13 @@ class StatisticsController extends CommonController
$sheet->setCellValue('A1', '项目名称');
$sheet->setCellValue('B1', '时点');
$sheet->setCellValue('C1', '订单号');
$sheet->setCellValue('D1', '订单状态');
$sheet->setCellValue('E1', '客户手机号');
$sheet->setCellValue('F1', '联系人');
$sheet->setCellValue('G1', '联系电话');
$sheet->setCellValue('H1', '被陪护人');
$sheet->setCellValue('I1', '服务开始');
$sheet->setCellValue('J1', '服务结束');
$sheet->setCellValue('K1', '时点余额');
$sheet->setCellValue('D1', '客户手机号');
$sheet->setCellValue('E1', '联系人');
$sheet->setCellValue('F1', '联系电话');
$sheet->setCellValue('G1', '被陪护人');
$sheet->setCellValue('H1', '服务开始');
$sheet->setCellValue('I1', '服务结束');
$sheet->setCellValue('J1', '时点余额');
$count = count($rows);
for ($i = 2; $i <= $count + 1; $i++) {
@ -436,14 +425,13 @@ class StatisticsController extends CommonController
$sheet->setCellValue('A' . $i, $row['project_name']);
$sheet->setCellValue('B' . $i, $row['point_time']);
$sheet->setCellValue('C' . $i, $row['serial']);
$sheet->setCellValue('D' . $i, $row['status_name']);
$sheet->setCellValue('E' . $i, $row['customer_mobile']);
$sheet->setCellValue('F' . $i, $row['contact']);
$sheet->setCellValue('G' . $i, $row['contact_mobile']);
$sheet->setCellValue('H' . $i, $row['patient_name']);
$sheet->setCellValue('I' . $i, $row['from_date']);
$sheet->setCellValue('J' . $i, $row['to_date']);
$sheet->setCellValue('K' . $i, $row['balance']);
$sheet->setCellValue('D' . $i, $row['customer_mobile']);
$sheet->setCellValue('E' . $i, $row['contact']);
$sheet->setCellValue('F' . $i, $row['contact_mobile']);
$sheet->setCellValue('G' . $i, $row['patient_name']);
$sheet->setCellValue('H' . $i, $row['from_date']);
$sheet->setCellValue('I' . $i, $row['to_date']);
$sheet->setCellValue('J' . $i, $row['balance']);
}
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="' . ($project ? $project->name : '项目') . '_订单时点余额_' . date('YmdHis') . '.xlsx"');

@ -62,7 +62,6 @@
<th class="p-1" style="white-space: nowrap">项目名称</th>
<th class="p-1" style="white-space: nowrap">时点</th>
<th class="p-1" style="white-space: nowrap">订单号</th>
<th class="p-1" style="white-space: nowrap">订单状态</th>
<th class="p-1" style="white-space: nowrap">客户手机号</th>
<th class="p-1" style="white-space: nowrap">联系人</th>
<th class="p-1" style="white-space: nowrap">联系电话</th>
@ -79,7 +78,6 @@
<td class="p-1">{{ $item->project_name }}</td>
<td class="p-1">{{ $item->point_time }}</td>
<td class="p-1">{{ $item->serial }}</td>
<td class="p-1">{{ $item->status_name }}</td>
<td class="p-1">{{ $item->customer_mobile }}</td>
<td class="p-1">{{ $item->contact }}</td>
<td class="p-1">{{ $item->contact_mobile }}</td>

Loading…
Cancel
Save