|
|
@@ -156,12 +156,31 @@ class ShopController extends BaseController {
|
|
|
return static::notice(Form::formatErrorsForApi($formModel->getErrors()),400);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
$data = ShopGoods::findOneAsArray('ID=:ID', [':ID' => $id]);
|
|
|
$data['SELL_TYPE'] = explode(',',$data['SELL_TYPE']);
|
|
|
$data['GIFT_TYPE'] = explode(',',$data['GIFT_TYPE']);
|
|
|
if ($data['TYPE'] == 1 || $data['TYPE'] == 2) {
|
|
|
$data['SELL_DISCOUNT'] = ShopGoods::getGoodType()[$data['TYPE']]['discount']/100;
|
|
|
}
|
|
|
+
|
|
|
+ // 商品属性
|
|
|
+ $shopGoodsNature = ShopGoodsNature::findAllAsArray('GOODS_ID=:GOODS_ID', [':GOODS_ID' => $id]);
|
|
|
+// $shopGoodsNature = '';
|
|
|
+ // 国家
|
|
|
+ $countries = Cache::getCountries();
|
|
|
+ // 货币
|
|
|
+ $currencies = Cache::getCurrencies();
|
|
|
+ $currencies = array_column($currencies, NULL, 'ID');
|
|
|
+
|
|
|
+ foreach ($countries as &$country) {
|
|
|
+ $country['LOCAL_CURRENCY_NAME'] = $currencies[$country['LOCAL_CURRENCY_ID']]['NAME'] ?? '';
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ $data['SHOP_GOODS_NATURE'] = $currencies;
|
|
|
+
|
|
|
return static::notice(
|
|
|
[
|
|
|
'goodsInfo'=>$data,
|