ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
:-: 关联版式 文件路径:shop/controllers/Seller/GoodsCtl.php; ##### 1、版式显示(format()) 后台数据获取: $format_rows = $Goods_FormatModel->getFormatList($cond_row, array(), $page, $rows); 前台显示: <?php foreach ($data as $key => $value) { ?> <tr> <td class="tl"> <label class="checkbox"><input class="checkitem" type="checkbox" name="chk[]" value="<?= $value['id'] ?>"/></label> <?= $value['name'] ?> </td> <td><?php print($value['position_name']); ?></td> <td> <span class="edit"><a href="<?php echo Yf_Registry::get('url'); ?>?ctl=Seller_Goods&met=format&act=edit&id=<?= $value['id']; ?>"><i class="iconfont icon-zhifutijiao"></i><?=__('编辑')?></a></span> <span class="del"><a data-param="{'id':'<?= $value['id']; ?>','ctl':'Seller_Goods','met':'deleteGoodsFormat'}" href="javascript:void(0)"><i class="iconfont icon-lajitong"></i><?=__('删除')?></a></span> </td> </tr> <?php }?> ##### 2、新增版式 (format()) 参数:act=add 视图文件: $this->view->setMet('addformat'); 提交表单: $('#form').validator({ ignore: ':hidden', theme: 'yellow_right', timely: 1, stopOnError: false, rules: { }, fields: { 'name': 'required;' }, valid:function(form){ //表单验证通过,提交表单 $.ajax({ url: ajax_url, data:$("#form").serialize(), type:"POST", success:function(a){ if(a.status == 200) { Public.tips({ content: "<?=__('操作成功'); ?>"}); if (opener) { opener.addLayout({ id: a.data.id, name: $("#title").val(), position: $("select[name=\"position\"]").val() }); window.close(); } else { location.href=SITE_URL + "?ctl=Seller_Goods&met=format&typ=e"; } } else { Public.tips({ content: "<?=__('操作失败'); ?>"}); } } }); } }); ##### 3、版式编辑(format()) 参数:act = edit 视图文件: $this->view->setMet('addformat'); 表单提交与2、版式添加中表单提交相同 ##### 4、版式删除() <span class="del"><a data-param="{'id':'<?= $value['id']; ?>','ctl':'Seller_Goods','met':'deleteGoodsFormat'}" href="javascript:void(0)"><i class="iconfont icon-lajitong"></i><?=__('删除')?></a></span>