直推贡献值

main
limu 10 months ago
parent 491a827300
commit 3415d4fe5e
  1. 16
      crmeb/jobs/OrderPartnerJob.php

@ -179,6 +179,22 @@ class OrderPartnerJob implements JobInterface
'user_id' => $data['uid'], 'user_id' => $data['uid'],
]; ];
//直推贡献10%
if(!empty($data['spread_uid'])){
$user_zt = User::getDB()->where('uid', $data['spread_uid'])->find();
$zt_value = bcmul($total_price, 0.1, 2);
$user_zt->all_value = bcadd($user_zt->all_value, $zt_value, 2);
$user_zt->save();
$user_log_data[] = [
'type' => 6,
'types_of' => 1,
'num' => $user_value,
'ctime' => date('Y-m-d H:i:s'),
'memo' => '订单直推消费贡献值',
'user_id' => $data['spread_uid'],
];
}
//处理合作人角色是否包含此商品品牌 //处理合作人角色是否包含此商品品牌
if (!empty($brand_ids)) { if (!empty($brand_ids)) {

Loading…
Cancel
Save