| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- namespace App\Module\Point\Dto;
- /**
- * 积分管理DTO类
- *
- * 用于传输积分管理相关数据
- */
- class PointAdminDto
- {
- public int $id;
- public int $user_id;
- public int $point_id;
- public int $admin_id;
- public int $total_points;
- public string $remark;
- public int $create_time;
- public function __construct(array $data = [])
- {
- $this->id = $data['id'] ?? 0;
- $this->user_id = $data['user_id'] ?? 0;
- $this->point_id = $data['point_id'] ?? 0;
- $this->admin_id = $data['admin_id'] ?? 0;
- $this->total_points = $data['total_points'] ?? 0;
- $this->remark = $data['remark'] ?? '';
- $this->create_time = $data['create_time'] ?? 0;
- }
- /**
- * 转换为数组
- *
- * @return array
- */
- public function toArray(): array
- {
- return [
- 'id' => $this->id,
- 'user_id' => $this->user_id,
- 'point_id' => $this->point_id,
- 'admin_id' => $this->admin_id,
- 'total_points' => $this->total_points,
- 'remark' => $this->remark,
- 'create_time' => $this->create_time,
- ];
- }
- }
|