|
|
|
@ -169,7 +169,7 @@ class UserAssetsLogRepository extends BaseRepository |
|
|
|
|
$this->breedAssets($startProjectUid, $orderItem['order_id'], $config, $base); |
|
|
|
|
|
|
|
|
|
// 4.区域代理资产 |
|
|
|
|
$this->agentAssets($orderItem['district_id'], $orderItem['order_id'], $config, $base); |
|
|
|
|
$this->agentAssets($orderItem['mer_id'], $orderItem['order_id'], $config, $base); |
|
|
|
|
|
|
|
|
|
// 5. 推荐资产 |
|
|
|
|
$this->recommendAssets($orderItem['mer_id'], $orderItem['order_id'], $config, $base); |
|
|
|
@ -327,9 +327,20 @@ class UserAssetsLogRepository extends BaseRepository |
|
|
|
|
* @author zhangkxiang |
|
|
|
|
* @editor |
|
|
|
|
*/ |
|
|
|
|
public function agentAssets($districtId, $orderId, $config, $base) |
|
|
|
|
public function agentAssets($merId, $orderId, $config, $base) |
|
|
|
|
{ |
|
|
|
|
$consume = $welfare = $huitong = $contribution = 0; |
|
|
|
|
$merRepository = app(MerchantRepository::class); |
|
|
|
|
$merchant = $merRepository->get($merId); |
|
|
|
|
if(empty($merchant)){ |
|
|
|
|
return ; |
|
|
|
|
} |
|
|
|
|
$districtArr = explode(',', $merchant['district_id']); |
|
|
|
|
if(count($districtArr) != 3){ |
|
|
|
|
return ; |
|
|
|
|
} |
|
|
|
|
$districtId = $districtArr[2]; |
|
|
|
|
Log::info("agentAssets districtId is {$districtId}"); |
|
|
|
|
/** |
|
|
|
|
* @var UserRepository $userRepository |
|
|
|
|
*/ |
|
|
|
@ -339,7 +350,7 @@ class UserAssetsLogRepository extends BaseRepository |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 1. 项目经理的福利积分 |
|
|
|
|
// 1. 区域代理的福利积分 |
|
|
|
|
$orderWelfare = round($base * $config['welfare_agent'] / 100, 2); |
|
|
|
|
$welfare = $this->_getValue($orderWelfare); |
|
|
|
|
$logList[] = array( |
|
|
|
@ -541,7 +552,7 @@ class UserAssetsLogRepository extends BaseRepository |
|
|
|
|
// 如果该订单奖励基数大于0 |
|
|
|
|
if ($base) { |
|
|
|
|
// 2. 本人的福利积分 |
|
|
|
|
$orderWelfare = round($base * 0.1, 2); |
|
|
|
|
$orderWelfare = round($base * $config['welfare_user'] / 100, 2); |
|
|
|
|
$welfare = $this->_getValue($orderWelfare); |
|
|
|
|
$logList[] = array( |
|
|
|
|
'uid' => $orderItem['uid'], |
|
|
|
@ -654,6 +665,9 @@ class UserAssetsLogRepository extends BaseRepository |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 退款删除订单 |
|
|
|
|
app(StoreOrderBaseRepository::class)->deleteByOrderId($orderItem['order_id']); |
|
|
|
|
|
|
|
|
|
// 更新该订单的所有数据为退款状态 |
|
|
|
|
$this->dao->updateOrderStatus($orderItem['order_id'], self::STATUS_REFUND); |
|
|
|
|
} |
|
|
|
|