request->isAjax) { foreach (UserBehaviorLogsEnum::OPERATOR_USER_TYPE_MAP as $value => $label) { $operatorUserTypeOptions[] = compact('label', 'value'); } foreach (UserBehaviorLogsEnum::BEHAVIOR_MAP as $value => $label) { $behaviorOptions[] = compact('label', 'value'); } $operatorUserTypeOptions = json_encode($operatorUserTypeOptions); $behaviorOptions = json_encode($behaviorOptions); return $this->render($this->action->id, compact('operatorUserTypeOptions', 'behaviorOptions')); } $service = new LogsServices(['mall_id' => $this->mall_id]); return $this->success('success', $service->getUserLogs($this->request->get())); } public function actionOrder() { if (!$this->request->isAjax) { foreach (OrderBehaviorLogsEnum::getMap(1) as $value => $label) { $operatorUserTypeOptions[] = compact('label', 'value'); } foreach (OrderBehaviorLogsEnum::getMap(0) as $value => $label) { $behaviorOptions[] = compact('label', 'value'); } $operatorUserTypeOptions = json_encode($operatorUserTypeOptions); $behaviorOptions = json_encode($behaviorOptions); return $this->render($this->action->id, compact('operatorUserTypeOptions', 'behaviorOptions')); } $service = new LogsServices(['mall_id' => $this->mall_id]); return $this->success('success', $service->getOrderLogs($this->request->get())); } }