parent
5796e5e96e
commit
210d1a88a9
|
|
@ -323,7 +323,7 @@ class Income extends BaseModel
|
|||
public static function getAllIncome($uid,$contentType = 'all'){
|
||||
// 这里查询不包括 经销商、分销商、股东分红相关佣金
|
||||
$otherTotal = (float)Income::uniacid()
|
||||
->whereNotIn('dividend_code',[1,2,64])
|
||||
->whereNotIn('dividend_code',[1,2,64,201])
|
||||
->where('member_id', $uid)
|
||||
->sum('amount');
|
||||
// 获取经销商提成 分红类型:0=分红佣金,1=平级奖,2=感恩奖励,3=额外分红,4=生态建设,5=生态贡献(生态建设平级奖),6=生态服务
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ class IncomeController extends ApiController
|
|||
})->orWhere(function($threeQuery){
|
||||
$threeQuery->where('yz_member_income.dividend_code',64)->where('yz_shareholder_dividend.income_type',0);
|
||||
})->orWhere(function($threeQuery){
|
||||
$threeQuery->whereNotIn('yz_member_income.dividend_code',[1,2,64]);
|
||||
$threeQuery->whereNotIn('yz_member_income.dividend_code',[1,2,64,201]);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,12 +75,13 @@ class UpgrateByOrderJob implements ShouldQueue
|
|||
} else {
|
||||
// 分销商的等级权重
|
||||
$agent_level_weight = isset($agent->agentLevel->level) ? $agent->agentLevel->level : 0;
|
||||
$culturalLevelWeight = isset($agent->culturalLevel->level) ? $agent->culturalLevel->level : 0;
|
||||
// uid 重新赋值
|
||||
$this->uid = $agent->member_id;
|
||||
\Log::debug('UID['.$this->uid.']要进行升级');
|
||||
// file_put_contents(storage_path('logs/Y0914.txt'), print_r('time:'.date('Y-m-d H:i:s').',UID['.$this->uid.']要进行升级'.PHP_EOL,1), FILE_APPEND);
|
||||
// 下一步
|
||||
$this->fecLevels($agent_level_weight);
|
||||
$this->fecLevels($agent_level_weight,$culturalLevelWeight);
|
||||
}
|
||||
|
||||
// 递归当前
|
||||
|
|
@ -88,15 +89,18 @@ class UpgrateByOrderJob implements ShouldQueue
|
|||
}
|
||||
}
|
||||
|
||||
private function fecLevels($level_weight)
|
||||
private function fecLevels($level_weight,$culturalLevelWeight)
|
||||
{
|
||||
\Log::debug('$level_weight',$level_weight);
|
||||
$is_upgrate = true;
|
||||
foreach ($this->levels as $level) {
|
||||
// 当前等级的等级权重 小于等于 分销商等级的等级权重
|
||||
if ($level['level'] <= $level_weight) {
|
||||
if(($level['level_type'] == 0 && $level['level'] <= $level_weight) || ($level['level_type'] == 1 && $level['level'] <= $culturalLevelWeight)){
|
||||
continue;
|
||||
}
|
||||
// if ($level['level'] <= $level_weight) {
|
||||
// continue;
|
||||
// }
|
||||
// 判断条件
|
||||
$condition = $this->getCondition($level);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue