diff --git a/admin/controllers/hdcloud/Clues.php b/admin/controllers/hdcloud/Clues.php index eafcab8c..36563638 100644 --- a/admin/controllers/hdcloud/Clues.php +++ b/admin/controllers/hdcloud/Clues.php @@ -79,8 +79,8 @@ class Clues extends HD_Controller ), '101204' => array( 'biz' => '东莞金屹', - 'sa' => '姚宗亮', - 'mobile' => '13612751915' + 'sa' => '林耿文', + 'mobile' => '17688624688' ), '101043' => array( 'biz' => '惠州华致', diff --git a/api/controllers/wxapp/neta/Act.php b/api/controllers/wxapp/neta/Act.php index 6c158c54..8f913a8a 100644 --- a/api/controllers/wxapp/neta/Act.php +++ b/api/controllers/wxapp/neta/Act.php @@ -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); diff --git a/home/controllers/Welcome.php b/home/controllers/Welcome.php index 203aa5f3..07e3bb62 100644 --- a/home/controllers/Welcome.php +++ b/home/controllers/Welcome.php @@ -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)); diff --git a/home/controllers/h5/market/sylive2/Act.php b/home/controllers/h5/market/sylive2/Act.php index 087336b2..9c65157c 100644 --- a/home/controllers/h5/market/sylive2/Act.php +++ b/home/controllers/h5/market/sylive2/Act.php @@ -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' => "好店云", diff --git a/home/controllers/h5/market/sylive2/Stic.php b/home/controllers/h5/market/sylive2/Stic.php index 4fc19276..fa44d7d7 100644 --- a/home/controllers/h5/market/sylive2/Stic.php +++ b/home/controllers/h5/market/sylive2/Stic.php @@ -1,4 +1,6 @@ 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(); diff --git a/home/views/h5/market/sylive2/stic/work.php b/home/views/h5/market/sylive2/stic/work.php new file mode 100644 index 00000000..241a419c --- /dev/null +++ b/home/views/h5/market/sylive2/stic/work.php @@ -0,0 +1,85 @@ +
+