dever 3 gadi atpakaļ
vecāks
revīzija
f9a4b9f517
1 mainītis faili ar 9 papildinājumiem un 3 dzēšanām
  1. 9 3
      app/goods/lib/Set.php

+ 9 - 3
app/goods/lib/Set.php

@@ -7,7 +7,7 @@ use Dever;
 class Set
 {
     # 获取商品及其属性列表
-    public function getGoodsList($id, $type, $table)
+    public function getGoodsList($id, $type, $table, $col = 'goods_id')
     {
         $where['status'] = 1;
 
@@ -24,7 +24,10 @@ class Set
                 $sku = Dever::db('goods/info_sku')->select(array('info_id' => $v['id']));
 
                 if ($sku) {
-                    $other_where = array($type => $id, 'goods_id' => $v['id'], 'sku_id' => -1);
+                    $other_where = array($type => $id, $col => $v['id'], 'sku_id' => -1);
+                    if ($col == 'type_id') {
+                        $other_where['type'] = 1;
+                    }
                     $give = Dever::input('give');
                     if ($give) {
                         $other_where['give'] = $give;
@@ -93,7 +96,10 @@ class Set
                                 'del' => 1,
                                 'end' => true,
                             );
-                            $other_sku_where = array($type => $id, 'goods_id' => $v['id'], 'sku_id' => $v1['id']);
+                            $other_sku_where = array($type => $id, $col => $v['id'], 'sku_id' => $v1['id']);
+                            if ($col == 'type_id') {
+                                $other_sku_where['type'] = 1;
+                            }
                             $give = Dever::input('give');
                             if ($give) {
                                 $other_sku_where['give'] = $give;