edit-admin-distribution

This commit is contained in:
lccsw
2021-12-22 14:01:30 +08:00
parent 12719a8faa
commit 7680ba8948
3 changed files with 20 additions and 45 deletions
@@ -135,9 +135,6 @@ class Distribution extends AppBase
$lists = $where = array();
$_title = $reU['nickname'] ? '【' . $reU['nickname'] . '】分销团队' : '分销团队';
$where_base = array('app_id' => $this->app_id, 'app_uid' => $up_uid);
if (!$params['time']) {
$params['time'] = date('Y-m-d') . ' ~ ' . date('Y-m-d');
}
if ($params['time']) {
$time = explode(' ~ ', $params['time']);
$time[0] && $where_base["c_time >="] = strtotime($time[0] . ' 00:00:00');
@@ -164,6 +161,9 @@ class Distribution extends AppBase
} else if ($params['statistical'] == 2) {//粉丝
$where = array('dealer' => 0, 'up_uid' => $up_uid);
}
if ($params['mobile']){
$where["mobile like '%{$params['mobile']}%'"] = null;
}
$resU = $this->mdAppUser->select($where, 'id DESC', $params['page'], $params['size'], 'id,nickname,mobile');
$count = $this->mdAppUser->count($where);
$params['statistical'] == 1 && $count += 1;
@@ -200,6 +200,11 @@ class Distribution extends AppBase
$lists[] = $setValue;
}
}
if($params['mobile']){
$uids = 0;
$resU && $uids = implode(',',array_column($resU,'id'));
$where_base["t_uid in ({$uids})"] = null;
}
$this->data['team_orders'] = $this->mdDealLog->count($where_base);
$where3 = $where_base;
$where3['status'] = 1;
@@ -251,43 +256,11 @@ class Distribution extends AppBase
$res = $this->mdDealLog->select($where, 'id DESC', $params['page'], $params['size'], 'cf_sid,type,status,money,c_time');
foreach ($res as $key => $value) {
$setValue = array();
$source = $item_title = '';
$item_num = 0;
$total_price = $expect_money = 0.00;
if ($reOp) {
$item_title = $reOp['item_title'];
$item_num = $reOp['item_num'];
$total_price = $reOp['total_price'];
if ($value['type'] == 0) {//自己购买
$source .= '自己购买';
} else if ($value['type'] == 1) {//团员购买
$reU = $this->mdAppUser->get(array('id' => $reOp['app_uid']), 'nickname');
$source .= '团员 ' . $reU['nickname'];
} else if ($value['type'] == 2) {//粉丝购买
$reU = $this->mdAppUser->get(array('id' => $reOp['app_uid']), 'nickname');
$source .= '粉丝 ' . $reU['nickname'];
} else if ($value['type'] == 3) {//团员粉丝购买
$reU = $this->mdAppUser->get(array('id' => $reOp['app_uid']), 'nickname,up_uid');
if ($this->app_info()['lock_fans'] == 1) {
$reU2 = $this->mdAppUser->get(array('id' => $reU['up_uid']), 'nickname');
} else {
$reU2 = $this->mdAppUser->get(array('id' => $value['t_uid']), 'nickname');
}
$nickname = $reU['nickname'] ? $reU['nickname'] : '神秘人';
$nickname2 = $reU2['nickname'] ? $reU2['nickname'] : '神秘人';
if ($reU2) {
$source .= '团粉 ' . $nickname2 . '>>' . $nickname;
} else {
$source .= '团粉 ' . $nickname;
}
}
}
$setValue['source'] = $source;
$expect_money = 0.00;
$setValue['cf_sid'] = $value['cf_sid'];
$setValue['status'] = $value['status'];
$setValue['status_name'] = $statusAry[$value['status']];
$setValue['expect_money'] = $value['money'];
$setValue['item_title'] = $item_title;
$setValue['item_num'] = $item_num;
$setValue['total_price'] = number_format_com($total_price);
$setValue['c_time'] = date('Y-m-d H:i:s', $value['c_time']);
$lists[] = $setValue;
@@ -30,10 +30,8 @@
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="10%"><span>商品标题</span></th>
<th width="10%"><span>商品价格</span></th>
<th width="10%"><span>购车订单号</span></th>
<th width="10%"><span>佣金</span></th>
<th width="10%"><span>订单来源</span></th>
<th width="10%"><span>状态</span></th>
<th width="10%"><span>创建时间</span></th>
</tr>
@@ -42,10 +40,8 @@
<?php if ($lists) {
foreach ($lists as $v) { ?>
<tr>
<td><?= $v['item_title'] ?></td>
<td><?= $v['total_price'] ?></td>
<td><?= $v['cf_sid'] ?></td>
<td><?= $v['expect_money'] ?></td>
<td><?= $v['source'] ?></td>
<td><?= $v['status_name'] ?></td>
<td><?= $v['c_time'] ?></td>
</tr>
@@ -4,9 +4,15 @@
<input type="hidden" name="up_uid" value="<?= $params['up_uid'] ?>">
<input type="hidden" name="statistical" value="<?= $params['statistical'] ?>">
<div class="am-form am-form-horizontal">
<div class="am-form-group fl">
<label class="am-para-label w100">电话:</label>
<div class="am-para-inline w150">
<input type="text" name="mobile" value="<?= $params['mobile'] ?>" placeholder="请输入手机号"/>
</div>
</div>
<div class="am-form-group fl">
<div class="am-para-inline w300">
<input id="order-lists-time" type="text" name="time" value="<?= $params['time'] ?>"
<input id="order-lists-time" type="text" name="time" value="<?= $params['time'] ?>" autocomplete="off"
placeholder="统计日期范围"/>
</div>
</div>
@@ -55,7 +61,7 @@
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="50"><span>ID</span></th>
<th width="7%"><span>ID</span></th>
<th width="10%"><span>团员名称</span></th>
<th width="10%"><span>订单数</span></th>
<th width="10%"><span>成功数</span></th>