dever 3 years ago
parent
commit
dfbe580c9c
2 changed files with 9 additions and 2 deletions
  1. 1 1
      app/shop/database/goods.php
  2. 8 1
      app/shop/lib/Info.php

+ 1 - 1
app/shop/database/goods.php

@@ -326,7 +326,7 @@ return array
                 'hot' => array('yes-t_2.hot'),
                 'top' => array('yes-t_2.top'),
                 //'youhui' => array('yes-t_2.youhui'),
-                'price_type' => array('yes', 'in'),
+                'price_type' => array('yes-t_2.price_type', 'in'),
                 'name' => array('yes-t_2.name', 'like'),
                 'column' => array('yes-t_2.column_id', 'like'),
                 'category' => array('yes-t_2.category', 'like'),

+ 8 - 1
app/shop/lib/Info.php

@@ -220,8 +220,15 @@ class Info
             if ($data['price_type'] == 4) {
                 if (isset($data['goods']) && is_array($data['goods'])) {
                     foreach ($data['goods'] as $k => $v) {
-                        $data['goods'][$k]['total'] = $this->getTotal($other, -1);
+                        $where = array();
+                        $where['shop_id'] = $shop_id;
+                        $where['goods_id'] = $v['id'];
+                        $gother = Dever::db('shop/goods_sku')->getData($where);
+                        $data['goods'][$k]['total'] = $this->getTotal($gother, -1);
 
+                        if ($data['total'] == 0) {
+                            $data['total'] = $data['goods'][$k]['total'];
+                        }
                         if ($data['total'] > $data['goods'][$k]['total']) {
                             $data['total'] = $data['goods'][$k]['total'];
                         }