优化:商品抵扣和积分商品兑换的备注应该不一致,显示对应的备注

This commit is contained in:
wuhui_zzw 2023-12-29 19:21:09 +08:00
parent 4032070510
commit 710fa976b0
1 changed files with 6 additions and 2 deletions

View File

@ -25,7 +25,7 @@ class UseLegumesIntegralJob implements JobInterface{
// 获取订单信息
$orderInfo = app()->make(StoreOrderRepository::class)
->getSearch([])
->field('order_id,uid,use_legumes_integral,use_legumes_integral_price')
->field('order_id,uid,use_legumes_integral,use_legumes_integral_price,order_type')
->where('order_id',$data['order_id'])
->find();
if(!$orderInfo) throw new \Exception('信息不存在!');
@ -52,6 +52,10 @@ class UseLegumesIntegralJob implements JobInterface{
$totalGetIntegral = $legumesModel->sum('get_integral');// 总获取积分
$totalUseIntegral = $legumesModel->sum('use_integral');// 总已使用积分
$hold_legumes_integral = (float)sprintf("%.2f",$totalGetIntegral - $totalUseIntegral);// 持有可使用积分
if($orderInfo['order_type'] == 20) $mark = '兑换积分商品消耗'.$orderInfo['use_legumes_integral'].'积分';
else $mark = '购买商品使用'.$orderInfo['use_legumes_integral'].'积分抵扣'.floatval($orderInfo['use_legumes_integral_price']).'元';
$bills[] = [
'uid' => $orderInfo['uid'],
'link_id' => $orderInfo['order_id'],
@ -61,7 +65,7 @@ class UseLegumesIntegralJob implements JobInterface{
'type' => 'deduction',
'number' => (float)$orderInfo['use_legumes_integral'],
'balance' => $hold_legumes_integral,
'mark' => '购买商品使用'.$orderInfo['use_legumes_integral'].'积分抵扣'.floatval($orderInfo['use_legumes_integral_price']).'元',
'mark' => $mark,
'mer_id' => 0,
'status' => 1
];