Преглед на файлове

Merge branch 'fix' into test

zqwang преди 1 година
родител
ревизия
4af09e8932
променени са 1 файла, в които са добавени 5 реда и са изтрити 4 реда
  1. 5 4
      modules/Channel/Services/WechatMinprogram/WechatMinprogramUserService.php

+ 5 - 4
modules/Channel/Services/WechatMinprogram/WechatMinprogramUserService.php

@@ -17,6 +17,7 @@ use Modules\Channel\Models\MiniprogramUserVip;
 use Modules\Channel\Models\Order;
 use Modules\Channel\Models\Videos;
 use Modules\Channel\Models\VideoSeries;
+use Modules\Channel\Services\Order\OrderService;
 use Modules\Manage\Models\Miniprogram;
 
 class WechatMinprogramUserService
@@ -96,8 +97,8 @@ class WechatMinprogramUserService
             'YEAR' => '包年',
         ];
         $list = Order::join('pay_products', 'pay_products.id', '=', 'orders.pay_product_id')
-            ->select('orders.price', 'orders.trade_no', "orders.video_id", 'orders.pay_end_at', 'pay_products.type', 'pay_products.price as product_price', 'pay_products.given')
-            ->where('orders.status', 'PAID')
+            ->select('orders.price', 'orders.trade_no', "orders.video_id", 'orders.pay_end_at', 'pay_products.type', 'pay_products.price as product_price', 'orders.status','pay_products.given')
+            ->where('orders.status','<>', 'UNPAID')
             ->where('orders.uid', $uid);
         if (getProp($param, 'puser_id', 0) > 0) {
             $list->where('orders.puser_id', $param['puser_id']);
@@ -108,10 +109,9 @@ class WechatMinprogramUserService
 
         $list = $list->orderBy('orders.id', 'desc')
             ->paginate(getProp($param,'limit',15));
-
+        $status = array_column( OrderService::getOrderPayType(), null, 'value');
         foreach ($list as $item) {
             $item->pay_name = '微信支付';
-            $item->status = '已完成';
             if ($item->type == 'COIN') {
                 $item->rechare_coin = $item->product_price * 100;
                 $item->pay_result =- $item->product_price * 100 + $item->given;
@@ -122,6 +122,7 @@ class WechatMinprogramUserService
                 $item->rechare_coin = "-";
                 $item->pay_result = '充值';
             }
+            $item->status_txt = $status[$item->status]['name'] ?? "-";
             $item->from_page = $item->video_id > 0 ? "播放页" : "充值页";
         }
         return $list;