|
|
@@ -5,6 +5,7 @@ use common\helpers\Cache;
|
|
|
use common\helpers\Date;
|
|
|
use common\components\Model;
|
|
|
use common\helpers\Form;
|
|
|
+use common\helpers\LoggerTool;
|
|
|
use common\helpers\PayStack;
|
|
|
use common\helpers\user\Balance;
|
|
|
use common\helpers\user\Cash;
|
|
|
@@ -544,7 +545,8 @@ class OrderForm extends Model
|
|
|
$userInstalmentInfo = Instalment::getInfo($loginUserId);
|
|
|
|
|
|
// 分期的总期数
|
|
|
- $instalment = floatval(Cache::getSystemConfig()['instalment']['VALUE'] ?? 3);
|
|
|
+ $instalment = intval(Cache::getSystemConfig()['instalment']['VALUE'] ?? 3);
|
|
|
+ LoggerTool::debug(['instalment']);
|
|
|
if ($userStage != $instalment){
|
|
|
if($userInstalmentInfo){
|
|
|
if($userInstalmentInfo['STAGE']>0 && $userInstalmentInfo['ORDER_TYPE']!='FX'){
|
|
|
@@ -841,6 +843,7 @@ class OrderForm extends Model
|
|
|
$goodsType = ShopGoods::getGoodType();
|
|
|
$hasInstalment = 0;
|
|
|
$userId = Info::getUserIdByUserName($this->userName);
|
|
|
+ $exchangeRate = floatval(Cache::getSystemConfig()['exchangeRate']['VALUE'] ?? 0); // 汇率
|
|
|
foreach ($this->goodsNum as $k => $v) {
|
|
|
if ($v) {
|
|
|
$goods = ShopGoods::findOneAsArray('ID=:ID AND STATUS=1',[':ID'=> $ids[$k]]);
|
|
|
@@ -852,10 +855,12 @@ class OrderForm extends Model
|
|
|
$discount = $goodsType[$goods['TYPE']]['discount'];
|
|
|
$realPrice = $goods['SELL_PRICE'] * $discount/100;
|
|
|
$realPv = $goods['PRICE_PV'] * $discount/100;
|
|
|
+ $realPriceStandard = $goods['SELL_PRICE_STANDARD'] * $discount/100;
|
|
|
} else {
|
|
|
$discount = $goods['SELL_DISCOUNT'];
|
|
|
$realPrice = $goods['SELL_PRICE'] * $discount;
|
|
|
$realPv = $goods['PRICE_PV'] * $discount;
|
|
|
+ $realPriceStandard = $goods['SELL_PRICE_STANDARD'] * $discount;
|
|
|
}
|
|
|
$totalAmount += $realPrice * intval($v);
|
|
|
$totalPv += $realPv * intval($v);
|
|
|
@@ -868,7 +873,14 @@ class OrderForm extends Model
|
|
|
'POINT' => $goods['POINT'],
|
|
|
'BUY_NUMS' => intval($v),
|
|
|
'SKU_CODE' => $goods['GOODS_NO'],
|
|
|
- 'GOODS_TITLE' => $goods['GOODS_NAME']
|
|
|
+ 'GOODS_TITLE' => $goods['GOODS_NAME'],
|
|
|
+ 'STANDARD_PRICE' => $goods['SELL_PRICE_STANDARD'],
|
|
|
+ 'TAX_RATE' => $goods['TAX_RATE'],
|
|
|
+ 'CATEGORY_TYPE' => $goods['CATEGORY_TYPE'],
|
|
|
+ 'PAY_TYPE' => $this->payType ?? '',
|
|
|
+ 'EMAIL' => $this->email ?? '',
|
|
|
+ 'REAL_STANDARD_PRICE' => $realPriceStandard,
|
|
|
+ 'EXCHANGE_RATE' => $exchangeRate,
|
|
|
];
|
|
|
}
|
|
|
if($goods['INSTALMENT']>0){ // 如果有分期付款商品,检查用户的分期付款状态
|
|
|
@@ -879,7 +891,7 @@ class OrderForm extends Model
|
|
|
$userStage = Instalment::getStage($userId);
|
|
|
$userInstalmentInfo = Instalment::getInfo($userId);
|
|
|
// 分期的总期数
|
|
|
- $instalment = floatval(Cache::getSystemConfig()['instalment']['VALUE'] ?? 3);
|
|
|
+ $instalment = intval(Cache::getSystemConfig()['instalment']['VALUE'] ?? 3);
|
|
|
if ($userStage == $instalment){
|
|
|
|
|
|
}else{
|