虚拟发货调整

main
limu 11 months ago
parent a2a9e62c1c
commit 651732008c
  1. 1
      app/common/repositories/store/order/StoreOrderRepository.php
  2. 32
      crmeb/jobs/OrderPartnerJob.php

@ -1309,6 +1309,7 @@ class StoreOrderRepository extends BaseRepository
]; ];
$statusRepository->createSysLog($orderStatus); $statusRepository->createSysLog($orderStatus);
Queue::push(OrderPartnerJob::class, $order->toArray());
} }
if (isset($temp_code)) Queue::push(SendSmsJob::class, ['tempId' => $temp_code, 'id' => $order->order_id]); if (isset($temp_code)) Queue::push(SendSmsJob::class, ['tempId' => $temp_code, 'id' => $order->order_id]);

@ -33,7 +33,7 @@ use app\common\model\store\order\StoreOrderLevel;
class OrderPartnerJob implements JobInterface class OrderPartnerJob implements JobInterface
{ {
public function fire($job,$data) public function fire($job, $data)
{ {
$job->delete(); $job->delete();
file_put_contents('/tmp/debug_partner', '开始处理贡献值订单:' . var_export($data, 1), 8); file_put_contents('/tmp/debug_partner', '开始处理贡献值订单:' . var_export($data, 1), 8);
@ -155,23 +155,21 @@ class OrderPartnerJob implements JobInterface
} }
//订单角色贡献值-30% //订单角色贡献值-30%
$user_value = bcmul($total_price, 0.3, 2); $user_value = bcmul($total_price, 0.3, 2);
if ($user_value > 0) { $user = User::getDB()->where('uid', $data['uid'])->find();
$user = User::getDB()->where('uid', $data['uid'])->find(); $user->all_value = bcadd($user->all_value, $user_value, 2);
$user->all_value = bcadd($user->all_value, $user_value, 2); //增加生命值
//增加生命值 if (!empty($user_hb)) {
if (!empty($user_hb)) { $user->hp_value = bcadd($user->hp_value, $user_hb, 2);
$user->hp_value = bcadd($user->hp_value, $user_hb, 2);
}
$user->save();
$user_log_data[] = [
'type' => 6,
'types_of' => 1,
'num' => $user_value,
'ctime' => date('Y-m-d H:i:s'),
'memo' => '订单消费贡献值',
'user_id' => $data['uid'],
];
} }
$user->save();
$user_log_data[] = [
'type' => 6,
'types_of' => 1,
'num' => $user_value,
'ctime' => date('Y-m-d H:i:s'),
'memo' => '订单消费贡献值',
'user_id' => $data['uid'],
];
//处理合作人角色是否包含此商品品牌 //处理合作人角色是否包含此商品品牌

Loading…
Cancel
Save