|
|
|
@ -1341,11 +1341,21 @@ class DownloadController extends BaseController {
|
|
|
|
|
$ids = array_column($data, 'id');
|
|
|
|
|
$rows = [];
|
|
|
|
|
if (count($ids) > 0) {
|
|
|
|
|
$rows = M('promote', 'tab_')->field(['id', 'parent_id'])->where(['parent_id' => ['in', $ids]])->select();
|
|
|
|
|
$rows = M('promote', 'tab_')
|
|
|
|
|
->field(['id', 'chain'])
|
|
|
|
|
->where(['chain' => ['like', [$parent['chain'] . $parent['id'] . '/%']], 'level' => ['gt', $parent['level'] + 1]])
|
|
|
|
|
->select();
|
|
|
|
|
}
|
|
|
|
|
$basicPromotes = [];
|
|
|
|
|
foreach ($rows as $row) {
|
|
|
|
|
$basicPromotes[$row['id']] = $row['parent_id'];
|
|
|
|
|
|
|
|
|
|
$basicPromotes = [];
|
|
|
|
|
foreach ($ids as $id) {
|
|
|
|
|
foreach ($rows as $row) {
|
|
|
|
|
$needChain = $parent['chain'] . $parent['id'] . '/' . $id . '/';
|
|
|
|
|
if (strpos($row['chain'], $needChain) !== false) {
|
|
|
|
|
$basicPromotes[$row['id']] = $id;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$map = [
|
|
|
|
|
'isContainSubs' => true,
|
|
|
|
@ -2619,6 +2629,7 @@ class DownloadController extends BaseController {
|
|
|
|
|
}
|
|
|
|
|
$params['begin_time'] = $map['begin_time'];
|
|
|
|
|
$params['end_time'] = $map['end_time'];
|
|
|
|
|
|
|
|
|
|
$promoteRepository = new PromoteRepository();
|
|
|
|
|
$createRoleCountList = $promoteRepository->getCreateRoleCountByIds($ids, $params);
|
|
|
|
|
$createRoleUserCountList = $promoteRepository->getCreateRoleUserCountByIds($ids, $params);
|
|
|
|
|