diff --git a/common/libraries/market/Sylive_entity.php b/common/libraries/market/Sylive_entity.php index 8ede9e92..57b9246e 100644 --- a/common/libraries/market/Sylive_entity.php +++ b/common/libraries/market/Sylive_entity.php @@ -183,10 +183,10 @@ class Sylive_entity{ if($biz_ids){ $org_rows = $this->ci->market_sylive_organization_model->map('organizationId','organizationName',["organizationId in ($biz_ids)"],'','','','organizationId,organizationName'); } + $start = $page>1 ? ($page-1)*$size : 0; foreach ($rows as $key=>$val) { - $rank = $page>1 ? $key : ($page-1)*$size; $lists[] = [ - 'ranking' => $rank+1, + 'ranking' => $start+$key+1, 'name' => $org_rows[$val['bizId']] ? $org_rows[$val['bizId']] : '', 'num' => $val[$this->map_kpi_biz[$type]].'人', 'tip' => $biz_id==$val['bizId'] ? '本店' : '', diff --git a/home/controllers/h5/market/sylive/Biz.php b/home/controllers/h5/market/sylive/Biz.php index f40c8cd8..6f8d7d7f 100644 --- a/home/controllers/h5/market/sylive/Biz.php +++ b/home/controllers/h5/market/sylive/Biz.php @@ -166,7 +166,7 @@ class Biz extends Admin { $total = $this->market_sylive_organization_model->count($where); $lists = []; if($total){ - $rows = $this->market_sylive_organization_model->select($where,'sortNumber asc',$page,$size,'organizationId,parentId,organizationName'); + $rows = $this->market_sylive_organization_model->select($where,'sortNumber asc,organizationId desc',$page,$size,'organizationId,parentId,organizationName'); foreach ($rows as $val) { $where = [ 'status' => 0, @@ -205,16 +205,21 @@ class Biz extends Admin { $total = $this->market_sylive_organization_model->count($where); $lists = []; if($total){ - $rows = $this->market_sylive_organization_model->select($where,'sortNumber asc',$page,$size,'organizationId,parentId,organizationName'); + $rows = $this->market_sylive_organization_model->select($where,'sortNumber asc,organizationId desc',$page,$size,'organizationId,parentId,organizationName'); foreach ($rows as $val) { $where = [ 'status' => 0, "activityId in (select activityId from lc_market_sylive_activity_biz where bizId={$val['organizationId']})" => null ]; $activitynum = $this->market_sylive_activity_model->count($where); + $where = [ + 'status' => 0, + "organizationId in (select organizationId from lc_market_sylive_organization where parentId={$val['organizationId']})" => null + ]; + $storenum = $this->user_model->count($where);//顾问 $temp = [ 'title' => $val['organizationName'], - 'storenum' => $this->user_model->count(['organizationId'=>$val['organizationId'],'status'=>0]), //顾问 + 'storenum' => $storenum, 'activitynum' => $activitynum, 'url' => '/h5/market/sylive/biz?biz_id='.$val['organizationId'].'&area_id='.$area_id, 'state' => [], diff --git a/home/views/h5/market/sylive/act/index.php b/home/views/h5/market/sylive/act/index.php index 55373de7..ac2f0165 100644 --- a/home/views/h5/market/sylive/act/index.php +++ b/home/views/h5/market/sylive/act/index.php @@ -2,14 +2,14 @@
-
- # +