$this->id, 'type' => $this->type?->typeName() ?? '未知', 'sn' => $this->sn, 'base_name' => $this->whenLoaded('base', function () { return $this->base?->name ?? ''; }, ''), 'base_id' => $this->agricultural_base_id, 'monitoring_point' => $this->monitoring_point ?? '', 'status' => $this->status?->value, 'extends' => $this->extends ?? [], 'created_by' => $this->whenLoaded('createdBy', function () { return $this->createdBy?->name; }, ''), //录入人 'created_at' => strtotime($this->created_at) ?? 0, //录入时间 'is_recommend' => $this->is_recommend, 'sort' => $this->sort ?? 0, 'supplier' => $this->whenLoaded('supplier', function () { return $this->supplier ? [ 'id' => $this->supplier->key, 'name' => $this->supplier->name, ] : null; }), 'project' => $this->whenLoaded('project', function () { return $this->project ? [ 'id' => $this->project->key, 'name' => $this->project->name, ] : null; }), ]; } }