weizong song 2 years ago
parent 76f6f21693
commit 70f455f403

@ -18,10 +18,13 @@ class OrdersExport implements FromCollection
public function collection() public function collection()
{ {
$res = []; $res = [];
foreach ($this->data as $row) { foreach ($this->data as $row) {
$res[] = [ $res[] = [
"订单编号" => " ".$row->serial, "订单编号" => " ".$row->serial,
"所属项目/医院" => $row->project->name, "所属项目/医院" => $row->project->name,
"楼栋" => isset($row->bed->building) ? $row->bed->building->name : "",
"楼层/病区" => isset($row->bed->area) ? $row->bed->area->name : "",
"科室" => $row->department, "科室" => $row->department,
"客户姓名" => $row->customer->name ?: $row->patient->name, "客户姓名" => $row->customer->name ?: $row->patient->name,
"联系电话" => " ".$row->customer->mobile, "联系电话" => " ".$row->customer->mobile,

@ -44,7 +44,6 @@ class OrdersController extends CommonController
$this->model = $this->model->whereRaw("UNIX_TIMESTAMP(`created_at`) >= " . $start_timestamp . " and UNIX_TIMESTAMP(`created_at`) < " . $end_timestamp); $this->model = $this->model->whereRaw("UNIX_TIMESTAMP(`created_at`) >= " . $start_timestamp . " and UNIX_TIMESTAMP(`created_at`) < " . $end_timestamp);
$this->model = $this->model->where("project_id", $project_id); $this->model = $this->model->where("project_id", $project_id);
if ($request->keyword) { if ($request->keyword) {
$this->model = $this->model->where(function ($query) use ($request) { $this->model = $this->model->where(function ($query) use ($request) {
$query->where("serial", "like", "%" . $request->keyword . "%") $query->where("serial", "like", "%" . $request->keyword . "%")

@ -37,8 +37,8 @@
<tr> <tr>
<th>订单编号</th> <th>订单编号</th>
<th>所属项目/医院</th> <th>所属项目/医院</th>
{{-- <th>所在楼栋</th>--}} <th>所在楼栋</th>
{{-- <th>所在病区</th>--}} <th>所在病区</th>
<th>客户科室</th> <th>客户科室</th>
<th>客户姓名</th> <th>客户姓名</th>
<th>客户余额</th> <th>客户余额</th>
@ -58,8 +58,8 @@
{{ $row->serial }} {{ $row->serial }}
</td> </td>
<td>{{ $row->project->name }}</td> <td>{{ $row->project->name }}</td>
{{-- <td>{{ $row->bed->building->name }}</td>--}} <td>{{ $row->bed->building->name }}</td>
{{-- <td>{{ $row->bed->area->name }}</td>--}} <td>{{ $row->bed->area->name }}</td>
<td>{{ $row->department }}</td> <td>{{ $row->department }}</td>
<td>{{ $row->customer->name ?: $row->patient->name }}</td> <td>{{ $row->customer->name ?: $row->patient->name }}</td>
<td>{{ $row->customer->balance }}</td> <td>{{ $row->customer->balance }}</td>

Loading…
Cancel
Save