From 487b8ba0a5b38be591836497a0a035a51524fbf5 Mon Sep 17 00:00:00 2001 From: joycezhang <787027175@qq.com> Date: Mon, 4 Mar 2024 17:52:03 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20(Model):=20EncryptDataIndex=20=20?= =?UTF-8?q?=E6=94=AF=E6=8C=81=20php=207?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Model/Casts/EncryptDataIndex.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Model/Casts/EncryptDataIndex.php b/src/Model/Casts/EncryptDataIndex.php index d87f214..c75982f 100644 --- a/src/Model/Casts/EncryptDataIndex.php +++ b/src/Model/Casts/EncryptDataIndex.php @@ -11,9 +11,15 @@ */ class EncryptDataIndex implements CastsInboundAttributes { - public function __construct(protected string $indexType = '') - { + /** + * 加密类型,分别为:nick,phone,idCard + * @var mixed|string + */ + protected $indexType; + public function __construct($indexType = '') + { + $this->indexType = $indexType; } /** @@ -24,7 +30,7 @@ public function __construct(protected string $indexType = '') * @param array $attributes * @return string */ - public function set(Model $model, string $key, mixed $value, array $attributes): string + public function set($model, string $key, $value, array $attributes): string { if (trim($value) == '') { return "";