正在显示
2 个修改的文件
包含
2 行增加
和
2 行删除
@@ -51,7 +51,7 @@ class Cart extends Model | @@ -51,7 +51,7 @@ class Cart extends Model | ||
51 | public function getGoodsStyleTextAttr($value,$data){ | 51 | public function getGoodsStyleTextAttr($value,$data){ |
52 | $goods_style_text = []; | 52 | $goods_style_text = []; |
53 | if(!empty($data['goods_style'])){ | 53 | if(!empty($data['goods_style'])){ |
54 | - $goods_style = json_decode(str_replace('\'','"',$data['goods_style']),true); | 54 | + $goods_style = json_decode($data['goods_style'],true); |
55 | foreach($goods_style as $k => $v){ | 55 | foreach($goods_style as $k => $v){ |
56 | $style = Style::where('id',$k)->field('style_name,style_type')->find()->toArray(); | 56 | $style = Style::where('id',$k)->field('style_name,style_type')->find()->toArray(); |
57 | $style['style_value'] = ''; | 57 | $style['style_value'] = ''; |
@@ -47,7 +47,7 @@ class OrderGoods extends Model | @@ -47,7 +47,7 @@ class OrderGoods extends Model | ||
47 | public function getGoodsStyleTextAttr($value,$data){ | 47 | public function getGoodsStyleTextAttr($value,$data){ |
48 | $goods_style_text = []; | 48 | $goods_style_text = []; |
49 | if(!empty($data['goods_style'])){ | 49 | if(!empty($data['goods_style'])){ |
50 | - $goods_style = json_decode(str_replace('\'','"',$data['goods_style']),true); | 50 | + $goods_style = json_decode($data['goods_style'],true); |
51 | foreach($goods_style as $k => $v){ | 51 | foreach($goods_style as $k => $v){ |
52 | $style = Style::where('id',$k)->field('style_name,style_type')->find()->toArray(); | 52 | $style = Style::where('id',$k)->field('style_name,style_type')->find()->toArray(); |
53 | $style['style_value'] = ''; | 53 | $style['style_value'] = ''; |
-
请 注册 或 登录 后发表评论