Merge branch 'monanxiao'
This commit is contained in:
commit
11439763f8
@ -16,6 +16,10 @@ use think\exception\ValidateException;
|
||||
use think\facade\Db;
|
||||
use think\facade\View;
|
||||
use app\admin\model\Admin;
|
||||
use app\admin\model\GeoCity;
|
||||
use app\admin\model\GeoArea;
|
||||
use app\admin\model\GeoStreet;
|
||||
use app\admin\model\GeoVillage;
|
||||
|
||||
class SupplyTeam extends BaseController
|
||||
|
||||
@ -37,14 +41,31 @@ class SupplyTeam extends BaseController
|
||||
$param = get_params();
|
||||
$where = [];
|
||||
|
||||
$list = $this->model->with('level')->select();
|
||||
$list = $this->model->with(['level', 'user'])->select();
|
||||
$total = $this->model->count();
|
||||
// $list = $this->model->getSupplyTeamList($where,$param);
|
||||
// foreach ($list as $k =>$v){
|
||||
// $list[$k]['area_id'] = Db::table('fa_geo_area')->where('area_id',$v['parent_code'])->value('area_name');
|
||||
// $list[$k]['supply_level_id'] = Db::table('fa_supply_level')->where('id',$v['supply_level_id'])->value('name');
|
||||
// $list[$k]['user_id'] = Db::table('fa_szxc_information_usermsg')->where('user_id',$v['user_id'])->value('name');
|
||||
// }
|
||||
foreach ($list as $k =>$v){
|
||||
|
||||
switch ($v['auth_range']) {
|
||||
case 1:
|
||||
$list[$k]['address'] = GeoVillage::where('village_code', $v['parent_code'])->value('village_name');
|
||||
$list[$k]['auth_range'] = '村';
|
||||
break;
|
||||
case 2:
|
||||
$list[$k]['address'] = GeoStreet::where('street_code', $v['parent_code'])->value('street_name');
|
||||
$list[$k]['auth_range'] = '乡镇';
|
||||
break;
|
||||
case 3:
|
||||
$list[$k]['address'] = GeoArea::where('area_code', $v['parent_code'])->value('area_name');
|
||||
$list[$k]['auth_range'] = '区县';
|
||||
break;
|
||||
case 4:
|
||||
$list[$k]['address'] = GeoCity::where('city_code', $v['parent_code'])->value('city_name');
|
||||
$list[$k]['auth_range'] = '市';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$result = ['total' => $total, 'data' => $list];
|
||||
|
||||
return table_assign(0, '', $result);
|
||||
|
19
app/admin/model/GeoVillage.php
Normal file
19
app/admin/model/GeoVillage.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
/**
|
||||
* 时间:2023年03月18日
|
||||
* 作者:墨楠小
|
||||
* 邮箱:monanxiao@qq.com
|
||||
* 地区 街道模型
|
||||
*
|
||||
*/
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class GeoVillage extends Model
|
||||
{
|
||||
|
||||
// 设置当前模型对应的完整数据表名称
|
||||
protected $table = 'fa_geo_village';
|
||||
|
||||
}
|
@ -6,6 +6,8 @@
|
||||
*/
|
||||
namespace app\admin\model;
|
||||
use think\model;
|
||||
use app\common\model\User;
|
||||
|
||||
class SupplyTeam extends Model
|
||||
{
|
||||
// 设置当前模型对应的完整数据表名称
|
||||
@ -21,6 +23,16 @@ class SupplyTeam extends Model
|
||||
return $this->hasOne(SupplyLevel::class, 'id', 'supply_level_id');
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 管理后台用户
|
||||
*
|
||||
*/
|
||||
public function user()
|
||||
{
|
||||
return $this->hasOne(User::class, 'id', 'user_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分页列表
|
||||
* @param $where
|
||||
|
@ -62,15 +62,29 @@
|
||||
return d.level.name + ',分佣比例:' + d.level.rate + '%';
|
||||
}
|
||||
},{
|
||||
field: 'user_id',
|
||||
field: 'user',
|
||||
title: '后台负责人',
|
||||
align: 'center',
|
||||
// width: 100,
|
||||
templet: function (d)
|
||||
{
|
||||
return d.user.nickname + ',手机号:' + d.user.mobile;
|
||||
}
|
||||
},{
|
||||
field: 'auth_range',
|
||||
title: '权限',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'parent_code',
|
||||
title: '市/区县/镇/村',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'address',
|
||||
title: '市/区县/镇/村',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'brokerage',
|
||||
title: '分佣金额',
|
||||
|
@ -17,6 +17,8 @@ class User extends BaseModel
|
||||
'url',
|
||||
];
|
||||
|
||||
protected $table = "fa_user";
|
||||
|
||||
/**
|
||||
* 获取个人URL.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user