stanley-king пре 8 година
родитељ
комит
e722223669
2 измењених фајлова са 9 додато и 3 уклоњено
  1. 2 2
      helper/goods_helper.php
  2. 7 1
      mobile/control/index.php

+ 2 - 2
helper/goods_helper.php

@@ -15,9 +15,9 @@ class goods_helper
     public function __construct() {
     }
 
-    public function get_distinct($goods_ids)
+    public function get_distinct($goods_commonids)
     {
-        $goods_list = Model('goods')->cls()->getGoodsListByColorDistinct(array('goods_id' => array('in', $goods_ids)),self::fieldstr);
+        $goods_list = Model('goods')->cls()->getGoodsListByColorDistinct(array('goods_commonid' => array('in', $goods_commonids)),self::fieldstr);
         $goods_list = $this->goods_list_extend($goods_list);
         return $goods_list;
     }

+ 7 - 1
mobile/control/index.php

@@ -65,8 +65,14 @@ class indexControl extends mobileHomeControl
         $special_id = intval($_GET['special_id']);
         $special_list = $this->mb_special->getMbSpecialItemUsableListByID($special_id);
         $ret = special_helper::filter($special_list,$goods_ids);
+        $mod_goods = Model('goods');
+        $items = $mod_goods->field('goods_commonid')->where(array('goods_id' => array('in',$goods_ids)));
+        $goods_commonids = array();
+        foreach ($items as $val) {
+            array_push($goods_commonids,intval($val['goods_commonid']));
+        }
         $helper = new goods_helper();
-        $goods_list = $helper->get_distinct($goods_ids);
+        $goods_list = $helper->get_distinct($goods_commonids);
         return self::outsuccess(array('special_list' => $ret,'goods_list' =>$goods_list));
     }