作者 lyh

gx

... ... @@ -70,7 +70,7 @@ class ProductLogic extends BaseLogic
$param['attrs'] = Arr::a2s($param['attrs'] ?? '');
$param['attr_id'] = Arr::arrToSet($param['attr_id'] ?? '');
$param['category_id'] = ','.Arr::arrToSet($param['category_id']).',';
$param['keyword_id'] = Arr::arrToSet($param['keyword_id'] ?? '');
$param['keyword_id'] = ','.Arr::arrToSet($param['keyword_id']).',';
$param['describe'] = Arr::a2s($param['describe'] ?? '');
$param['describe_id'] = Arr::arrToSet($param['describe_id'] ?? '');
$param['seo_mate'] = Arr::a2s($param['seo_mate'] ?? '');
... ... @@ -233,8 +233,8 @@ class ProductLogic extends BaseLogic
'gallery'=>Arr::a2s($info['gallery']),
'attrs'=>Arr::a2s($info['attrs']),
'attr_id'=>Arr::arrToSet($info['attr_id']),
'category_id'=>Arr::arrToSet(trim($info['category_id'],',')),
'keyword_id'=>Arr::arrToSet($info['keyword_id']),
'category_id'=>','.Arr::arrToSet($info['category_id']).',',
'keyword_id'=>','.Arr::arrToSet($info['category_id']).',',
'intro'=>$info['intro'],
'content'=>$info['content'],
'describe'=>Arr::a2s($info['describe']),
... ...
... ... @@ -147,11 +147,11 @@ class Product extends Base
}
public function setKeywordIdAttribute($value){
$this->attributes['keyword_id'] = Arr::arrToSet($value);
$this->attributes['keyword_id'] = ','.Arr::arrToSet($value).',';
}
public function getKeywordIdAttribute($value){
return Arr::setToArr($value);
return Arr::setToArr(trim($value,','));
}
public function setRelatedProductIdAttribute($value){
... ...