调整开通身份

This commit is contained in:
2023-03-13 11:13:52 +08:00
parent 2bf6a397b1
commit 1fcedae027
13 changed files with 658 additions and 60 deletions

View File

@@ -19,7 +19,7 @@ class IdentityMiddleResource extends JsonResource
return [
'name' => $this->identity->name,
'serial' => $this->identity->serial_prefix.$this->serial,
'started_at' => $this->started_at ?? '',
'started_at' => (string)$this->started_at ?? '',
'ended_at' => $ended_at,
];
}

View File

@@ -10,10 +10,17 @@ class UserIdentityBaseResource extends JsonResource
public function toArray($request): array
{
return [
'id' => $this->id,
'name' => $this->name,
'cover' => $this->cover_url,
'order' => $this->order,
'id' => $this->id,
'name' => $this->name,
'cover' => $this->cover_url,
'order' => $this->order,
'stock' => $this->stock,//多少箱
'bottle' => bcmul($this->stock, 24),//多少瓶
'price' => $this->getCondition('price', 0),//多少钱
'rights' => $this->rights,//可享受权益
'rules' => $this->getRules(),//身份权益
'not_rules' => $this->getNotRules(),
];
}