diff --git a/application/plugins/freightfee/Admin.php b/application/plugins/freightfee/Admin.php index 20f4237f5..f86af745f 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 28f92ed03..78672b219 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}} +