渠道流水计算

master
sunke 5 years ago
parent c0e506a89d
commit 5fe238ccbd

@ -1593,24 +1593,23 @@ class QueryController extends ThinkController
$promoteInfo = M('promote','tab_')->where(['id'=>$promote_id])->find(); $promoteInfo = M('promote','tab_')->where(['id'=>$promote_id])->find();
$level = $promoteInfo['level']; $level = $promoteInfo['level'];
if($promote_id != 0) { if($promote_id != 0) {
$promoteIdArr = [];
if ($level == 1) { if ($level == 1) {
$rootPromoteId = $promote_id; $rootPromoteId = $promote_id;
$where['promote_id'] = $promote_id; $promoteIdArr[] = $promote_id;
}else { }else {
$chain = $promoteInfo['chain']; $chain = $promoteInfo['chain'];
$chainArr = explode('/',$chain); $chainArr = explode('/',$chain);
$rootPromoteId = $chainArr[1]; $rootPromoteId = $chainArr[1];
$where1['chain'] = array('like', '%/' . $rootPromoteId. '/%');
$promoteIdInfo = M('promote','tab_')->field('id')->where($where1)->select();
$promoteIdArr = [];
foreach($promoteIdInfo as $key2 => $v1) {
$promoteIdArr[] = $v1['id'];
}
$where['promote_id'] = ['in',$promoteIdArr];
} }
$where1['chain'] = array('like', '%/' . $rootPromoteId. '/%');
$promoteIdInfo = M('promote','tab_')->field('id')->where($where1)->select();
foreach($promoteIdInfo as $key2 => $v1) {
$promoteIdArr[] = $v1['id'];
}
$map['promote_id'] = ['in',$promoteIdArr];
}else { }else {
$where['promote_id'] = 0; $map['promote_id'] = 0;
} }
@ -1911,25 +1910,25 @@ class QueryController extends ThinkController
$promoteInfo = M('promote','tab_')->where(['id'=>$promote_id])->find(); $promoteInfo = M('promote','tab_')->where(['id'=>$promote_id])->find();
$level = $promoteInfo['level']; $level = $promoteInfo['level'];
if($promote_id != 0) { if($promote_id != 0) {
$promoteIdArr = [];
if ($level == 1) { if ($level == 1) {
$rootPromoteId = $promote_id; $rootPromoteId = $promote_id;
$map['promote_id'] = $promote_id; $promoteIdArr[] = $promote_id;
}else { }else {
$chain = $promoteInfo['chain']; $chain = $promoteInfo['chain'];
$chainArr = explode('/',$chain); $chainArr = explode('/',$chain);
$rootPromoteId = $chainArr[1]; $rootPromoteId = $chainArr[1];
$where1['chain'] = array('like', '%/' . $rootPromoteId. '/%');
$promoteIdInfo = M('promote','tab_')->field('id')->where($where1)->select();
$promoteIdArr = [];
foreach($promoteIdInfo as $key2 => $v1) {
$promoteIdArr[] = $v1['id'];
}
$map['promote_id'] = ['in',$promoteIdArr];
} }
$where1['chain'] = array('like', '%/' . $rootPromoteId. '/%');
$promoteIdInfo = M('promote','tab_')->field('id')->where($where1)->select();
foreach($promoteIdInfo as $key2 => $v1) {
$promoteIdArr[] = $v1['id'];
}
$map['promote_id'] = ['in',$promoteIdArr];
}else { }else {
$map['promote_id'] = 0; $map['promote_id'] = 0;
} }
var_dump($level);
$pay_status = 1; $pay_status = 1;
$map['game_id'] = ['in',$gameNameIdArr]; $map['game_id'] = ['in',$gameNameIdArr];
// $map['promote_id'] = ['in',$promoteIdArr]; // $map['promote_id'] = ['in',$promoteIdArr];

Loading…
Cancel
Save