diff --git a/common/libraries/market/Sylive_data_entity.php b/common/libraries/market/Sylive_data_entity.php index eab88180..165b0f84 100644 --- a/common/libraries/market/Sylive_data_entity.php +++ b/common/libraries/market/Sylive_data_entity.php @@ -404,7 +404,7 @@ class Sylive_data_entity{ if($groupby=='cfUserId'){//顾问 $user_ids = implode(',',array_column($rows,'cfUserId')); if($user_ids){ - $org_rows = $this->ci->user_model->map('userId','',["userId in ($user_ids)"=>null],'','','','userId,uname as name'); + $org_rows = $this->ci->user_model->map('userId','',["userId in ($user_ids)"=>null],'','','','userId,uname as name,headimg'); } $biz_ids = implode(',',array_column($rows,'teamId2')); $biz_rows = []; @@ -420,12 +420,13 @@ class Sylive_data_entity{ $num_tip = $where['kpi'] == 'order' ? '单' : '人'; $start = $page>1 ? ($page-1)*$page_size : 0; foreach ($rows as $key=>$val) { - $biz_name = ''; + $headimg = $biz_name = ''; if($groupby=='cfUserId'){ $org = $org_rows[$val['cfUserId']] ? $org_rows[$val['cfUserId']][0] : []; $tip = $teamId==$val['cfUserId'] ? '本人' : ''; $biz = $biz_rows[$val['teamId2']] ? $biz_rows[$val['teamId2']][0] : []; $biz_name = $biz['organizationName'] ? "({$biz['organizationName']})" : ''; + $headimg = $org['headimg']; }else{ $org = $org_rows[$val['teamId2']] ? $org_rows[$val['teamId2']][0] : []; $tip = $teamId==$val['teamId2'] ? '我的团队' : ''; @@ -434,6 +435,7 @@ class Sylive_data_entity{ 'ranking' => $start+$key+1, 'name' => $org['name'].$biz_name, 'num' => $val['t'].$num_tip, + 'headimg' => $headimg, 'tip' => $tip, ]; } diff --git a/home/controllers/h5/market/sylive/Item.php b/home/controllers/h5/market/sylive/Item.php index 9d0add31..d7b7f840 100644 --- a/home/controllers/h5/market/sylive/Item.php +++ b/home/controllers/h5/market/sylive/Item.php @@ -245,9 +245,9 @@ class Item extends Wx{ $this->show_json('',400,'请输入正确的手机号码'); } //验证是否黑名单用户 - if(!$this->ck_mobile($mobile)){ - $this->show_json('',400,'本次活动仅限受邀客户参加'); - } +// if(!$this->ck_mobile($mobile)){ +// $this->show_json('',400,'本次活动仅限受邀客户参加'); +// } $redis = &load_cache('redis'); $key = "sylive_item_code_{$this->uid}_{$mobile}"; $code = $redis->get($key); diff --git a/home/controllers/h5/market/sylive/Stic.php b/home/controllers/h5/market/sylive/Stic.php index ac902cb7..987bde38 100644 --- a/home/controllers/h5/market/sylive/Stic.php +++ b/home/controllers/h5/market/sylive/Stic.php @@ -713,11 +713,26 @@ class Stic extends Admin{ $params = $this->input->get(); $page = $params['page'] ? $params['page'] : 1; $size = $params['size'] ? $params['size'] : 20; +// if($params['type']=='biz'&&$params['type_id']){ +// $biz_id = $params['type_id']; +// $o_where = ['bizId'=>$biz_id]; +// } +// $res = $this->sylive_data_entity->top_gw_lists($params['a_id'],$params['kpi'],$o_where,$page,$size,$this->uid); + $where = [ + 'activityId' => $params['a_id'], + 'type' => 0, + 'kpi' => $params['kpi'] + ]; if($params['type']=='biz'&&$params['type_id']){ $biz_id = $params['type_id']; - $o_where = ['bizId'=>$biz_id]; + $where['bizId'] = $biz_id; } - $res = $this->sylive_data_entity->top_gw_lists($params['a_id'],$params['kpi'],$o_where,$page,$size,$this->uid); + $params['itemId'] && $where['itemId'] = $params['itemId']; + $groupby = 'cfUserId'; + $teamId = $this->uid; + $select = 'bizId as teamId2,cfUserId,count(id) as t'; + $order = 't desc,id desc'; + $res = $this->sylive_data_entity->top_kpidata($groupby,$where,$order,$page,$size,$select,$teamId); $lists = []; if($res['lists']){ foreach ($res['lists'] as $item) {