zengyyh 3 months ago
parent e1cfb41bda
commit add41b6b27
  1. 7
      app/api/controller/sharp/Goods.php
  2. 7
      app/common/model/sharp/Goods.php

@ -18,6 +18,7 @@ use app\api\service\User as UserService;
use app\api\service\sharp\Active as ActiveService;
use app\common\service\qrcode\sharp\Goods as GoodsPoster;
use cores\exception\BaseException;
use app\api\service\Setting as SettingService;
/**
* 整点秒杀-商品管理
@ -57,6 +58,12 @@ class Goods extends Controller
// 获取秒杀活动商品详情
$service = new ActiveService;
$data = $service->getActiveGoodsDetail($activeTimeId, $sharpGoodsId);
$storeId = $data['active']['store_id'];
$merchantId = $data['goods']['merchant_id'];
//获取客服设置
$service = new SettingService;
$setting = $service->getGoodsCustomer($merchantId,$storeId);
$data['setting'] = $setting;
return $this->renderSuccess($data);
}

@ -112,7 +112,12 @@ class Goods extends BaseModel
$item['goods_image'] = !empty($item['goods']['goods_image']) ? $item['goods']['goods_image'] : '';
// 秒杀商品原价 (获取主商品价格)
//$item['original_price'] = !empty($item['goods']['original_price']) ? $item['goods']['original_price']: $item['goods']['goods_price_min'];
$item['original_price'] = isset($item['goods']['original_price']) ? $item['goods']['original_price'] : $item['goods']['goods_price_min'];
if (isset($item['goods']) && $item['goods'] !== null) {
$item['original_price'] = isset($item['goods']['original_price']) ? $item['goods']['original_price'] : $item['goods']['goods_price_min'];
} else {
// 可以设置一个默认值或处理逻辑
$item['original_price'] = null; // 或者其他默认值
}
// 回调函数
is_callable($callback) && call_user_func($callback, $item);
}

Loading…
Cancel
Save