edit-sylive-event_text
This commit is contained in:
@@ -274,7 +274,7 @@ class Stic extends Admin{
|
||||
$total = $this->mdSytActivityKpiData->count($where);
|
||||
$lists = [];
|
||||
if($total){
|
||||
$rows = $this->mdSytActivityKpiData->select($where,'id desc',$page,10,'userId,kpi,createTime');
|
||||
$rows = $this->mdSytActivityKpiData->select($where,'id desc',$page,10,'userId,kpi,createTime,itemId');
|
||||
$users = [];
|
||||
$uids = implode(',',array_unique(array_column($rows,'userId')));
|
||||
if($uids){
|
||||
@@ -283,11 +283,25 @@ class Stic extends Admin{
|
||||
];
|
||||
$users = $this->user_model->map('userId','nickname',$where,'','','','userId,nickname');
|
||||
}
|
||||
$item_rows = [];
|
||||
$itemIds = implode(',',array_unique(array_column($rows,'itemId')));
|
||||
if($itemIds){
|
||||
$where = [
|
||||
"itemId in ($itemIds)" => null,
|
||||
];
|
||||
$item_rows = $this->market_sylive_items_model->map('itemId','',$where,'','','','itemId,title,price');
|
||||
}
|
||||
foreach ($rows as $key => $val) {
|
||||
$nickname = $users[$val['userId']] ? $users[$val['userId']] : "用户{$val['userId']}";
|
||||
$action = $map_kpi_name[$val['kpi']];
|
||||
if($val['kpi']=='beforeOrder' || $val['kpi']=='order'){
|
||||
$item_row = $item_rows[$val['itemId']] ? $item_rows[$val['itemId']][0] : '';
|
||||
$action = $item_row['price']>0 ? '下单 ' : '领取 ';
|
||||
$action .= $item_row['title'];
|
||||
}
|
||||
$lists[] = [
|
||||
'nickname' => $nickname,
|
||||
'action' => $map_kpi_name[$val['kpi']],
|
||||
'action' => $action,
|
||||
'time' => friendly_date($val['createTime']),
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user