diff --git a/application/plugins/freightfee/Admin.php b/application/plugins/freightfee/Admin.php index 20f4237f536c012e05f1e8f892c689224e4859f5..f86af745f1a39efeb3a4ae198f0120f934dd1164 100644 --- a/application/plugins/freightfee/Admin.php +++ b/application/plugins/freightfee/Admin.php @@ -10,6 +10,7 @@ // +---------------------------------------------------------------------- namespace app\plugins\freightfee; +use think\Db; use think\Controller; use app\service\PluginsService; use app\service\RegionService; @@ -36,6 +37,15 @@ class Admin extends Controller $ret = PluginsService::PluginsData('freightfee'); if($ret['code'] == 0) { + // 数据处理 + if(!empty($ret['data']['data'])) + { + foreach($ret['data']['data'] as &$v) + { + $v['region_names'] = empty($v['region_show']) ? '' : implode('、', Db::name('Region')->where('id', 'in', explode('-', $v['region_show']))->column('name')); + } + } + $this->assign('data', $ret['data']); return $this->fetch('../../../plugins/view/freightfee/admin/index'); } else { @@ -73,7 +83,14 @@ class Admin extends Controller }, $region); } - //print_r($ret['data']); + // 数据处理 + if(!empty($ret['data']['data'])) + { + foreach($ret['data']['data'] as &$v) + { + $v['region_names'] = empty($v['region_show']) ? '' : implode('、', Db::name('Region')->where('id', 'in', explode('-', $v['region_show']))->column('name')); + } + } $this->assign('region_list', $region); $this->assign('is_whether_list', $is_whether_list); diff --git a/application/plugins/view/freightfee/admin/index.html b/application/plugins/view/freightfee/admin/index.html index 28f92ed03e531514ccdcad74ac647a0d8b987320..78672b21960ab0a55094f22e166d4d06773979cc 100644 --- a/application/plugins/view/freightfee/admin/index.html +++ b/application/plugins/view/freightfee/admin/index.html @@ -10,61 +10,63 @@
运送到 | +首件数(件) | +首费(元) | +续件数(件) | +续费(元) | +
---|---|---|---|---|
运送到 | +首件数(kg) | +首费(元) | +续件数(kg) | +续费(元) | +
+ {{if $v['region'] eq 'default'}}
+ 默认运费
+ {{else /}}
+ {{$v.region_names}}
+ {{/if}}
+ |
+ {{$v.first}} | +{{$v.first_price}} | +{{$v.continue}} | +{{$v.continue_price}} | +
运送到 | -首件数(件) | -首费(元) | -续件数(件) | -续费(元) | -操作 | -|
---|---|---|---|---|---|---|
- 默认运费 - - | -- - | -- - | -- - | -- - | -- | |
运送到 | +首件数(件) | +首费(元) | +续件数(件) | +续费(元) | +操作 | +|
+ 默认运费 + + + | ++ + | ++ + | ++ + | ++ + | ++ | |
运送到 | +首件数(件) | +首费(元) | +续件数(件) | +续费(元) | +操作 | +|
+ {{if $v['region'] eq 'default'}}
+ 默认运费
+
+
+ {{else /}}
+ {{$v.region_names}}
+ 添加地区
+
+
+ {{/if}}
+ |
+ + + | ++ + | ++ + | ++ + | + {{if $v['region'] eq 'default'}} ++ {{else /}} + | + 删除 + | + {{/if}} +
运送到 | +首件数(kg) | +首费(元) | +续件数(kg) | +续费(元) | +操作 | +|
+ {{if $v['region'] eq 'default'}}
+ 默认运费
+
+
+ {{else /}}
+ {{$v.region_names}}
+ 添加地区
+
+
+ {{/if}}
+ |
+ + + | ++ + | ++ + | ++ + | + {{if $v['region'] eq 'default'}} ++ {{else /}} + | + 删除 + | + {{/if}} +