推广后台bug修正

master
zhengyongxing 5 years ago
parent a7f6d8b7a4
commit 77da9cf429

@ -244,17 +244,21 @@ class PromoteController extends BaseController
$today = total(1);
$week = total(2);
$mounth = total(3);
$yesterday = total(5);
$map1['promote_id'] = $map['promote_id'] = array('gt', 0);
$map1['pay_status'] = $map['pay_status'] = 1;
$map1['pay_way'] = $map['pay_way'] = array('gt', 0);
$userId = [];
$promoteId = M("promote", "tab_")->field('id')->where("parent_id=" . get_pid() . " or grand_id=" . get_pid())->select();
$grandPromote = get_pid();
$promoteId = M("promote", "tab_")->field('id')->where("chain like '%/{$grandPromote}/%' or id = {$grandPromote}")->select();
$promoteId = array_column($promoteId, 'id');
$promoteId = implode(',', $promoteId) . "," . get_pid();
$promoteId = implode(',', $promoteId);
$whereUser['promote_id'] = ['IN', $promoteId];
if ($type == 1) {
$start = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
$end = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1;
@ -313,21 +317,26 @@ class PromoteController extends BaseController
->group('promote_id')
->select(false);
// $promote_map = "tp1.`chain` = '/'";
$promote_id = get_pid();
$promote_map = "tp1.`id` = {$promote_id}";
$spendData = $spend->field('t.pid as promote_id,t.promote_account,sum(a.scount) AS count,sum(a.today) AS today,sum(a. WEEK) AS WEEK,sum(a.mounth) AS mounth')
$data = $spend->field('t.pid as promote_id,t.promote_account,sum(a.scount) AS count,sum(a.today) AS today,sum(a. WEEK) AS WEEK,sum(a.mounth) AS mounth')
->join("INNER JOIN (SELECT tp2.*, tp1.id AS pid, tp1.account as promote_account FROM tab_promote tp1 LEFT JOIN tab_promote tp2 ON tp2.`chain` LIKE CONCAT('%/', tp1.id, '/%') where $promote_map ) AS t ON promote_id = t.id")
->where($condition)->table('(' . $spendData . ') as a')->group('t.pid')->order('count desc,a.ordertime')->find();
// var_dump($spendData);die();
$spendData['rand'] = 1;
$spendData['count'] = $spendData['count'] / 100;
$spendData['today'] = $spendData['today'] / 100;
$spendData['week'] = $spendData['week'] / 100;
$spendData['mounth'] = $spendData['mounth'] / 100;
return $spendData;
$spendData1 = $spend->field('t.pid as promote_id,t.promote_account,sum(a.scount) AS count,sum(a.today) AS today,sum(a. WEEK) AS WEEK,sum(a.mounth) AS mounth')
->join("INNER JOIN (SELECT tp2.*, tp1.id AS pid, tp1.account as promote_account FROM tab_promote tp1 LEFT JOIN tab_promote tp2 ON tp2.`chain` LIKE CONCAT('%/', tp1.id, '/%') ) AS t ON promote_id = t.id")
->where($condition)->table('(' . $spendData . ') as a')->group('t.pid')->order('count desc,a.ordertime')->find();
$data['rand'] = 1;
$data['count'] = $data['count'] / 100;
$data['today'] = $spendData1['today'] / 100;
$data['week'] = $spendData1['week'] / 100;
$data['mounth'] = $spendData1['mounth'] / 100;
return $data;
}
private function pay_total($type = 0, $newadd = 1, $promoteId = "")

@ -106,11 +106,11 @@
<div class="form-group normal_space fl">
<label class="form-title select-title" style="position: relative;">申请时间:</label>
<div class="select-time">
<input type="text" id="sdate" class="txt" name="begtime" placeholder="开始时间" value="{:I('begtime')}">
<input type="text" id="sdate" class="txt" name="begtime" placeholder="开始时间" value="{:I('begtime')}" autocomplete="off">
</div>
<label class="form-title select-title zhi_color">&nbsp;&nbsp;</label>
<div class="select-time">
<input type="text" id="edate" class="txt" name="endtime" placeholder="结束时间" value="{:I('endtime')}">
<input type="text" id="edate" class="txt" name="endtime" placeholder="结束时间" value="{:I('endtime')}" autocomplete="off">
</div>
</div>

@ -154,14 +154,14 @@
<div class="form-group normal_space fr">
<label class="form-title select-title" style="margin-right: 9px;"></label>
<div class="select-time">
<input type="text" id="edate" class="txt" name="end" placeholder="结束时间" value="{:I('end')}">
<input type="text" id="edate" class="txt" name="end" placeholder="结束时间" value="{:I('end')}" autocomplete="off">
</div>
</div>
<div class="form-group normal_space fr">
<label class="form-title select-title">申请时间:</label>
<div class="select-time">
<input type="text" id="sdate" class="txt" name="start" placeholder="开始时间"
value="{:I('start')}">
value="{:I('start')}" autocomplete="off">
</div>
</div>
<div class="form-group normal_space fr">

@ -46,13 +46,13 @@
<div class="form-group normal_space fr" style="margin-left: 9px;">
<label class="form-title select-title" style="margin-right: 9px;"></label>
<div class="select-time">
<input type="text" id="edate" class="txt" name="end" placeholder="结束时间" value="{:I('end')}">
<input type="text" id="edate" class="txt" name="end" placeholder="结束时间" value="{:I('end')}" autocomplete="off">
</div>
</div>
<div class="form-group normal_space fr">
<label class="form-title select-title">申请时间:</label>
<div class="select-time">
<input type="text" id="sdate" class="txt" name="start" placeholder="开始时间" value="{:I('start')}" >
<input type="text" id="sdate" class="txt" name="start" placeholder="开始时间" value="{:I('start')}" autocomplete="off">
</div>
</div>

@ -68,13 +68,13 @@
<div class="form-group normal_space fl">
<label class="form-title select-title">申请时间:</label>
<div class="select-time">
<input type="text" id="sdate" class="txt" name="start" placeholder="开始时间" value="{:I('start')}" >
<input type="text" id="sdate" class="txt" name="start" placeholder="开始时间" value="{:I('start')}" autocomplete="off">
</div>
</div>
<div class="form-group normal_space fl" style="margin-left: 9px;">
<label class="form-title select-title" style="margin-right: 9px;"></label>
<div class="select-time">
<input type="text" id="edate" class="txt" name="end" placeholder="结束时间" value="{:I('end')}">
<input type="text" id="edate" class="txt" name="end" placeholder="结束时间" value="{:I('end')}" autocomplete="off">
</div>
</div>

Loading…
Cancel
Save