market_statistics_1104_3

This commit is contained in:
dengbw
2022-11-04 16:56:05 +08:00
parent 260bb7d36f
commit f901ce5dbd
+3 -3
View File
@@ -629,6 +629,7 @@ class Statistics extends BaseController
$type = intval($this->input_param('type'));
$kpi = $this->input_param('kpi');
$area = $biz = $consultant = [];
$kpi == 'order' && $kpi = 'orderTotal';
if ($type == 1) {
} else {
@@ -638,8 +639,8 @@ class Statistics extends BaseController
$areaId = intval($v['areaId']);
$re = $this->mdSyliveOrganization->get(['organizationId' => $areaId]);
$name = $re['organizationName'] ? $re['organizationName'] : '-';
$value = $this->mdSyliveActivityKpidata->count(['activityId' => $activityId, 'areaId' => $areaId, 'type' => $type, 'kpi' => $kpi]);
$area[] = ['name' => $name, 'value' => $value, 'percent' => 0];
$value = $this->mdSyliveActivityBiz->sum($kpi, ['areaId' => $areaId, 'activityId' => $activityId]);
$area[] = ['name' => $name, 'value' => $value[$kpi], 'percent' => 0];
}
if ($res) {
$edit = array_column($area, 'value');
@@ -651,7 +652,6 @@ class Statistics extends BaseController
}
}
//门店排名
$kpi == 'order' && $kpi = 'orderTotal';
$res = $this->mdSyliveActivityBiz->select(['activityId' => $activityId, 'status>=' => 0]
, "{$kpi} desc,id desc", 1, 10, "{$kpi},bizId");
if ($res) {