修改余额支付的标识和查询的相关数据修改

This commit is contained in:
liu 2024-06-20 15:37:53 +08:00
parent 0dc94531a5
commit 6170e98fec
2 changed files with 17 additions and 8 deletions

View File

@ -19,6 +19,7 @@ use app\common\enum\YesNoEnum;
use app\common\logic\BaseLogic;
use app\common\model\finance\CapitalFlow;
use app\common\model\store_finance_flow\StoreFinanceFlow;
use app\common\model\store_order\StoreOrder;
use app\common\model\user\User;
use app\common\model\user\UserAddress;
use app\common\model\user\UserRecharge;
@ -189,24 +190,32 @@ class UserLogic extends BaseLogic
switch ($params['type']){
case 1:
//采购款明细
$query =CapitalFlow::where(['uid'=>$params['id']]);
$categories = ['user_balance_recharge', 'user_order_purchase_pay'];
$query = CapitalFlow::where('uid', $params['id'])
->whereIn('category', $categories);
$count = $query->count();
$data = $query
->page($params['page_no'],$params['page_size'])
->select()->toArray();
foreach ($data as &$value){
if($value['category'] == 'user_order_purchase_pay'){
$value['order_sn'] = StoreOrder::where('id',$value['link_id'])->value('order_id');
}elseif($value['category'] == 'user_balance_recharge'){
$value['order_sn'] = UserRecharge::where('id',$value['link_id'])->value('order_id');
}
}
break;
case 2:
//余额明细
$query = StoreFinanceFlow::with(['store'])
->where([
'other_uid'=>$params['id'],'financial_type'=> OrderEnum::VIP_ORDER_OBTAINS,
'financial_pm'=>YesNoEnum::YES
]);
$query = CapitalFlow::where('uid', $params['id'])
->where('category', 'user_order_balance_pay');
$count = $query->count();
$data = $query
->page($params['page_no'],$params['page_size'])
->select()->toArray();
foreach ($data as &$value){
$value['order_sn'] = StoreOrder::where('id',$value['link_id'])->value('order_id');
}
break;
case 3:

View File

@ -86,7 +86,7 @@ class PayNotifyLogic extends BaseLogic
}
}
$capitalFlowDao = new CapitalFlowLogic($user);
$capitalFlowDao->userExpense('user_order_pay', 'order', $order['id'], $order['pay_price'],'',0,$order['store_id']);
$capitalFlowDao->userExpense('user_order_balance_pay', 'order', $order['id'], $order['pay_price'],'',0,$order['store_id']);
// self::afterPay($order);
// Redis::send('push-platform-print', ['id' => $order['id']], 60);
// PushService::push('store_merchant_' . $order['store_id'], $order['store_id'], ['type' => 'store_merchant', 'msg' => '您有一笔新的订单']);