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

结算端订单、报单列表增加支付方式展示

kevin_zhangl 3 лет назад
Родитель
Сommit
032d695054

+ 8 - 0
backendApi/modules/v1/models/lists/shop/OrderDecList.php

@@ -5,6 +5,7 @@ use common\helpers\Cache;
 use common\helpers\Tool;
 use common\libs\dataList\DataListInterface;
 use common\models\OrderDec;
+use common\models\ShopGoods;
 use common\models\User;
 use common\libs\dataList\column\DateTime;
 
@@ -141,6 +142,13 @@ class OrderDecList extends \common\libs\dataList\DataList implements DataListInt
                     },
                     'headerOther' => ['width' => '190'],
                 ],
+                'PAY_TYPE' => [
+                    'header' => 'Pay type',// 支付方式
+                    'value' => function ($row) {
+                        return ShopGoods::payTypes()[$row['PAY_TYPE']]['name'] ?? ShopGoods::payTypes()['cash']['name'];
+                    },
+                    'headerOther' => ['width' => '190'],
+                ],
                 'DELIVERY_AT' => [
                     'header' => 'Delivery time',//发货时间
                     'value' => function ($row) {

+ 7 - 2
backendApi/modules/v1/models/lists/shop/OrderList.php

@@ -84,7 +84,6 @@ class OrderList extends \common\libs\dataList\DataList implements DataListInterf
         if(!$this->columns){
             $this->columns = [
                 'ID' => null,
-                'SN' => null,
                 'DEC_SN' => null,
                 'USER_NAME' => [
                     'header' => 'Member code',//会员编号
@@ -217,6 +216,13 @@ class OrderList extends \common\libs\dataList\DataList implements DataListInterf
                     },
                     'headerOther' => ['width' => '190'],
                 ],
+                'PAY_TYPE' => [
+                    'header' => 'Pay type',// 支付方式
+                    'value' => function ($row) {
+                        return ShopGoods::payTypes()[$row['PAY_TYPE']]['name'] ?? ShopGoods::payTypes()['cash']['name'];
+                    },
+                    'headerOther' => ['width' => '190'],
+                ],
                 'PAY_AT' => [
                     'header' => 'Payment time',//支付时间
                     'value' => function ($row) {
@@ -235,7 +241,6 @@ class OrderList extends \common\libs\dataList\DataList implements DataListInterf
                     },
                     'headerOther' => ['width' => '190'],
                 ],
-                'PAY_TYPE' => null,
                 'REAL_PRICE' => [
                     'header' => 'item pricing',//商品单价
                     'headerOther' => [

+ 1 - 1
common/models/ShopGoods.php

@@ -214,7 +214,7 @@ class ShopGoods extends \common\components\ActiveRecord
     public static function payTypes(){
         return [
             'cash'=>[
-                'name'=>'Account Balance' //余额支付
+                'name'=>'Ecoin' //余额支付
             ],
 //            'point'=>[
 //                'name'=>'积分支付' //积分支付

+ 5 - 1
common/models/forms/OrderDeleteForm.php

@@ -175,9 +175,13 @@ class OrderDeleteForm extends Model
                 $amountResult = Cash::changeUserCash($userId, 'CASH', +abs($payAmount), ['REMARK' => '退货退还余额']);
             } else if ($payType == 'exchange') {
                 $amountResult = Balance::changeUserBonus($userId,'exchange_points', +abs($payAmount),['DEAL_TYPE_ID' => DealType::EXCHANGE_POINTS_EXCHANGE,'REMARK' => '退货退还无业绩兑换点数']);
-            } else{
+            } else if ($payType == 'pay_stack') {
+                // TODO:PayStack支付只删除订单,人工退款
+                $transaction = true;
+            } else {
                 $amountResult = Balance::changeUserBonus($userId,'reconsume_points', +abs($payAmount),['DEAL_TYPE_ID' => DealType::RECONSUME_POINTS_EXCHANGE,'REMARK' => '退货退还复销点数']);
             }
+
             if ($amountResult !== true) {
                 $transaction->rollBack();
                 throw new Exception('退还订单金额失败,删除订单失败');