Forráskód Böngészése

二维码弹窗样式适配

zhangdehua 9 hónapja
szülő
commit
c638e8511e
2 módosított fájl, 11 hozzáadás és 4 törlés
  1. 2 1
      app/index/controller/User.php
  2. 9 3
      app/index/model/Goods.php

+ 2 - 1
app/index/controller/User.php

@@ -806,9 +806,10 @@ class User extends Controller
         $favorCount = count($favor) - 1;
         $priceCount = count($price) - 1;
         $amountCount = count($amount) - 1;
+        $goodsId = $this->request->get('goods_id', null);
 
         $goodsModel = new Goods();
-        $goods = $goodsModel->getListSimple()->toArray();
+        $goods = $goodsModel->getListSimple($goodsId)->toArray();
         $score = [40, 50];
         //所有的马甲号userid
         $userModel = new  \app\index\model\User();

+ 9 - 3
app/index/model/Goods.php

@@ -90,10 +90,16 @@ class Goods extends GoodsModel
         return $this->setGoodsListDataFromApi($list);
     }
 
-    public function getListSimple()
+    public function getListSimple($goodsId = null)
     {
-        return self::field('goods_id')->where('is_delete', '=', 0)
-            ->select();
+        if (empty($goodsId)){
+            return self::field('goods_id')->where('is_delete', '=', 0)
+                ->select();
+        }else{
+            return self::field('goods_id')->where('goods_id', $goodsId)->where('is_delete', '=', 0)
+                ->select();
+        }
+
     }
 
     /**