Browse Source

修改器修改

develop
李可松 4 years ago
parent
commit
9bd4e12992
  1. 12
      app/Models/AgentProduct.php

12
app/Models/AgentProduct.php

@ -54,23 +54,17 @@ class AgentProduct extends BaseModel
public function setChannelIdAttribute($value)
{
if (is_array($value)) {
$this->attributes['channel_id'] = join(',', array_filter($value));
}
$this->attributes['channel_id'] = is_array($value) ? join(',', array_filter($value)) : $value;
}
public function setPicturesAttribute($value)
{
if (is_array($value)) {
$this->attributes['pictures'] = json_encode(array_filter($value)) ?? '';
}
$this->attributes['pictures'] = is_array($value) ? (json_encode(array_filter($value)) ?? '[]') : '[]';
}
public function setProductIdsAttribute($value)
{
if (is_array($value)) {
$this->attributes['product_ids'] = join(',', array_filter($value));
}
$this->attributes['product_ids'] = is_array($value) ? join(',', array_filter($value)) : $value;
}
// 获取所有产品图片

Loading…
Cancel
Save