enterpriseId = $enterpriseId; $this->objDOrderLog = new DOrderLog('log'); $this->objDOrderLog->setTable($this->objDOrderLog->get_Table() . '_' . date('Y') . '_' . ceil(date('m') / 3)); } /** * @param $selectParams * @return array * @throws \Exception */ public function getOrderLog($selectParams) { $dbResult = $this->objDOrderLog->select($selectParams, '*', 'createTime DESC'); if ($dbResult === false) { return []; } $map = []; $allUserCenterIds = array_column($dbResult,'userCenterId'); if (!empty($allUserCenterIds)){ $objDCustomer = new DCustomer(); $objDCustomer->setTable('qianniao_customer_'.$this->enterpriseId); $list = $objDCustomer->select(['userCenterId' => $allUserCenterIds],'userCenterId,name'); if ($list !== false){ foreach ($list as $value){ $map[$value['userCenterId']] = $value['name']; } } } $allOrderLog = []; foreach ($dbResult as $key => &$val) { $val['userName'] = isset($map[$val['userCenterId']]) ? $map[$val['userCenterId']] : ''; $allOrderLog[$val['no']][] = $val; } return $allOrderLog; } }