From 958c99ba4aa47619f0e3c5caaa6880f78673bde1 Mon Sep 17 00:00:00 2001 From: liapples Date: Wed, 18 Aug 2021 19:14:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0setProductIdsAttribute?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Models/AgentProduct.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/Models/AgentProduct.php b/app/Models/AgentProduct.php index cb15a9c..45ee23b 100644 --- a/app/Models/AgentProduct.php +++ b/app/Models/AgentProduct.php @@ -43,4 +43,11 @@ class AgentProduct extends BaseModel $this->attributes['channel_id'] = join(',', array_filter($value)); } } + + public function setProductIdsAttribute($value) + { + if (is_array($value)) { + $this->attributes['product_ids'] = join(',', array_filter($value)); + } + } }