|
|
@@ -4,11 +4,11 @@ namespace hd\controllers;
|
|
|
|
|
|
use biz\shop\classes\ShopExtClass;
|
|
|
use bizGhs\order\classes\OrderItemClass;
|
|
|
+use bizHd\goods\classes\GoodsCategoryClass;
|
|
|
use bizHd\goods\classes\GoodsClass;
|
|
|
use bizHd\goods\services\CategoryService;
|
|
|
use bizHd\goods\services\GoodsCategoryService;
|
|
|
use bizHd\goods\services\GoodsSettingService;
|
|
|
-use bizHd\saas\services\FestRiseService;
|
|
|
use common\components\printUtil;
|
|
|
use Yii;
|
|
|
use common\components\util;
|
|
|
@@ -213,6 +213,7 @@ class GoodsController extends BaseController
|
|
|
{
|
|
|
$post = Yii::$app->request->post();
|
|
|
$items = $post['items'];
|
|
|
+ $cId = intval($post['cId']);
|
|
|
|
|
|
//验证商品
|
|
|
// 提取所有商品ID
|
|
|
@@ -222,17 +223,18 @@ class GoodsController extends BaseController
|
|
|
|
|
|
// 批量获取商品信息
|
|
|
$goodsInfos = GoodsClass::getByIds($categoryIds);
|
|
|
-
|
|
|
// 批量验证商品
|
|
|
foreach($goodsInfos as $info) {
|
|
|
GoodsService::valid($info, $this->mainId);
|
|
|
}
|
|
|
|
|
|
+ $category = CategoryService::getById($cId);
|
|
|
+ CategoryService::valid($category, $this->mainId);
|
|
|
// 更新商品排序
|
|
|
foreach($items as $item) {
|
|
|
$id = intval($item['id']);
|
|
|
$inTurn = intval($item['inTurn']);
|
|
|
- GoodsClass::updateById($id, ['inTurn' => $inTurn]);
|
|
|
+ GoodsCategoryClass::updateByCondition(['cId' => $cId, 'gId' => $id], ['inTurn' => $inTurn]);
|
|
|
}
|
|
|
|
|
|
util::complete('排序完成');
|