request->get('classId',0); $where['sjId'] = $this->sjId; $where['classId'] = $classId; $list = ItemClass::getItemList($where); util::success($list); } public function actionAdd() { $post = Yii::$app->request->post(); $post['adminId'] = $this->adminId; $post['shopId'] = $this->shopId; $post['sjId'] = $this->sjId; ItemService::addItem($post); util::complete('添加成功'); } public function actionUpdate() { $data = Yii::$app->request->post(); $data['adminId'] = $this->adminId; $data['sjId'] = $this->sjId; ItemService::updateItem($data); util::complete('修改成功'); } //排序 public function actionChangeSort() { //[id=>sort] $data = Yii::$app->request->post(); if(empty($data)){ util::fail('参数错误'); } //循环修改排序值 // todo } public function actionDelete() { $get = Yii::$app->request->get(); $id = isset($get['id']) ? $get['id'] : 0; ItemService::deleteItem($id,$this->shopId,$this->adminId); util::complete('操作成功'); } //获取平台里的花材信息 public function actionPlatformItem() { $py = Yii::$app->request->get('py',''); $where = []; if($py){ $py = strtolower($py); $where = ['py' => $py]; } $list = xhItemService::getItemList('*',$where,'id desc'); util::success($list); } }