Просмотр исходного кода

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

shizhongqi 11 месяцев назад
Родитель
Сommit
90aa439736
1 измененных файлов с 8 добавлено и 0 удалено
  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;