|
|
@@ -16,7 +16,7 @@ use biz\goods\services\GoodsService;
|
|
|
|
|
|
class GoodsController extends BaseController
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
//商品列表 shish 2019.12.7
|
|
|
public function actionList()
|
|
|
{
|
|
|
@@ -62,7 +62,8 @@ class GoodsController extends BaseController
|
|
|
$data = Yii::$app->request->post();
|
|
|
$id = isset($data['id']) ? $data['id'] : 0;
|
|
|
unset($data['id']);
|
|
|
- GoodsService::valid($id, $this->merchantId);
|
|
|
+ $info = GoodsService::getById($id);
|
|
|
+ GoodsService::valid($info, $this->merchantId);
|
|
|
$data['merchantId'] = $this->merchantId;
|
|
|
GoodsService::updateGoods($id, $data);
|
|
|
util::ok();
|
|
|
@@ -73,7 +74,8 @@ class GoodsController extends BaseController
|
|
|
{
|
|
|
$id = Yii::$app->request->get('id', 0);
|
|
|
$inTurn = Yii::$app->request->get('inTurn', 0);
|
|
|
- GoodsService::valid($id, $this->merchantId);
|
|
|
+ $info = GoodsService::getById($id);
|
|
|
+ GoodsService::valid($info, $this->merchantId);
|
|
|
GoodsService::updateById($id, ['inTurn' => $inTurn]);
|
|
|
util::ok('操作成功');
|
|
|
}
|
|
|
@@ -92,7 +94,8 @@ class GoodsController extends BaseController
|
|
|
$get = Yii::$app->request->get();
|
|
|
$id = isset($get['id']) ? $get['id'] : 0;
|
|
|
$status = isset($get['status']) ? $get['status'] : 1;
|
|
|
- GoodsService::valid($id, $this->merchantId);
|
|
|
+ $info = GoodsService::getById($id);
|
|
|
+ GoodsService::valid($info, $this->merchantId);
|
|
|
GoodsService::changeStatus($id, $status);
|
|
|
util::ok();
|
|
|
}
|