修改关联商品无法修改的bug

This commit is contained in:
liqianjin 2025-03-31 15:41:18 +08:00
parent 4425982fb1
commit 51f35c309f
3 changed files with 16 additions and 1 deletions

View File

@ -278,6 +278,9 @@ class Goods extends BaseModel
'barrage_show' => $data['barrage_show'], 'barrage_show' => $data['barrage_show'],
'support_trade_type' => $data['support_trade_type'] ?? '', 'support_trade_type' => $data['support_trade_type'] ?? '',
'is_zmxx' => $data['is_zmxx'] ?? 0, 'is_zmxx' => $data['is_zmxx'] ?? 0,
'is_correlation' => $data['is_correlation'] ?? 0,
'correlation_type' => $data['is_correlation'] ?? 1,
'correlation_goods_ids' => json_encode($data['correlation_goods_ids'] ? explode(',',$data['correlation_goods_ids']) : [])
); );
$common_data = array( $common_data = array(
'goods_name' => $data['goods_name'], 'goods_name' => $data['goods_name'],

View File

@ -1100,6 +1100,12 @@
</tr> </tr>
{{# } }} {{# } }}
</script> </script>
<!-- 商品列表操作 -->
<script type="text/html" id="operation">
<div class="table-btn">
<a class="layui-btn" onclick="delGoods({{d.goods_id}})">删除</a>
</div>
</script>
{/block} {/block}
{block name="script"} {block name="script"}
<script> <script>
@ -1133,7 +1139,7 @@
} }
renderTable(selectedGoodsList); renderTable(selectedGoodsList);
$("input[name='goods_ids']").val(selectedGoodsId.toString()); $("input[name='correlation_goods_ids']").val(selectedGoodsId.toString());
} }
}, selectedGoodsId, {mode: "spu", is_weigh: 1}); }, selectedGoodsId, {mode: "spu", is_weigh: 1});
} }

View File

@ -1200,6 +1200,12 @@
</script> </script>
{/block} {/block}
{block name="script"} {block name="script"}
<!-- 商品列表操作 -->
<script type="text/html" id="operation">
<div class="table-btn">
<a class="layui-btn" onclick="delGoods({{d.goods_id}})">删除</a>
</div>
</script>
<script> <script>
layui.extend({ layui.extend({
layCascader: '__STATIC__/ext/layui/extend/cascader/cascader' layCascader: '__STATIC__/ext/layui/extend/cascader/cascader'