查看: 194|回复: 0

[fastadmin] fastadmin多城市开发edit或者add

[复制链接]

759

主题

39

回帖

3976

积分

管理员

总舵主

积分
3976
QQ
发表于 2026-10-16 17:39:01 | 显示全部楼层 |阅读模式
php代码:
  1. // 多城市
  2.         $province = $this->request->param('province');
  3.         $city = $this->request->param('city');
  4.         $area = $this->request->param('area');
  5.         // 省级
  6.         if (NULL !== $province && $province !== '') {
  7.             $params['pcity_id'] = $province;
  8.         } else {
  9.             $params['pcity_id'] = 0;
  10.         }
  11.         // 市级
  12.         if (NULL !== $city && $city !== '') {
  13.             $params['ccity_id'] = $city;
  14.         } else {
  15.             $params['ccity_id'] = 0;
  16.         }
  17.         // 县级
  18.         if (NULL !== $area && $area !== '') {
  19.             $params['scity_id'] = $area;
  20.         } else {
  21.             $params['scity_id'] = 0;
  22.         }
复制代码
html代码:

1、add.html
  1. {if $multiplecity == 1}
  2.     <div class="form-group">
  3.         <label class="control-label col-xs-12 col-sm-2">{:__('Parent')}:</label>
  4.         <div class="col-xs-12 col-sm-8">
  5.             <input id="c-recharge_id" class="form-control" name="row[recharge_id]" type="hidden" value="{$recharge_id|htmlentities}">
  6.             <div class="form-inline" data-toggle="cxselect" data-selects="province,city,area">
  7.                 <select class="province form-control" data-rule="required" name="province" data-url="eshop/city/area"></select>
  8.                 <select class="city form-control" data-rule="required" name="city" data-url="eshop/city/area"></select>
  9.                 {if $citytype == 2}
  10.                 <select class="area form-control" data-rule="required" name="area" data-url="eshop/city/area"></select>
  11.                 {/if}
  12.             </div>
  13.             <span class="help-block">请选择所属行政区划</span>
  14.         </div>
  15.     </div>
  16.     {/if}
复制代码
2、edit.html
  1. {if $multiplecity == 1}
  2.     <div class="form-group">
  3.         <label class="control-label col-xs-12 col-sm-2">{:__('Parent')}:</label>
  4.         <div class="col-xs-12 col-sm-8">
  5.             <div class="form-inline" data-toggle="cxselect" data-selects="province,city,area">
  6.                 <select class="province form-control" data-rule="required" name="province" data-url="eshop/city/area">
  7.                     <option value="{$row.pcity_id}" selected>省级</option>
  8.                 </select>
  9.                 <select class="city form-control" data-rule="required" name="city" data-url="eshop/city/area">
  10.                     <option value="{$row.ccity_id}" selected>市级</option>
  11.                 </select>
  12.                 {if $citytype == 2}
  13.                 <select class="area form-control" data-rule="required" name="area" data-url="eshop/city/area">
  14.                     <option value="{$row.scity_id}" selected>县级</option>
  15.                 </select>
  16.                 {/if}
  17.             </div>
  18.             <span class="help-block">请选择所属行政区划</span>
  19.         </div>
  20.     </div>
  21.     {/if}
复制代码
语言包:
  1.     'Parent'       => '行政区划',
  2.     'Pcity_id'     => '省级ID',
  3.     'Pcity'        => '省级',
  4.     'Ccity_id'     => '市级ID',
  5.     'Ccity'        => '市级',
  6.     'Scity_id'     => '县级ID',
  7.     'Scity'        => '县级',
复制代码



道不同,不相为谋!理想要有,万一实现了呢?
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关注公众号

相关侵权、举报、投诉及建议等,请发 E-mail:2513533699@qq.com

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.|鲁ICP备19000917号|鲁公网安备37078302000320号

在本版发帖
关注公众号
QQ客服返回顶部