Kaynağa Gözat

更新:获取商品详情接口添加查询报价

shizhongqi 11 ay önce
ebeveyn
işleme
90aa439736
1 değiştirilmiş dosya ile 8 ekleme ve 0 silme
  1. 8 0
      app-mall/controllers/GoodsController.php

+ 8 - 0
app-mall/controllers/GoodsController.php

@@ -25,6 +25,14 @@ class GoodsController extends BaseController
         $intro = isset($setting['goodsIntroduce']) ? $setting['goodsIntroduce'] : '';
         $info['commonIntro'] = $intro;
 
+        // 查询报价 shopId-userId-goodsId
+        $key = $this->shopId . '-' . $this->userId . '-' . $id;
+        $val = Yii::$app->redis->executeCommand('GET', [$key]);
+        if (floatval($val) > 0) {
+            $info['price'] = $val;
+            $info['priceType'] = 2;
+        }
+
         $pixTextGoods = PicTextGoodsClass::getByCondition(['mainId'=>$this->mainId, 'goodsId'=>$id], true);
         $info['picTextGoods'] = $pixTextGoods;