fix(restore): 完善审核恢复脚本中模板2的deletetime清理与Tabbar校验
这个提交包含在:
@@ -80,10 +80,23 @@ class RestoreAfterAudit
|
||||
echo "[2] 已隐藏 3C 临时分类: {$c3CatUpdated} 个\n";
|
||||
|
||||
// 3. 恢复原本的白酒、驼奶粉、护肤品等业务商品全部正常上架
|
||||
$bizGoodsIds = [33, 34, 35, 36, 37];
|
||||
$bizGoodsUpdated = Db::name('shopro_goods')
|
||||
->whereIn('id', $bizGoodsIds)
|
||||
->update(['status' => 'up', 'deletetime' => null, 'updatetime' => $now]);
|
||||
$bizGoodsIds = [32, 33, 34, 35, 36, 37];
|
||||
$bizGoodsList = Db::name('shopro_goods')->whereIn('id', $bizGoodsIds)->select();
|
||||
$bizGoodsUpdated = 0;
|
||||
foreach ($bizGoodsList as $bg) {
|
||||
$cIds = explode(',', (string)$bg['category_ids']);
|
||||
if (!in_array('172', $cIds)) {
|
||||
array_unshift($cIds, '172');
|
||||
}
|
||||
$newCIds = implode(',', array_unique(array_filter($cIds)));
|
||||
Db::name('shopro_goods')->where('id', $bg['id'])->update([
|
||||
'category_ids' => $newCIds,
|
||||
'status' => 'up',
|
||||
'deletetime' => null,
|
||||
'updatetime' => $now
|
||||
]);
|
||||
$bizGoodsUpdated++;
|
||||
}
|
||||
echo "[3] 已成功恢复原有核心业务商品正常上架 (莫高飞天、飞天盛世、驼奶粉等): {$bizGoodsUpdated} 款\n";
|
||||
|
||||
// 4. 恢复原本业务分类权重 (恒链好物、好物品鉴等)
|
||||
@@ -94,8 +107,25 @@ class RestoreAfterAudit
|
||||
|
||||
// 5. 切换生效模板为正式旗舰商城模板 (模板 2: 恒链数通 · 旗舰臻选)
|
||||
Db::name('shopro_decorate')->where('id', 5)->update(['status' => 'disabled', 'updatetime' => $now]);
|
||||
Db::name('shopro_decorate')->where('id', 2)->update(['status' => 'enable', 'updatetime' => $now]);
|
||||
echo "[5] 已将启用模板从 [3C数码] 一键切换为正式模板 [恒链数通 · 旗舰臻选]\n";
|
||||
Db::name('shopro_decorate')->where('id', 2)->update(['status' => 'enable', 'deletetime' => null, 'updatetime' => $now]);
|
||||
|
||||
// 确保模板 2 的 basic 页面 Tabbar 分类链接正确指向当前顶级分类 172
|
||||
$t2Basic = Db::name('shopro_decorate_page')->where('decorate_id', 2)->where('type', 'basic')->find();
|
||||
if ($t2Basic) {
|
||||
$t2Config = json_decode($t2Basic['page'], true);
|
||||
if (isset($t2Config['tabbar']['list']) && is_array($t2Config['tabbar']['list'])) {
|
||||
foreach ($t2Config['tabbar']['list'] as &$tab) {
|
||||
if (isset($tab['text']) && $tab['text'] === '分类') {
|
||||
$tab['url'] = "/pages/index/category?id=172";
|
||||
}
|
||||
}
|
||||
unset($tab);
|
||||
Db::name('shopro_decorate_page')->where('id', $t2Basic['id'])->update([
|
||||
'page' => json_encode($t2Config, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE)
|
||||
]);
|
||||
}
|
||||
}
|
||||
echo "[5] 已将启用模板从 [3C数码] 一键切换为正式模板 [恒链数通 · 旗舰臻选],并校验Tabbar链接正常\n";
|
||||
|
||||
Db::commit();
|
||||
echo "\n====================================================\n";
|
||||
|
||||
在新工单中引用
屏蔽一个用户