WarehouseController.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. /**
  3. * 重庆赤晓店信息科技有限公司
  4. * https://www.chixiaodian.com
  5. * Copyright (c) 2023 赤店商城 All rights reserved.
  6. */
  7. namespace app\modules\admin\controllers\erp;
  8. use app\modules\admin\controllers\BaseController;
  9. use app\modules\admin\models\erp\WarehouseForm;
  10. class WarehouseController extends BaseController
  11. {
  12. /**
  13. * @return \yii\web\Response
  14. * 获取列表
  15. */
  16. public function actionList()
  17. {
  18. $form = new WarehouseForm();
  19. $form->store_id = get_store_id();
  20. $form->attributes = all_params();
  21. $res = $form->search();
  22. return $this->asJson($res);
  23. }
  24. public function actionSelectList()
  25. {
  26. $form = new WarehouseForm();
  27. $form->store_id = get_store_id();
  28. $form->attributes = all_params();
  29. $res = $form->selectList();
  30. return $this->asJson($res);
  31. }
  32. /**
  33. * @return \yii\web\Response
  34. * 保存信息
  35. */
  36. public function actionSave()
  37. {
  38. $form = new WarehouseForm();
  39. $form->store_id = get_store_id();
  40. $form->attributes = all_params();
  41. $res = $form->save();
  42. return $this->asJson($res);
  43. }
  44. /**
  45. * @return \yii\web\Response
  46. * 修改状态
  47. */
  48. public function actionDel()
  49. {
  50. $form = new WarehouseForm();
  51. $form->store_id = get_store_id();
  52. $form->attributes = all_params();
  53. $res = $form->del();
  54. return $this->asJson($res);
  55. }
  56. }