userslog_424
This commit is contained in:
@@ -122,6 +122,25 @@ class Userslog extends HD_Controller
|
||||
$lists[] = $temp;
|
||||
}
|
||||
}
|
||||
if ($params['size'] != 10000) {
|
||||
$sum = $this->mdUsersLog->sum('customers', $where);
|
||||
$menus[] = ['title' => "客户数", 'value' => $sum['customers'], 'tag' => '人'];
|
||||
$sum = $this->mdUsersLog->sum('a_num', $where);
|
||||
$menus[] = ['title' => "进店数", 'value' => $sum['a_num'], 'tag' => '人'];
|
||||
$sum = $this->mdUsersLog->sum('follows', $where);
|
||||
$menus[] = ['title' => "跟进数", 'value' => $sum['follows'], 'tag' => '个'];
|
||||
$sum = $this->mdUsersLog->sum('orders', $where);
|
||||
$menus[] = ['title' => "订单数", 'value' => $sum['orders'], 'tag' => '个'];
|
||||
$sum = $this->mdUsersLog->sum('defeats', $where);
|
||||
$menus[] = ['title' => "战败数", 'value' => $sum['defeats'], 'tag' => '个'];
|
||||
$sum = $this->mdUsersLog->sum('bills', $where);
|
||||
$menus[] = ['title' => "开票数", 'value' => $sum['bills'], 'tag' => '个'];
|
||||
$sum = $this->mdUsersLog->sum('qy_adds', $where);
|
||||
$menus[] = ['title' => "新增企微", 'value' => $sum['qy_adds'], 'tag' => '人'];
|
||||
$sum = $this->mdUsersLog->sum('qy_dels', $where);
|
||||
$menus[] = ['title' => "删除企微", 'value' => $sum['qy_dels'], 'tag' => '人'];
|
||||
$data['menus'] = $menus;
|
||||
}
|
||||
$data['pager'] = array('count' => ceil($total / $params['size']), 'curr' => $params['page'], 'totle' => $total);
|
||||
$data['lists'] = $lists;
|
||||
$data['params'] = $params;
|
||||
@@ -164,7 +183,7 @@ class Userslog extends HD_Controller
|
||||
}
|
||||
$indexs = ['biz_name' => '门店', 'uname' => '顾问', 'customers' => '客户数'];
|
||||
foreach ($offlineSources as $key1 => $value1) {
|
||||
$indexs['customer_' . $key1] = '【'.$value1['name'].'】';
|
||||
$indexs['customer_' . $key1] = '【' . $value1['name'] . '】';
|
||||
foreach ($value1['list'] as $key2 => $value2) {
|
||||
$indexs['customer_' . $key2] = $value2;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<? foreach ($menus as $key => $value) { ?>
|
||||
<td class="my-panel text-center">
|
||||
<?= $value['title'] ?><br><?= $value['value'] ?><?= $value['tag'] ?>
|
||||
</td>
|
||||
<? } ?>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="coms-table-wrap mt10">
|
||||
<form id="vue-app" class=" form-search coms-table-hd clearfix no-border" onsubmit="return false"
|
||||
action="app/licheb/userslog">
|
||||
@@ -75,6 +84,7 @@
|
||||
</div>
|
||||
</form>
|
||||
<div class="coms-table-bd">
|
||||
<div class="fl"></div>
|
||||
<div class="fr">共有<?= $pager['totle'] ?>条数据</div>
|
||||
<table class="am-table am-table-bordered">
|
||||
<thead>
|
||||
@@ -272,3 +282,13 @@
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
.my-panel {
|
||||
padding: 10px;
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
|
||||
.my-panel span {
|
||||
font-size: 20px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -90,7 +90,7 @@ class Licheb extends HD_Controller
|
||||
$bills = $this->mdOrdersV2->count(['sale_id' => $sale_id, 'biz_id' => $biz_id, 'status>=' => 0,
|
||||
'bill_time>=' => "{$log_date} 00:00:00", 'bill_time<=' => "{$log_date} 23:59:59"]
|
||||
);
|
||||
$qy_adds = $qy_dels = 0;
|
||||
$qy_adds = $qy_dels = $customers = 0;
|
||||
if ($value['userid']) {
|
||||
$qy_adds = $this->mdWechatqyLog->count(['userid' => $value['userid'], 'change_type' => 'add_external_contact'
|
||||
, 'c_time>=' => $s_time, 'c_time<=' => $e_time]);
|
||||
@@ -105,6 +105,7 @@ class Licheb extends HD_Controller
|
||||
$customer_num1 = $this->mdCustomers->count(['of_id' => $key1, 'admin_id' => $sale_id
|
||||
, 'status>=' => 0, 'c_time>=' => $s_time, 'c_time<=' => $e_time]);
|
||||
if ($customer_num1) {//一级
|
||||
$customers += $customer_num1;
|
||||
$add_item["customer_{$key1}"] = $customer_num1;
|
||||
$list = '';
|
||||
foreach ($value1['list'] as $key2 => $value2) {
|
||||
@@ -118,6 +119,7 @@ class Licheb extends HD_Controller
|
||||
}
|
||||
}
|
||||
$customer_json && $add_item['customer_json'] = json_encode($customer_json, JSON_UNESCAPED_UNICODE);
|
||||
$add_item['customers'] = $customers;
|
||||
$add_id = $this->mdUsersLog->add($add_item);
|
||||
$add_id && $log[] = array('id' => $sale_id, 'addDate' => $add_item);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,47 @@ class Temp extends HD_Controller
|
||||
$this->log_file = 'temp.log';
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:更新顾问客户数
|
||||
* Created on: 2022/3/09 11:58
|
||||
* Created by: dengbw
|
||||
* https://liche-api-dev.xiaoyu.com/plan/temp/receiver_users_log
|
||||
* https://api.liche.cn/plan/temp/receiver_users_log
|
||||
*/
|
||||
public function receiver_users_log()
|
||||
{
|
||||
$this->load->model('app/licheb/app_licheb_users_log_model', 'mdUsersLog');
|
||||
$param = $this->input->get();
|
||||
$param['page'] = intval($param['page']);
|
||||
$param['size'] = intval($param['size']);
|
||||
!$param['size'] && $param['size'] = 200;
|
||||
!$param['page'] && $param['page'] = 1;
|
||||
$counts = intval($param['counts']);
|
||||
ob_start(); //打开缓冲区
|
||||
$where = ["id>" => 0];
|
||||
$res = $this->mdUsersLog->select($where, 'id ASC', $param['page'], $param['size'], 'id,customer_1,customer_2,customer_3
|
||||
,customer_4,customer_5');
|
||||
if (!$res) {
|
||||
echo '<br>本次更新顾问客户数完成了:';
|
||||
echo '<br><br>成功更新 <span style="color: red;">' . $counts . '</span> 条';
|
||||
echo '<br><br><a href="/plan/temp/receiver_users_log">点击将再次更新顾问客户数>>></a>';
|
||||
exit;
|
||||
}
|
||||
$log = array();
|
||||
foreach ($res as $key => $value) {
|
||||
$customers = $value['customer_1'] + $value['customer_2'] + $value['customer_3'] + $value['customer_4'] + $value['customer_5'];
|
||||
$this->mdUsersLog->update(['customers' => $customers], ['id' => $value['id']]);
|
||||
$log[] = ['id' => $value['id'], 'customers' => $customers];
|
||||
$counts++;
|
||||
}
|
||||
echo '<br>成功更新:';
|
||||
$log && print_r($log);
|
||||
echo '<br><br>数据库获取:';
|
||||
echo json_encode($res, JSON_UNESCAPED_UNICODE);
|
||||
header('refresh:3;url=/plan/temp/receiver_users_log?counts=' . $counts . '&size=' . $param['size'] . '&page=' . ($param['page'] + 1));
|
||||
ob_end_flush();//输出全部内容到浏览器
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:更新战败客户信息
|
||||
* Created on: 2022/3/09 11:58
|
||||
|
||||
Reference in New Issue
Block a user