|
@@ -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
|
|
@@ -58,7 +59,7 @@ class WechatMinprogramUserService
|
|
|
* @return array
|
|
|
* date 2023/05/26 15:41
|
|
|
*/
|
|
|
- private static function getLevelText($uid)
|
|
|
+ public static function getLevelText($uid)
|
|
|
{
|
|
|
$record = self::userVipRecord($uid);
|
|
|
if ($record && Carbon::now()->lt(Carbon::createFromTimestamp(strtotime($record->end_time)))) {
|
|
@@ -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;
|