ItemClassController.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /**
  3. * User: admin
  4. * Date Time: 2021/1/13 23:04
  5. */
  6. namespace ghs\controllers;
  7. use bizGhs\item\classes\ItemClassClass;
  8. use bizGhs\item\services\ItemClassService;
  9. use common\components\util;
  10. use Yii;
  11. class ItemClassController extends BaseController
  12. {
  13. public function actionList()
  14. {
  15. $where = ['ghsId' => $this->ghsId];
  16. $list = ItemClassClass::getGhsItemClassList($where);
  17. util::success($list);
  18. }
  19. public function actionAdd()
  20. {
  21. $post = Yii::$app->request->post();
  22. $post['adminId'] = $this->adminId;
  23. $res = ItemClassClass::addGhsItemClass($this->ghsId,$post);
  24. util::complete('添加成功');
  25. }
  26. public function actionUpdate()
  27. {
  28. $data = Yii::$app->request->post();
  29. $data['adminId'] = $this->adminId;
  30. $data['ghsId'] = $this->ghsId;
  31. ItemClassClass::updateGhsItemClass($data);
  32. util::complete('修改成功');
  33. }
  34. public function actionDelete()
  35. {
  36. $id = Yii::$app->request->get('id',0);
  37. ItemClassService::deleteGhsItemClass($id);
  38. util::complete('操作成功');
  39. }
  40. }