mirror of
http://124.126.16.154:8888/singularity/HyperfDevelopmentKit.git
synced 2026-01-15 00:35:08 +08:00
feat(studio): 将 lattice 的 mergeWhen 改为了 whenLoaded
This commit is contained in:
@@ -14,7 +14,7 @@ namespace Singularity\HDK\Studio\Resource;
|
||||
use Hyperf\Di\Annotation\Inject;
|
||||
use Hyperf\HttpServer\Contract\RequestInterface;
|
||||
use Hyperf\Resource\Json\JsonResource;
|
||||
use Singularity\HDK\Utils\Resource\ClassicResponse;
|
||||
use Singularity\HDK\Core\Resource\ClassicResponse;
|
||||
|
||||
/**
|
||||
* 晶格资源模型
|
||||
@@ -74,9 +74,9 @@ class Lattice extends JsonResource
|
||||
'a' => (float)$this->a,
|
||||
'b' => (float)$this->b,
|
||||
'c0' => (float)$this->c0,
|
||||
'scalingRatio' => (float)$this->pivot?->scaling_ratio,
|
||||
'evaluation' => LatticeEvaluation::make($this->evaluation),
|
||||
'material' => Material::collection($this->material),
|
||||
'scalingRatio' => $this->when(isset($this->pivot), (float)$this->pivot?->scaling_ratio),
|
||||
'evaluation' => LatticeEvaluation::make($this->whenLoaded('evaluation')),
|
||||
'material' => Material::collection($this->whenLoaded('material')),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user