|
|
@@ -2,8 +2,10 @@
|
|
|
|
|
|
namespace console\controllers;
|
|
|
|
|
|
+use bizHd\goods\classes\GoodsCategoryClass;
|
|
|
use bizHd\goods\classes\GoodsClass;
|
|
|
use bizHd\goods\classes\KindClass;
|
|
|
+use bizHd\order\classes\OrderGoodsClass;
|
|
|
use bizHd\shop\classes\ShopClass;
|
|
|
use bizHd\work\classes\WorkClass;
|
|
|
use yii\console\Controller;
|
|
|
@@ -41,12 +43,15 @@ class KindController extends Controller
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ print_r($kindList);
|
|
|
if (empty($lzKindId) || empty($hsKindId)) {
|
|
|
echo '有品类id没有 ' . $shop->merchantName . ' ' . $shop->shopName;
|
|
|
Yii::$app->end();
|
|
|
}
|
|
|
GoodsClass::updateByCondition(['mainId' => $mainId, 'flower' => 1], ['kindId' => $hsKindId, 'kindName' => $hsName]);
|
|
|
+ GoodsCategoryClass::updateByCondition(['mainId' => $mainId, 'flower' => 1], ['kindId' => $hsKindId, 'kindName' => $hsName]);
|
|
|
GoodsClass::updateByCondition(['mainId' => $mainId, 'flower' => 0], ['kindId' => $lzKindId, 'kindName' => $lzName]);
|
|
|
+ GoodsCategoryClass::updateByCondition(['mainId' => $mainId, 'flower' => 0], ['kindId' => $lzKindId, 'kindName' => $lzName]);
|
|
|
|
|
|
$workList = WorkClass::getAllByCondition(['mainId' => $mainId], null, '*', null, true);
|
|
|
if (!empty($workList)) {
|
|
|
@@ -62,6 +67,22 @@ class KindController extends Controller
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ $arr = OrderGoodsClass::getAllByCondition(['id>' => 0], null, '*', null, true);
|
|
|
+ if (!empty($arr)) {
|
|
|
+ foreach ($arr as $in) {
|
|
|
+ $goodsId = $in->goodsId ?? 0;
|
|
|
+ $goodsInfo = GoodsClass::getById($goodsId, true);
|
|
|
+ if (!empty($goodsInfo)) {
|
|
|
+ $thisKindId = $goodsInfo->kindId ?? 0;
|
|
|
+ $thisKindName = $goodsInfo->kindName ?? '';
|
|
|
+ $in->kindId = $thisKindId;
|
|
|
+ $in->kindName = $thisKindName;
|
|
|
+ $in->save();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|