request; if ($request->isGet) { $params = $request->get(); $params['method'] = 'get'; $params['platform'] = $this->platform; $params['mall_id'] = $this->mall_id; $params['user_id'] = $this->user_id; $result = GlobalInvoke::exec(GlobalInvoke::INVOKE_CLERK, $this->mall_id, $params); if (empty($result)) return $this->error('获取数据失败'); return $this->success('操作成功', $result); } if ($request->isPost) { $params = $request->post(); $params['method'] = 'post'; $params['platform'] = $this->platform; $params['mall_id'] = $this->mall_id; $params['user_id'] = $this->user_id; $result = GlobalInvoke::exec(GlobalInvoke::INVOKE_CLERK, $this->mall_id, $params); if (empty($result)) return $this->error('核销失败'); return $this->success('操作成功', $result); } } catch (\Exception $e) { return $this->error($e->getMessage()); } } public function actionClerkLog() { $params = \Yii::$app->request->get(); $where[] = ['mall_id' => $this->mall_id]; $where[] = ['user_id' => $this->user_id]; $where[] = ['status' => [StatusEnum::ENABLED, StatusEnum::DISABLED]]; $params['where'] = $where; $params['order'] = 'id DESC'; $params['select'] = 'id,mall_id,user_id,name,pic,mall_logo,mall_name,clerk_code,type,extra,created_at'; $pageData = ClerkLog::getPageLists($params); return $this->success('操作成功', $pageData); } public function actionClerkLogDetail() { try { $params = \Yii::$app->request->get(); $res = \Yii::$app->services->validate->validate($params, [ [['clerk_log_id', 'type'], 'required'], ]); if ($res === false) return $this->error(\Yii::$app->services->validate->getErrorMessage()); $params['platform'] = $this->platform; $params['mall_id'] = $this->mall_id; $params['user_id'] = $this->user_id; $result = GlobalInvoke::exec(GlobalInvoke::INVOKE_CLERK_DETAIL, $this->mall_id, $params); if (empty($result)) return $this->error('获取数据失败'); return $this->success('操作成功', $result); } catch (\Exception $e) { return $this->error($e->getMessage()); } } }