作者 lyh

gx

... ... @@ -29,8 +29,6 @@ class ProductLogic extends BaseLogic
public function getList(array $map = [], array $sort = ['id' => 'desc'], array $columns = ['*'], int $limit = 20)
{
$data = parent::getList($map, $sort, $columns, $limit);
var_dump($data);
die();
foreach ($data['list'] as &$v){
$v = $this->formatData($v);
$v['thumb']['image_link'] = $v['thumb']['url'];//图片统一
... ...
... ... @@ -36,11 +36,11 @@ class Product extends Base
$this->attributes['thumb'] = Arr::a2s($value);
}
public function getThumbAttribute($value){
$value = Arr::s2a($value);
$value['url'] = $this->getImageUrl($value['url']);
return $value;
}
// public function getThumbAttribute($value){
// $value = Arr::s2a($value);
// $value['url'] = $this->getImageUrl($value['url']);
// return $value;
// }
public function setGalleryAttribute($value){
$this->attributes['gallery'] = Arr::a2s($value);
... ...