渠道流水计算

master
sunke 5 years ago
commit 127c7a0328

@ -1593,24 +1593,23 @@ class QueryController extends ThinkController
$promoteInfo = M('promote','tab_')->where(['id'=>$promote_id])->find();
$level = $promoteInfo['level'];
if($promote_id != 0) {
$promoteIdArr = [];
if ($level == 1) {
$rootPromoteId = $promote_id;
$where['promote_id'] = $promote_id;
$promoteIdArr[] = $promote_id;
}else {
$chain = $promoteInfo['chain'];
$chainArr = explode('/',$chain);
$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 {
$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();
$level = $promoteInfo['level'];
if($promote_id != 0) {
$promoteIdArr = [];
if ($level == 1) {
$rootPromoteId = $promote_id;
$map['promote_id'] = $promote_id;
$promoteIdArr[] = $promote_id;
}else {
$chain = $promoteInfo['chain'];
$chainArr = explode('/',$chain);
$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 {
$map['promote_id'] = 0;
}
var_dump($level);
$pay_status = 1;
$map['game_id'] = ['in',$gameNameIdArr];
// $map['promote_id'] = ['in',$promoteIdArr];

Loading…
Cancel
Save