فهرست منبع

feat: NG-15: 新会员注册时增加国家与语言选项.

zhangl 1 سال پیش
والد
کامیت
ae0e43e36f
1فایلهای تغییر یافته به همراه4 افزوده شده و 0 حذف شده
  1. 4 0
      frontendApi/modules/v1/controllers/ShopController.php

+ 4 - 0
frontendApi/modules/v1/controllers/ShopController.php

@@ -100,8 +100,12 @@ class ShopController extends BaseController {
             'orderBy' => 'S.SORT ASC, S.CREATED_AT DESC',
         ]);
 
+        $currencies = Currency::getAllData();
+        $currencies = array_column($currencies, NULL, 'ID');
+
         foreach ($data['list'] as $key => $value) {
             $data['list'][$key]['DISCOUNT'] = in_array($value['TYPE'], [1, 2]) ? ShopGoods::getGoodType()[$value['TYPE']]['discount'] : $value['SELL_DISCOUNT'] * 100;
+            $data['list'][$key]['COIN'] = $currencies[$value['LOCAL_CURRENCY_ID']]['CODE'] ?? '';
         }
         
         return static::notice($data);