...
|
...
|
@@ -41,7 +41,7 @@ class Cart extends Model |
|
|
public function getGoodsSpecTextAttr($value,$data){
|
|
|
$goods_spec_text = [];
|
|
|
if(!empty($data['goods_spec'])){
|
|
|
$goods_spec = json_decode($data['goods_spec'],true);
|
|
|
$goods_spec = json_decode(str_replace('\'','"',$data['goods_spec']),true);
|
|
|
foreach($goods_spec as $k => $v){
|
|
|
$spec = Spec::where('id',$k)->field('spec_name,spec_type')->find()->toArray();
|
|
|
$spec['spec_value'] = $spec['spec_type'] == '1' ? SpecValue::where('id',$v)->value('spec_value') : $v;
|
...
|
...
|
@@ -216,6 +216,7 @@ class Cart extends Model |
|
|
$tree = Tree::instance()->init(collection(Category::order('weigh desc,id desc')->select())->toArray(), 'pid');
|
|
|
foreach($new_cart_list as $goods_id => $v){
|
|
|
$goods_total_price = array_sum(array_column($v, 'goods_total_price'));
|
|
|
// 商品所属分类
|
|
|
$filter = [];
|
|
|
foreach(explode(',',$v[0]['goods']['category_ids']) as $v){
|
|
|
$id_arr = $tree->getParentsIds($v,true);
|
...
|
...
|
@@ -223,7 +224,7 @@ class Cart extends Model |
|
|
$filter[] = "find_in_set($val,category_ids)";
|
|
|
}
|
|
|
}
|
|
|
$where = implode(' or ',$filter);
|
|
|
$where = implode(' or ',$filter)." or category_ids = '' or category_ids = 0";
|
|
|
|
|
|
$coupon_id_arr = array_unique(
|
|
|
array_merge(
|
...
|
...
|
|