From 817cf2a9999db456175fa6277b90b2154059096f Mon Sep 17 00:00:00 2001 From: dengbw Date: Fri, 24 Mar 2023 15:56:55 +0800 Subject: [PATCH] market_324_2 --- market/controllers/api/sylive/GroupsOrder.php | 24 ++++++++++++------- .../api/sylive/GroupsStatistics.php | 3 ++- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/market/controllers/api/sylive/GroupsOrder.php b/market/controllers/api/sylive/GroupsOrder.php index 0fe3b368..89016bda 100644 --- a/market/controllers/api/sylive/GroupsOrder.php +++ b/market/controllers/api/sylive/GroupsOrder.php @@ -17,9 +17,7 @@ class groupsOrder extends BaseController $this->load->model('market/Market_sylive_user_model', 'mdSyliveUser'); $this->load->model('market/Market_sylive_activity_kpidata_model', 'mdSyliveActivityKpidata'); $this->load->model('market/Market_sylive_groups_model', 'mdSyliveGroups'); - - $this->load->model('market/Market_sylive_organization_model', 'mdSyliveOrganization'); - $this->load->model('market/Market_sylive_team_model', 'mdSyliveTeam'); + $this->load->model('market/Market_sylive_user_model', 'mdSyliveUser'); } /** @@ -59,6 +57,7 @@ class groupsOrder extends BaseController $order = $params['order']; $bizId = $params['bizId']; $itemId = $params['itemId']; + $insiders = intval($params['insiders']);//内部人员 !$page && $page = 1; !$limit && $limit = 10; $levels = []; @@ -99,6 +98,11 @@ class groupsOrder extends BaseController $uname && $where['uname LIKE "%' . trim($uname) . '%"'] = null; $mobile && $where['mobile LIKE "%' . trim($mobile) . '%"'] = null; strlen($type) && $where['type'] = $type; + if ($insiders == 1) { + $where["userId in(select userId from lc_market_sylive_user where organizationId>0)"] = null; + } else if ($insiders == 2) { + $where["userId not in(select userId from lc_market_sylive_user where organizationId>0)"] = null; + } if ($bizId) { $res_org = $this->mdSyliveGroups->get(["groupsId" => $bizId]); if ($res_org) { @@ -117,15 +121,18 @@ class groupsOrder extends BaseController } if ($count) { $res = $this->mdSyliveOrder->select($where, $sort_order, $page, $limit); + $userIds = implode(',', array_column($res, 'userId')); + $map_user = $this->mdSyliveUser->map('userId', 'organizationId', ["userId in({$userIds})" => null]); foreach ($res as $v) { $consultant = $this->consultantGet(['activityId' => $v['activityId'], 'userId' => $v['userId'] , 'levelId1' => $v['levelId1'], 'levelId2' => $v['levelId2'], 'levelId3' => $v['levelId3'] , 'bizId' => $v['bizId'], 'cfUserId' => $v['cfUserId']]); + $insiders = $map_user[$v['userId']]? '是' : '否';//内部人员 $list1 = [ 'id' => $v['id'], 'sid' => $v['sid'], 'uname' => $v['uname'], 'mobile' => $v['mobile'], 'itemTitle' => $v['itemTitle'] , 'totalPrice' => $v['totalPrice'], 'payTime' => $v['payTime'] != '0000-00-00 00:00:00' ? $v['payTime'] : '' , 'createTime' => $v['createTime'], 'typeName' => $this->mdSyliveOrder->typeAry($v['type']) - , 'statusName' => $this->mdSyliveOrder->statusAry($v['status']), 'consultant' => $consultant['consultant'] + , 'statusName' => $this->mdSyliveOrder->statusAry($v['status']), 'insiders' => $insiders, 'consultant' => $consultant['consultant'] ]; if ($limit == 10000) { unset($list1['id']); @@ -154,7 +161,7 @@ class groupsOrder extends BaseController } } if ($limit == 10000) { - $columns1 = ['订单号', '姓名', '手机号', '商品标题', '订单价格', '付款时间', '创建时间', '订单类型', '状态', '顾问']; + $columns1 = ['订单号', '姓名', '手机号', '商品标题', '订单价格', '付款时间', '创建时间', '订单类型', '状态', '内部人员', '顾问']; $columns2 = []; foreach ($levels as $k => $v) { $columns2[] = $v['label']; @@ -173,9 +180,10 @@ class groupsOrder extends BaseController ['prop' => 'totalPrice', 'label' => '订单价格', 'showOverflowTooltip' => true, 'minWidth' => 70, 'sortable' => 'custom'], ['prop' => 'payTime', 'label' => '付款时间', 'showOverflowTooltip' => true, 'minWidth' => 100, 'sortable' => 'custom'], ['prop' => 'createTime', 'label' => '创建时间', 'showOverflowTooltip' => true, 'minWidth' => 100, 'sortable' => 'custom'], - ['prop' => 'typeName', 'label' => '订单类型', 'showOverflowTooltip' => true, 'minWidth' => 70], - ['prop' => 'statusName', 'label' => '状态', 'showOverflowTooltip' => true, 'minWidth' => 70], - ['prop' => 'consultant', 'label' => '顾问', 'showOverflowTooltip' => true, 'minWidth' => 60] + ['prop' => 'typeName', 'label' => '订单类型', 'showOverflowTooltip' => true, 'minWidth' => 60], + ['prop' => 'statusName', 'label' => '状态', 'showOverflowTooltip' => true, 'minWidth' => 60], + ['prop' => 'insiders', 'label' => '内部人员', 'showOverflowTooltip' => true, 'minWidth' => 60], + ['prop' => 'consultant', 'label' => '顾问', 'showOverflowTooltip' => true, 'minWidth' => 55] ]; $columns2 = []; foreach ($levels as $k => $v) { diff --git a/market/controllers/api/sylive/GroupsStatistics.php b/market/controllers/api/sylive/GroupsStatistics.php index abde1e50..6eb3012d 100644 --- a/market/controllers/api/sylive/GroupsStatistics.php +++ b/market/controllers/api/sylive/GroupsStatistics.php @@ -1012,7 +1012,8 @@ class GroupsStatistics extends BaseController $userId = intval($v['userId']); $cfUserId = intval($v['cfUserId']); $insiders = '否';//内部人员 - $createTime = $browseTime = $subscribeTime = $liveTime = $playDuration = $livePV = ''; + $createTime = $browseTime = $subscribeTime = $liveTime = ''; + $playDuration = $livePV = 0; $nickname = $consultantName = $bizName = '-'; $map_groups[$v['bizId']] && $bizName = $map_groups[$v['bizId']]; $map_user[$cfUserId] && $consultantName = $map_user[$cfUserId]['uname'];