This commit is contained in:
xiaoyu
2024-02-04 20:01:42 +08:00
parent 9c98164bde
commit 34eacaf338
6 changed files with 178 additions and 12 deletions
+2 -2
View File
@@ -79,8 +79,8 @@ class Clues extends HD_Controller
),
'101204' => array(
'biz' => '东莞金屹',
'sa' => '姚宗亮',
'mobile' => '13612751915'
'sa' => '林耿文',
'mobile' => '17688624688'
),
'101043' => array(
'biz' => '惠州华致',
+4
View File
@@ -48,6 +48,8 @@ class Act extends Wxapp
$ukey = $this->input_param('ukey');
$reward_id = $this->input_param('reward_id');
debug_log("[info]# " . json_encode($this->input_param(),JSON_UNESCAPED_UNICODE), 'market/sylive','neta.log');
//$reward_id 对应 winType
$winTypes = array(
'5051' => '1', //电视机
@@ -105,6 +107,8 @@ class Act extends Wxapp
$ukey = $this->input_param('ukey');
$car = $this->input_param('car');
debug_log("[info]# " . json_encode($this->input_param(),JSON_UNESCAPED_UNICODE), 'market/sylive','neta.log');
$activity = $this->market_sylive_activity_model->get(['activityId' => $activityId]);
if (!$activity) {
throw new Hd_exception('活动不存在', API_CODE_FAIL);
+4 -4
View File
@@ -16,11 +16,11 @@ class Welcome extends CI_Controller {
//测试地址
//$url = 'https://salespp-sit.hozonauto.com/appservice/app/if/salesclue/createSalesclue';
$name = '冯生'; //客户姓名
$mobile = '13702972770';//客户手机
$name = '......'; //客户姓名
$mobile = '18664090524';//客户手机
$comments = '101252'; //门店编码
$samobile = '13790011910';//销售手机
$comments = '101204'; //门店编码
$samobile = '17688624688';//销售手机
$city_id = '350200';
$voId = $city_id . date('mdHis') . sprintf("%06d", rand(1,999999));
+10 -3
View File
@@ -540,7 +540,13 @@ class Act extends Wx {
$jsondata = json_decode($ac_row['jsondata'],true);
$act_user_row = $this->act_user_model->get(['id'=>$this->act_uid]);
$p_user = [];
$act_user_row['channelId'] && $p_user = $this->act_user_model->get(['userId'=>$act_user_row['channelId'],'activityId'=>$a_id]);
if($act_user_row['channelId'] != $act_user_row['pid'] && $act_user_row['pid'] && in_array($a_id, array(27))) {
$p_user = $this->act_user_model->get(['userId'=>$act_user_row['pid'], 'activityId' => $a_id]);
} else{
$p_user = $this->act_user_model->get(['userId'=>$act_user_row['channelId'],'activityId' => $a_id]);
}
$ukey = md5($a_id.$mobile);
$add_data = [
'activityId' => $a_id,
@@ -551,7 +557,8 @@ class Act extends Wx {
'createTime' => date('Y-m-d H:i:s'),
'level' => 'H'
];
$act_user_row['channelId'] && $add_data['cfUserId'] = $act_user_row['channelId'];
$p_user && $add_data['cfUserId'] = $p_user['userId'];
$p_user['bizId'] && $add_data['bizId'] = $p_user['bizId'];
$p_user['levelId1'] && $add_data['levelId1'] = $p_user['levelId1'];
$p_user['levelId2'] && $add_data['levelId2'] = $p_user['levelId2'];
@@ -623,7 +630,7 @@ class Act extends Wx {
// }
//
// $data[] = array(
// 'cusSource3' => '023409',
// 'cusSource3' => '023410',
// 'customerName' => "活动客户",
// 'dealerCode' => $biz['comments'],
// 'fromSystem' => "好店云",
+73 -3
View File
@@ -1,4 +1,6 @@
<?php
//ini_set('display_errors', 'On');
//error_reporting(E_ERROR);
defined('BASEPATH') or exit('No direct script access allowed');
require_once 'Common.php';
@@ -11,9 +13,11 @@ class Stic extends Admin
public function __construct()
{
parent::__construct();
$this->load->model('market/market_sylive_user_model');
$this->load->model('market/market_sylive_activity_kpidata_model', 'mdSytActivityKpiData');
$this->load->model('market/market_sylive_items_model');
$this->load->model('market/market_sylive_order_model');
$this->load->model('market/market_sylive_activity_kpidata_model');
$this->load->model('live/Live_polyv_session_model', 'mdPolyvSession');
$this->load->library('market/sylive_entity');
$this->load->library('market/sylive2_entity');
@@ -142,6 +146,7 @@ class Stic extends Admin
$sub_lists = [
['title' => '我的', 'lists' => $mine],
];
if ($group_user['bizId']) {
$where = [
'activityId' => $this->a_id,
@@ -154,6 +159,19 @@ class Stic extends Admin
$where['kpi'] = 'beforeOrder';
$order_count = $this->mdSytActivityKpiData->count($where); //下单数据
//开工
$kg_where = [
'activityId' => $this->a_id,
'bizId' => $group_user['bizId'],
'status' => 0,
];
$gw_total = $this->groups_user_model->count($kg_where);
$kgw_where = [
'activityId' => $this->a_id,
"cfUserId in (SELECT userId FROM lc_market_sylive_groups_user WHERE activityId = {$this->a_id} and bizId =".$group_user['bizId']." and status = 0)" => null
];
$kgw_total = $this->mdSytActivityKpiData->count($kgw_where, 'cfUserId');
$biz = [
['title' => '访问用户', 'num' => "{$biz_browse_count}", 'url' => "/h5/market/sylive2/stic/users?type=biz&type_id={$group_user['bizId']}&kpi=browse"],
];
@@ -164,7 +182,7 @@ class Stic extends Admin
$biz[] = ['title' => '留资率', 'num' => $before_order_count ? round($before_order_count / $biz_browse_count * 100, 2) . "%" : 0];
} else {
$biz[] = ['title' => '预约用户', 'num' => "{$biz_subscribe_count}", 'url' => "/h5/market/sylive2/stic/users?type=biz&type_id={$group_user['bizId']}&kpi=subscribe"];
$biz[] = ['title' => '预约率', 'num' => $biz_browse_count ? round($biz_subscribe_count / $biz_browse_count * 100, 2) . "%" : 0];
$biz[] = ['title' => '开工率', 'num' => $kgw_total ? round($kgw_total / $gw_total * 100, 2) . "%" : 0, 'url' => "/h5/market/sylive2/stic/work?biz_id={$group_user['bizId']}"];
}
$biz[] = ['title' => '留资数', 'num' => "{$order_count}"];
$sub_lists[] = ['title' => '本店', 'lists' => $biz];
@@ -367,8 +385,12 @@ class Stic extends Admin
public function users()
{
$map_kpi_name = [
'browse' => '访问用户', 'subscribe' => '预约用户', 'order' => '下单数', 'watch' => '观看用户','beforeOrder' => '留资客户'
];
'browse' => '访问用户',
'subscribe' => '预约用户',
'order' => '下单数',
'watch' => '观看用户',
'beforeOrder' => '留资客户',
];
$params = $this->input->get();
$row = $this->market_sylive_activity_model->get(['activityId' => $this->a_id]);
if (!$row) {
@@ -390,6 +412,7 @@ class Stic extends Admin
];
$goods = $this->market_sylive_items_model->select($where, 'sort desc,itemId desc', 0, 0, 'itemId,title');
}
$this->data['title'] = $title;
$this->data['tab'] = $tab;
$this->data['params'] = $params;
@@ -422,6 +445,7 @@ class Stic extends Admin
if ($params['kpi'] == 'order' && $params['itemId']) {
$where["tagId in (select id from lc_market_sylive_order where itemId={$params['itemId']} and activityId={$this->a_id})"] = null;
}
$total = $this->mdSytActivityKpiData->count($where);
$lists = [];
if ($total) {
@@ -472,6 +496,52 @@ class Stic extends Admin
$this->show_json($data, 200);
}
public function work()
{
$params = $this->input->get();
$row = $this->market_sylive_activity_model->get(['activityId' => $this->a_id]);
if (!$row) {
throw new Hd_exception('参数错误', 400);
}
$this->data['title'] = '开工情况';
$this->data['params'] = $params;
//微信分享
$wx_info = $this->share_info($row);
$this->data['sign_package'] = $wx_info['sign_package'];
$this->data['share'] = $wx_info['share'];
$this->show_view('h5/market/sylive2/stic/work');
}
public function work_lists(){
$params = $this->input->get();
$where = [
'bizId' => $params['biz_id'],
'activityId' => $this->a_id,
'status' => 0,
];
$lists = [];
$total_user = $this->groups_user_model->select($where);
$user_ids = implode(',',array_column($total_user,'userId'));
$users = $this->market_sylive_user_model->map('userId','',["userId in ($user_ids)"=>null],'','','','userId,uname as name,headimg');
foreach ($users as $k => $v){
$work = $this->market_sylive_activity_kpidata_model->count(['activityId' => $this->a_id, 'cfUserId' => $k]);
$v[0]['work'] = $work ? '已开工' : '尚未开工';
$lists[] = $v[0];
}
$data = [
'total' => count($total_user),
'lists' => $lists
];
$this->show_json($data, 200);
}
public function gw_lists()
{
$params = $this->input->get();
@@ -0,0 +1,85 @@
<body class="bg-f6">
<div id="app" ref="app">
<div class="container relative bg-no-repeat bg-size-fullwidth bg-pos-top pt30 pb50">
<div id="main" class="relative bg-fff ml30 mr30 inner30 ulib-r20 box-shadow-darkGray" style="min-height:90vh;">
<div class="pt10 pb20 text-center"><b class="font-40 text-italic" v-html="title"></b></div>
<div class="pt30 pb20 fn-flex font-28 color-666" v-for="(item,index) in list">
<div class="fn-flex-item text-nowrap" flexsize="3">
<img class="imgsize-32X32 text-middle ulib-r750 bds-1-eee" :src="item.headimg" alt="#" />
<span class="text-middle">{{item.name}}</span>
</div>
<div class="fn-flex-item text-right" flexsize="5">{{item.work}}</div>
</div>
<mugen-scroll :handler="fetchData" :should-handle="!loading" scroll-container="app">
<div class="pt100 pb100 text-center color-ccc" v-if="isNoData"></i><span class="text-middle font-22">暂无数据</span></div>
<div class="pt20 pb20 text-center color-ccc" v-else-if="loading"><i class="iconfont icon-jiazai text-middle"></i><span class="text-middle font-22">请稍等...</span></div>
<div class="pt20 pb20 text-center font-22 color-ccc" v-else-if="isDataEnd&&list.length>10">我们是有底线的</div>
</mugen-scroll>
</div>
</div>
<?$this->load->view('h5/market/sylive2/nav');?>
</div>
<script>
let hostUrl = ''
var app = new Vue({
el: '#app',
data: {
loading: false,
isDataEnd: false,
isNoData: false,
page: 1, //页数
size: 20, //每页取多少个数据
title:'<?=$title?>',
list:[],
},
created(){
},
computed: {
},
mounted() {
},
beforeDestroy() {
},
//离开页面时
destroyed () {
},
methods: {
//判断导航是否需要吸顶
handleScroll () {
let scrollTop = document.querySelector('#app').scrollTop
let mainoffsetTop = document.querySelector('#main').offsetTop
},
//拉取数据
fetchData: function() {
this.getActivityList()
},
//获取大区列表
getActivityList(){
let that=this;
//请求接口
if (!that.isNoData && !that.isDataEnd && !that.loading) {
that.loading = true;
//请求接口
$.get('/h5/market/sylive2/stic/work_lists',{"biz_id": "<?=$params['biz_id']?>"},function (res){
that.loading = false;
that.list = that.list.concat(res.data.lists);
if (res.data.total == 0) {
that.isNoData = true;
} else if (that.list.length == res.data.total) {
that.isDataEnd = true;
}
},'json');
}
},
},
})
</script>
<?= $this->load->view('h5/market/sylive2/hidden_wx_share') ?>
</body>