| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- <?php
- /**
- * 重庆赤晓店信息科技有限公司
- * https://www.chixiaodian.com
- * Copyright (c) 2023 赤店商城 All rights reserved.
- */
- namespace app\modules\admin\controllers\erp;
- use app\models\Goods;
- use app\models\Option;
- use app\constants\OptionSetting;
- use app\modules\admin\models\erp\InventoryForm;
- use app\modules\admin\models\erp\ERP;
- class InventoryController extends BaseController
- {
- public function actionTest()
- {
- $id = '22528';
- $res = InventoryForm::initStoreGoods(84);
- // $res = InventoryForm::initGoods(84, $id);
- return $this->asJson($res);
- }
- public function actionInitStoreGoods()
- {
- $res = InventoryForm::initStoreGoods(get_store_id());
- return $this->asJson($res);
- }
- public function actionInitGoods()
- {
- $res = InventoryForm::initGoods(get_store_id(), input_params('id'));
- return $this->asJson($res);
- }
- /**
- * @return \yii\web\Response
- * 获取列表
- */
- public function actionList()
- {
- $form = new InventoryForm();
- $form->store_id = get_store_id();
- $form->attributes = all_params();
- $res = $form->search(1, all_params());
- return $this->asJson($res);
- }
-
- public function actionWarningList()
- {
- $form = new InventoryForm();
- $form->store_id = get_store_id();
- $form->attributes = all_params();
- $res = $form->warningList(all_params());
- return $this->asJson($res);
- }
- /**
- * @return \yii\web\Response
- * 保存信息
- */
- public function actionSaveSupplier()
- {
- $form = new InventoryForm();
- $form->store_id = get_store_id();
- $form->attributes = all_params();
- $res = $form->saveSupplier();
- return $this->asJson($res);
- }
- public function actionSaveWarningNum()
- {
- $res = ERP::saveWarningNum(get_store_id(), input_params('warning_num', 0));
- return $this->asJson($res);
- }
- public function actionGetWarningNum()
- {
- $res = ERP::getWarningNum(get_store_id());
- return $this->asJson([
- 'code' => 0,
- 'data' => $res,
- ]);
- }
- public function actionSaveKey()
- {
- $form = new InventoryForm();
- $form->store_id = get_store_id();
- $form->attributes = all_params();
- $res = $form->saveKey();
- return $this->asJson($res);
- }
- /**
- * @return \yii\web\Response
- * 修改状态
- */
- public function actionDel()
- {
- $form = new InventoryForm();
- $form->store_id = get_store_id();
- $form->attributes = all_params();
- $res = $form->del(all_params());
- return $this->asJson($res);
- }
-
-
-
-
-
-
-
-
-
-
-
-
- public function actionLogList()
- {
- $form = new InventoryForm();
- $form->store_id = get_store_id();
- $form->attributes = all_params();
- $res = $form->logList();
- return $this->asJson($res);
- }
- }
|