market_324_2

This commit is contained in:
dengbw
2023-03-24 15:56:55 +08:00
parent 1512ffdf99
commit 817cf2a999
2 changed files with 18 additions and 9 deletions
+16 -8
View File
@@ -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) {
@@ -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'];