新增几个管理
This commit is contained in:
parent
3b564ffc12
commit
20f8fa2bdb
140
app/admin/controller/SupplyAccount.php
Normal file
140
app/admin/controller/SupplyAccount.php
Normal file
@ -0,0 +1,140 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2021 勾股工作室
|
||||
* @license https://opensource.org/licenses/Apache-2.0
|
||||
* @link https://www.gougucms.com
|
||||
*/
|
||||
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\admin\BaseController;
|
||||
use app\admin\model\SupplyAccount as SupplyAccountModel;
|
||||
use app\admin\validate\SupplyAccountValidate;
|
||||
use think\exception\ValidateException;
|
||||
use think\facade\Db;
|
||||
use think\facade\View;
|
||||
|
||||
class SupplyAccount extends BaseController
|
||||
|
||||
{
|
||||
/**
|
||||
* 构造函数
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->model = new SupplyAccountModel();
|
||||
$this->uid = get_login_admin('id');
|
||||
}
|
||||
/**
|
||||
* 数据列表
|
||||
*/
|
||||
public function datalist()
|
||||
{
|
||||
if (request()->isAjax()) {
|
||||
$param = get_params();
|
||||
$where = [];
|
||||
|
||||
$list = $this->model->getSupplyAccountList($where,$param);
|
||||
foreach ($list as $k =>$v){
|
||||
$list[$k]['fa_supply_team_id'] = Db::table('fa_supply_team')->where('id',$v['fa_supply_team_id'])->value('name');
|
||||
}
|
||||
return table_assign(0, '', $list);
|
||||
}
|
||||
else{
|
||||
return view();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if (request()->isAjax()) {
|
||||
$param = get_params();
|
||||
|
||||
// 检验完整性
|
||||
try {
|
||||
validate(SupplyAccountValidate::class)->check($param);
|
||||
} catch (ValidateException $e) {
|
||||
// 验证失败 输出错误信息
|
||||
return to_assign(1, $e->getError());
|
||||
}
|
||||
|
||||
$this->model->addSupplyAccount($param);
|
||||
}else{
|
||||
$team = Db::table('fa_supply_team')->select();
|
||||
View::assign('team', $team);
|
||||
return view();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$param = get_params();
|
||||
|
||||
if (request()->isAjax()) {
|
||||
// 检验完整性
|
||||
try {
|
||||
validate(SupplyAccountValidate::class)->check($param);
|
||||
} catch (ValidateException $e) {
|
||||
// 验证失败 输出错误信息
|
||||
return to_assign(1, $e->getError());
|
||||
}
|
||||
|
||||
$this->model->editSupplyAccount($param);
|
||||
}else{
|
||||
$id = isset($param['id']) ? $param['id'] : 0;
|
||||
$detail = $this->model->getSupplyAccountById($id);
|
||||
if (!empty($detail)) {
|
||||
View::assign('detail', $detail);
|
||||
$team = Db::table('fa_supply_team')->select();
|
||||
View::assign('team', $team);
|
||||
return view();
|
||||
}
|
||||
else{
|
||||
throw new \think\exception\HttpException(404, '找不到页面');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查看信息
|
||||
*/
|
||||
public function read()
|
||||
{
|
||||
$param = get_params();
|
||||
$id = isset($param['id']) ? $param['id'] : 0;
|
||||
$detail = $this->model->getSupplyAccountById($id);
|
||||
if (!empty($detail)) {
|
||||
View::assign('detail', $detail);
|
||||
$team = Db::table('fa_supply_team')->select();
|
||||
View::assign('team', $team);
|
||||
return view();
|
||||
}
|
||||
else{
|
||||
throw new \think\exception\HttpException(404, '找不到页面');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* type=0,逻辑删除,默认
|
||||
* type=1,物理删除
|
||||
*/
|
||||
public function del()
|
||||
{
|
||||
$param = get_params();
|
||||
$id = isset($param['id']) ? $param['id'] : 0;
|
||||
$type = isset($param['type']) ? $param['type'] : 0;
|
||||
|
||||
$this->model->delSupplyAccountById($id,$type);
|
||||
}
|
||||
}
|
143
app/admin/controller/SupplyBrokerage.php
Normal file
143
app/admin/controller/SupplyBrokerage.php
Normal file
@ -0,0 +1,143 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2021 勾股工作室
|
||||
* @license https://opensource.org/licenses/Apache-2.0
|
||||
* @link https://www.gougucms.com
|
||||
*/
|
||||
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\admin\BaseController;
|
||||
use app\admin\model\SupplyBrokerage as SupplyBrokerageModel;
|
||||
use app\admin\validate\SupplyBrokerageValidate;
|
||||
use think\exception\ValidateException;
|
||||
use think\facade\Db;
|
||||
use think\facade\View;
|
||||
|
||||
class SupplyBrokerage extends BaseController
|
||||
|
||||
{
|
||||
/**
|
||||
* 构造函数
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->model = new SupplyBrokerageModel();
|
||||
$this->uid = get_login_admin('id');
|
||||
}
|
||||
/**
|
||||
* 数据列表
|
||||
*/
|
||||
public function datalist()
|
||||
{
|
||||
if (request()->isAjax()) {
|
||||
$param = get_params();
|
||||
$where = [];
|
||||
|
||||
$list = $this->model->getSupplyBrokerageList($where,$param);
|
||||
foreach ($list as $k =>$v){
|
||||
$list[$k]['fa_supply_chain_id'] = Db::table('fa_supply_team')->where('id',$v['fa_supply_chain_id'])->value('name');
|
||||
$list[$k]['mer_id'] = Db::connect('shop')->table('eb_merchant')->where('mer_id',$v['mer_id'])->value('mer_name');
|
||||
// $list[$k]['user_id'] = Db::table('fa_szxc_information_usermsg')->where('user_id',$v['user_id'])->value('name');
|
||||
if($v['status'] == 1){
|
||||
$list[$k]['status'] = '成功';
|
||||
}else{
|
||||
$list[$k]['status'] = '待分佣';
|
||||
}
|
||||
$list[$k]['supply_level_id'] = Db::table('fa_supply_level')->where('id',$v['supply_level_id'])->value('name');
|
||||
|
||||
}
|
||||
return table_assign(0, '', $list);
|
||||
}
|
||||
else{
|
||||
return view();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if (request()->isAjax()) {
|
||||
$param = get_params();
|
||||
|
||||
// 检验完整性
|
||||
try {
|
||||
validate(SupplyBrokerageValidate::class)->check($param);
|
||||
} catch (ValidateException $e) {
|
||||
// 验证失败 输出错误信息
|
||||
return to_assign(1, $e->getError());
|
||||
}
|
||||
|
||||
$this->model->addSupplyBrokerage($param);
|
||||
}else{
|
||||
return view();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$param = get_params();
|
||||
|
||||
if (request()->isAjax()) {
|
||||
// 检验完整性
|
||||
try {
|
||||
validate(SupplyBrokerageValidate::class)->check($param);
|
||||
} catch (ValidateException $e) {
|
||||
// 验证失败 输出错误信息
|
||||
return to_assign(1, $e->getError());
|
||||
}
|
||||
|
||||
$this->model->editSupplyBrokerage($param);
|
||||
}else{
|
||||
$id = isset($param['id']) ? $param['id'] : 0;
|
||||
$detail = $this->model->getSupplyBrokerageById($id);
|
||||
if (!empty($detail)) {
|
||||
View::assign('detail', $detail);
|
||||
return view();
|
||||
}
|
||||
else{
|
||||
throw new \think\exception\HttpException(404, '找不到页面');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查看信息
|
||||
*/
|
||||
public function read()
|
||||
{
|
||||
$param = get_params();
|
||||
$id = isset($param['id']) ? $param['id'] : 0;
|
||||
$detail = $this->model->getSupplyBrokerageById($id);
|
||||
if (!empty($detail)) {
|
||||
View::assign('detail', $detail);
|
||||
return view();
|
||||
}
|
||||
else{
|
||||
throw new \think\exception\HttpException(404, '找不到页面');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* type=0,逻辑删除,默认
|
||||
* type=1,物理删除
|
||||
*/
|
||||
public function del()
|
||||
{
|
||||
$param = get_params();
|
||||
$id = isset($param['id']) ? $param['id'] : 0;
|
||||
$type = isset($param['type']) ? $param['type'] : 0;
|
||||
|
||||
$this->model->delSupplyBrokerageById($id,$type);
|
||||
}
|
||||
}
|
131
app/admin/controller/SupplyLevel.php
Normal file
131
app/admin/controller/SupplyLevel.php
Normal file
@ -0,0 +1,131 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2021 勾股工作室
|
||||
* @license https://opensource.org/licenses/Apache-2.0
|
||||
* @link https://www.gougucms.com
|
||||
*/
|
||||
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\admin\BaseController;
|
||||
use app\admin\model\SupplyLevel as SupplyLevelModel;
|
||||
use app\admin\validate\SupplyLevelValidate;
|
||||
use think\exception\ValidateException;
|
||||
use think\facade\Db;
|
||||
use think\facade\View;
|
||||
|
||||
class SupplyLevel extends BaseController
|
||||
|
||||
{
|
||||
/**
|
||||
* 构造函数
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->model = new SupplyLevelModel();
|
||||
$this->uid = get_login_admin('id');
|
||||
}
|
||||
/**
|
||||
* 数据列表
|
||||
*/
|
||||
public function datalist()
|
||||
{
|
||||
if (request()->isAjax()) {
|
||||
$param = get_params();
|
||||
$where = [];
|
||||
|
||||
$list = $this->model->getSupplyLevelList($where,$param);
|
||||
return table_assign(0, '', $list);
|
||||
}
|
||||
else{
|
||||
return view();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if (request()->isAjax()) {
|
||||
$param = get_params();
|
||||
|
||||
// 检验完整性
|
||||
try {
|
||||
validate(SupplyLevelValidate::class)->check($param);
|
||||
} catch (ValidateException $e) {
|
||||
// 验证失败 输出错误信息
|
||||
return to_assign(1, $e->getError());
|
||||
}
|
||||
|
||||
$this->model->addSupplyLevel($param);
|
||||
}else{
|
||||
return view();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$param = get_params();
|
||||
|
||||
if (request()->isAjax()) {
|
||||
// 检验完整性
|
||||
try {
|
||||
validate(SupplyLevelValidate::class)->check($param);
|
||||
} catch (ValidateException $e) {
|
||||
// 验证失败 输出错误信息
|
||||
return to_assign(1, $e->getError());
|
||||
}
|
||||
|
||||
$this->model->editSupplyLevel($param);
|
||||
}else{
|
||||
$id = isset($param['id']) ? $param['id'] : 0;
|
||||
$detail = $this->model->getSupplyLevelById($id);
|
||||
if (!empty($detail)) {
|
||||
View::assign('detail', $detail);
|
||||
return view();
|
||||
}
|
||||
else{
|
||||
throw new \think\exception\HttpException(404, '找不到页面');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查看信息
|
||||
*/
|
||||
public function read()
|
||||
{
|
||||
$param = get_params();
|
||||
$id = isset($param['id']) ? $param['id'] : 0;
|
||||
$detail = $this->model->getSupplyLevelById($id);
|
||||
if (!empty($detail)) {
|
||||
View::assign('detail', $detail);
|
||||
return view();
|
||||
}
|
||||
else{
|
||||
throw new \think\exception\HttpException(404, '找不到页面');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* type=0,逻辑删除,默认
|
||||
* type=1,物理删除
|
||||
*/
|
||||
public function del()
|
||||
{
|
||||
$param = get_params();
|
||||
$id = isset($param['id']) ? $param['id'] : 0;
|
||||
$type = isset($param['type']) ? $param['type'] : 0;
|
||||
|
||||
$this->model->delSupplyLevelById($id,$type);
|
||||
}
|
||||
}
|
157
app/admin/controller/SupplyTeam.php
Normal file
157
app/admin/controller/SupplyTeam.php
Normal file
@ -0,0 +1,157 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2021 勾股工作室
|
||||
* @license https://opensource.org/licenses/Apache-2.0
|
||||
* @link https://www.gougucms.com
|
||||
*/
|
||||
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\admin\BaseController;
|
||||
use app\admin\model\SupplyTeam as SupplyTeamModel;
|
||||
use app\admin\validate\SupplyTeamValidate;
|
||||
use think\exception\ValidateException;
|
||||
use think\facade\Db;
|
||||
use think\facade\View;
|
||||
|
||||
class SupplyTeam extends BaseController
|
||||
|
||||
{
|
||||
/**
|
||||
* 构造函数
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->model = new SupplyTeamModel();
|
||||
$this->uid = get_login_admin('id');
|
||||
}
|
||||
/**
|
||||
* 数据列表
|
||||
*/
|
||||
public function datalist()
|
||||
{
|
||||
if (request()->isAjax()) {
|
||||
$param = get_params();
|
||||
$where = [];
|
||||
|
||||
$list = $this->model->getSupplyTeamList($where,$param);
|
||||
foreach ($list as $k =>$v){
|
||||
$list[$k]['area_id'] = Db::table('fa_geo_area')->where('area_id',$v['area_id'])->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');
|
||||
}
|
||||
return table_assign(0, '', $list);
|
||||
}
|
||||
else{
|
||||
return view();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if (request()->isAjax()) {
|
||||
$param = get_params();
|
||||
|
||||
// 检验完整性
|
||||
try {
|
||||
validate(SupplyTeamValidate::class)->check($param);
|
||||
} catch (ValidateException $e) {
|
||||
// 验证失败 输出错误信息
|
||||
return to_assign(1, $e->getError());
|
||||
}
|
||||
|
||||
$this->model->addSupplyTeam($param);
|
||||
}else{
|
||||
$geo_area = Db::table('fa_geo_area')->where('city_code',510500)->select();
|
||||
View::assign('geo_area', $geo_area);
|
||||
$level = Db::table('fa_supply_level')->select();
|
||||
View::assign('level', $level);
|
||||
//获取用户信息
|
||||
$this->users = Db::table('fa_szxc_information_usermsg')->where('status',1)->field('user_id,name')->select();
|
||||
View::assign('users', $this->users);
|
||||
return view();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$param = get_params();
|
||||
|
||||
if (request()->isAjax()) {
|
||||
// 检验完整性
|
||||
try {
|
||||
validate(SupplyTeamValidate::class)->check($param);
|
||||
} catch (ValidateException $e) {
|
||||
// 验证失败 输出错误信息
|
||||
return to_assign(1, $e->getError());
|
||||
}
|
||||
|
||||
$this->model->editSupplyTeam($param);
|
||||
}else{
|
||||
$id = isset($param['id']) ? $param['id'] : 0;
|
||||
$detail = $this->model->getSupplyTeamById($id);
|
||||
if (!empty($detail)) {
|
||||
View::assign('detail', $detail);
|
||||
$geo_area = Db::table('fa_geo_area')->where('city_code',510500)->select();
|
||||
View::assign('geo_area', $geo_area);
|
||||
$level = Db::table('fa_supply_level')->select();
|
||||
View::assign('level', $level);
|
||||
//获取用户信息
|
||||
$this->users = Db::table('fa_szxc_information_usermsg')->where('status',1)->field('user_id,name')->select();
|
||||
View::assign('users', $this->users);
|
||||
return view();
|
||||
}
|
||||
else{
|
||||
throw new \think\exception\HttpException(404, '找不到页面');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查看信息
|
||||
*/
|
||||
public function read()
|
||||
{
|
||||
$param = get_params();
|
||||
$id = isset($param['id']) ? $param['id'] : 0;
|
||||
$detail = $this->model->getSupplyTeamById($id);
|
||||
if (!empty($detail)) {
|
||||
View::assign('detail', $detail);
|
||||
$geo_area = Db::table('fa_geo_area')->where('city_code',510500)->select();
|
||||
View::assign('geo_area', $geo_area);
|
||||
$level = Db::table('fa_supply_level')->select();
|
||||
View::assign('level', $level);
|
||||
//获取用户信息
|
||||
$this->users = Db::table('fa_szxc_information_usermsg')->where('status',1)->field('user_id,name')->select();
|
||||
View::assign('users', $this->users);
|
||||
return view();
|
||||
}
|
||||
else{
|
||||
throw new \think\exception\HttpException(404, '找不到页面');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* type=0,逻辑删除,默认
|
||||
* type=1,物理删除
|
||||
*/
|
||||
public function del()
|
||||
{
|
||||
$param = get_params();
|
||||
$id = isset($param['id']) ? $param['id'] : 0;
|
||||
$type = isset($param['type']) ? $param['type'] : 0;
|
||||
|
||||
$this->model->delSupplyTeamById($id,$type);
|
||||
}
|
||||
}
|
100
app/admin/model/SupplyAccount.php
Normal file
100
app/admin/model/SupplyAccount.php
Normal file
@ -0,0 +1,100 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2021 勾股工作室
|
||||
* @license https://opensource.org/licenses/Apache-2.0
|
||||
* @link https://www.gougucms.com
|
||||
*/
|
||||
namespace app\admin\model;
|
||||
use think\model;
|
||||
class SupplyAccount extends Model
|
||||
{
|
||||
// 设置当前模型对应的完整数据表名称
|
||||
protected $table = 'fa_supply_account';
|
||||
|
||||
/**
|
||||
* 获取分页列表
|
||||
* @param $where
|
||||
* @param $param
|
||||
*/
|
||||
public function getSupplyAccountList($where, $param)
|
||||
{
|
||||
$rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit'];
|
||||
$order = empty($param['order']) ? 'id desc' : $param['order'];
|
||||
$list = self::where($where)->field('id,account,name,bank,amount,balance,free_balance,fa_supply_team_id')->order($order)->paginate($rows, false, ['query' => $param]);
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加数据
|
||||
* @param $param
|
||||
*/
|
||||
public function addSupplyAccount($param)
|
||||
{
|
||||
$insertId = 0;
|
||||
try {
|
||||
$param['create_time'] = time();
|
||||
$insertId = self::strict(false)->field(true)->insertGetId($param);
|
||||
add_log('add', $insertId, $param);
|
||||
} catch(\Exception $e) {
|
||||
return to_assign(1, '操作失败,原因:'.$e->getMessage());
|
||||
}
|
||||
return to_assign(0,'操作成功',['aid'=>$insertId]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑信息
|
||||
* @param $param
|
||||
*/
|
||||
public function editSupplyAccount($param)
|
||||
{
|
||||
try {
|
||||
$param['update_time'] = time();
|
||||
self::where('id', $param['id'])->strict(false)->field(true)->update($param);
|
||||
add_log('edit', $param['id'], $param);
|
||||
} catch(\Exception $e) {
|
||||
return to_assign(1, '操作失败,原因:'.$e->getMessage());
|
||||
}
|
||||
return to_assign();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据id获取信息
|
||||
* @param $id
|
||||
*/
|
||||
public function getSupplyAccountById($id)
|
||||
{
|
||||
$info = self::where('id', $id)->find();
|
||||
return $info;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除信息
|
||||
* @param $id
|
||||
* @return array
|
||||
*/
|
||||
public function delSupplyAccountById($id,$type=0)
|
||||
{
|
||||
if($type==0){
|
||||
//逻辑删除
|
||||
try {
|
||||
$param['delete_time'] = time();
|
||||
self::where('id', $id)->update(['delete_time'=>time()]);
|
||||
add_log('delete', $id);
|
||||
} catch(\Exception $e) {
|
||||
return to_assign(1, '操作失败,原因:'.$e->getMessage());
|
||||
}
|
||||
}
|
||||
else{
|
||||
//物理删除
|
||||
try {
|
||||
self::where('id', $id)->delete();
|
||||
add_log('delete', $id);
|
||||
} catch(\Exception $e) {
|
||||
return to_assign(1, '操作失败,原因:'.$e->getMessage());
|
||||
}
|
||||
}
|
||||
return to_assign();
|
||||
}
|
||||
}
|
||||
|
100
app/admin/model/SupplyBrokerage.php
Normal file
100
app/admin/model/SupplyBrokerage.php
Normal file
@ -0,0 +1,100 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2021 勾股工作室
|
||||
* @license https://opensource.org/licenses/Apache-2.0
|
||||
* @link https://www.gougucms.com
|
||||
*/
|
||||
namespace app\admin\model;
|
||||
use think\model;
|
||||
class SupplyBrokerage extends Model
|
||||
{
|
||||
// 设置当前模型对应的完整数据表名称
|
||||
protected $table = 'fa_supply_brokerage';
|
||||
|
||||
/**
|
||||
* 获取分页列表
|
||||
* @param $where
|
||||
* @param $param
|
||||
*/
|
||||
public function getSupplyBrokerageList($where, $param)
|
||||
{
|
||||
$rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit'];
|
||||
$order = empty($param['order']) ? 'id desc' : $param['order'];
|
||||
$list = self::where($where)->field('id,supply_sn,mer_id,fa_supply_chain_id,order_sn,order_id,user_info,user_id,supply_userId,pay_price,brokerage_price,brokerage_rate,status,supply_level_id,group_user,create_time')->order($order)->paginate($rows, false, ['query' => $param]);
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加数据
|
||||
* @param $param
|
||||
*/
|
||||
public function addSupplyBrokerage($param)
|
||||
{
|
||||
$insertId = 0;
|
||||
try {
|
||||
$param['create_time'] = time();
|
||||
$insertId = self::strict(false)->field(true)->insertGetId($param);
|
||||
add_log('add', $insertId, $param);
|
||||
} catch(\Exception $e) {
|
||||
return to_assign(1, '操作失败,原因:'.$e->getMessage());
|
||||
}
|
||||
return to_assign(0,'操作成功',['aid'=>$insertId]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑信息
|
||||
* @param $param
|
||||
*/
|
||||
public function editSupplyBrokerage($param)
|
||||
{
|
||||
try {
|
||||
$param['update_time'] = time();
|
||||
self::where('id', $param['id'])->strict(false)->field(true)->update($param);
|
||||
add_log('edit', $param['id'], $param);
|
||||
} catch(\Exception $e) {
|
||||
return to_assign(1, '操作失败,原因:'.$e->getMessage());
|
||||
}
|
||||
return to_assign();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据id获取信息
|
||||
* @param $id
|
||||
*/
|
||||
public function getSupplyBrokerageById($id)
|
||||
{
|
||||
$info = self::where('id', $id)->find();
|
||||
return $info;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除信息
|
||||
* @param $id
|
||||
* @return array
|
||||
*/
|
||||
public function delSupplyBrokerageById($id,$type=0)
|
||||
{
|
||||
if($type==0){
|
||||
//逻辑删除
|
||||
try {
|
||||
$param['delete_time'] = time();
|
||||
self::where('id', $id)->update(['delete_time'=>time()]);
|
||||
add_log('delete', $id);
|
||||
} catch(\Exception $e) {
|
||||
return to_assign(1, '操作失败,原因:'.$e->getMessage());
|
||||
}
|
||||
}
|
||||
else{
|
||||
//物理删除
|
||||
try {
|
||||
self::where('id', $id)->delete();
|
||||
add_log('delete', $id);
|
||||
} catch(\Exception $e) {
|
||||
return to_assign(1, '操作失败,原因:'.$e->getMessage());
|
||||
}
|
||||
}
|
||||
return to_assign();
|
||||
}
|
||||
}
|
||||
|
99
app/admin/model/SupplyLevel.php
Normal file
99
app/admin/model/SupplyLevel.php
Normal file
@ -0,0 +1,99 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2021 勾股工作室
|
||||
* @license https://opensource.org/licenses/Apache-2.0
|
||||
* @link https://www.gougucms.com
|
||||
*/
|
||||
namespace app\admin\model;
|
||||
use think\model;
|
||||
class SupplyLevel extends Model
|
||||
{
|
||||
// 设置当前模型对应的完整数据表名称
|
||||
protected $table = 'fa_supply_level';
|
||||
/**
|
||||
* 获取分页列表
|
||||
* @param $where
|
||||
* @param $param
|
||||
*/
|
||||
public function getSupplyLevelList($where, $param)
|
||||
{
|
||||
$rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit'];
|
||||
$order = empty($param['order']) ? 'id desc' : $param['order'];
|
||||
$list = self::where($where)->field('id,name,rate')->order($order)->paginate($rows, false, ['query' => $param]);
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加数据
|
||||
* @param $param
|
||||
*/
|
||||
public function addSupplyLevel($param)
|
||||
{
|
||||
$insertId = 0;
|
||||
try {
|
||||
$param['create_time'] = time();
|
||||
$insertId = self::strict(false)->field(true)->insertGetId($param);
|
||||
add_log('add', $insertId, $param);
|
||||
} catch(\Exception $e) {
|
||||
return to_assign(1, '操作失败,原因:'.$e->getMessage());
|
||||
}
|
||||
return to_assign(0,'操作成功',['aid'=>$insertId]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑信息
|
||||
* @param $param
|
||||
*/
|
||||
public function editSupplyLevel($param)
|
||||
{
|
||||
try {
|
||||
$param['update_time'] = time();
|
||||
self::where('id', $param['id'])->strict(false)->field(true)->update($param);
|
||||
add_log('edit', $param['id'], $param);
|
||||
} catch(\Exception $e) {
|
||||
return to_assign(1, '操作失败,原因:'.$e->getMessage());
|
||||
}
|
||||
return to_assign();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据id获取信息
|
||||
* @param $id
|
||||
*/
|
||||
public function getSupplyLevelById($id)
|
||||
{
|
||||
$info = self::where('id', $id)->find();
|
||||
return $info;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除信息
|
||||
* @param $id
|
||||
* @return array
|
||||
*/
|
||||
public function delSupplyLevelById($id,$type=0)
|
||||
{
|
||||
if($type==0){
|
||||
//逻辑删除
|
||||
try {
|
||||
$param['delete_time'] = time();
|
||||
self::where('id', $id)->update(['delete_time'=>time()]);
|
||||
add_log('delete', $id);
|
||||
} catch(\Exception $e) {
|
||||
return to_assign(1, '操作失败,原因:'.$e->getMessage());
|
||||
}
|
||||
}
|
||||
else{
|
||||
//物理删除
|
||||
try {
|
||||
self::where('id', $id)->delete();
|
||||
add_log('delete', $id);
|
||||
} catch(\Exception $e) {
|
||||
return to_assign(1, '操作失败,原因:'.$e->getMessage());
|
||||
}
|
||||
}
|
||||
return to_assign();
|
||||
}
|
||||
}
|
||||
|
99
app/admin/model/SupplyTeam.php
Normal file
99
app/admin/model/SupplyTeam.php
Normal file
@ -0,0 +1,99 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2021 勾股工作室
|
||||
* @license https://opensource.org/licenses/Apache-2.0
|
||||
* @link https://www.gougucms.com
|
||||
*/
|
||||
namespace app\admin\model;
|
||||
use think\model;
|
||||
class SupplyTeam extends Model
|
||||
{
|
||||
// 设置当前模型对应的完整数据表名称
|
||||
protected $table = 'fa_supply_team';
|
||||
/**
|
||||
* 获取分页列表
|
||||
* @param $where
|
||||
* @param $param
|
||||
*/
|
||||
public function getSupplyTeamList($where, $param)
|
||||
{
|
||||
$rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit'];
|
||||
$order = empty($param['order']) ? 'id desc' : $param['order'];
|
||||
$list = self::where($where)->field('id,name,lng,lat,area_id,brokerage,withdraw_brokerage,free_brokerage,supply_level_id,user_id')->order($order)->paginate($rows, false, ['query' => $param]);
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加数据
|
||||
* @param $param
|
||||
*/
|
||||
public function addSupplyTeam($param)
|
||||
{
|
||||
$insertId = 0;
|
||||
try {
|
||||
$param['create_time'] = time();
|
||||
$insertId = self::strict(false)->field(true)->insertGetId($param);
|
||||
add_log('add', $insertId, $param);
|
||||
} catch(\Exception $e) {
|
||||
return to_assign(1, '操作失败,原因:'.$e->getMessage());
|
||||
}
|
||||
return to_assign(0,'操作成功',['aid'=>$insertId]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑信息
|
||||
* @param $param
|
||||
*/
|
||||
public function editSupplyTeam($param)
|
||||
{
|
||||
try {
|
||||
$param['update_time'] = time();
|
||||
self::where('id', $param['id'])->strict(false)->field(true)->update($param);
|
||||
add_log('edit', $param['id'], $param);
|
||||
} catch(\Exception $e) {
|
||||
return to_assign(1, '操作失败,原因:'.$e->getMessage());
|
||||
}
|
||||
return to_assign();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据id获取信息
|
||||
* @param $id
|
||||
*/
|
||||
public function getSupplyTeamById($id)
|
||||
{
|
||||
$info = self::where('id', $id)->find();
|
||||
return $info;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除信息
|
||||
* @param $id
|
||||
* @return array
|
||||
*/
|
||||
public function delSupplyTeamById($id,$type=0)
|
||||
{
|
||||
if($type==0){
|
||||
//逻辑删除
|
||||
try {
|
||||
$param['delete_time'] = time();
|
||||
self::where('id', $id)->update(['delete_time'=>time()]);
|
||||
add_log('delete', $id);
|
||||
} catch(\Exception $e) {
|
||||
return to_assign(1, '操作失败,原因:'.$e->getMessage());
|
||||
}
|
||||
}
|
||||
else{
|
||||
//物理删除
|
||||
try {
|
||||
self::where('id', $id)->delete();
|
||||
add_log('delete', $id);
|
||||
} catch(\Exception $e) {
|
||||
return to_assign(1, '操作失败,原因:'.$e->getMessage());
|
||||
}
|
||||
}
|
||||
return to_assign();
|
||||
}
|
||||
}
|
||||
|
32
app/admin/validate/SupplyAccountValidate.php
Normal file
32
app/admin/validate/SupplyAccountValidate.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2021 勾股工作室
|
||||
* @license https://opensource.org/licenses/Apache-2.0
|
||||
* @link https://www.gougucms.com
|
||||
*/
|
||||
|
||||
namespace app\admin\validate;
|
||||
use think\Validate;
|
||||
|
||||
class SupplyAccountValidate extends Validate
|
||||
{
|
||||
protected $rule = [
|
||||
'account' => 'require',
|
||||
'name' => 'require',
|
||||
'bank' => 'require',
|
||||
'amount' => 'require',
|
||||
'balance' => 'require',
|
||||
'free_balance' => 'require',
|
||||
'fa_supply_team_id' => 'require',
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
'account.require' => '账号不能为空',
|
||||
'name.require' => '用户名不能为空',
|
||||
'bank.require' => '开户行不能为空',
|
||||
'amount.require' => '已提现金额不能为空',
|
||||
'balance.require' => '账户余额不能为空',
|
||||
'free_balance.require' => '冻结余额不能为空',
|
||||
'fa_supply_team_id.require' => '所属后台供应链团队ID不能为空',
|
||||
];
|
||||
}
|
24
app/admin/validate/SupplyBrokerageValidate.php
Normal file
24
app/admin/validate/SupplyBrokerageValidate.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2021 勾股工作室
|
||||
* @license https://opensource.org/licenses/Apache-2.0
|
||||
* @link https://www.gougucms.com
|
||||
*/
|
||||
|
||||
namespace app\admin\validate;
|
||||
use think\Validate;
|
||||
|
||||
class SupplyBrokerageValidate extends Validate
|
||||
{
|
||||
protected $rule = [
|
||||
'mer_id' => 'require',
|
||||
'fa_supply_chain_id' => 'require',
|
||||
'order_sn' => 'require',
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
'mer_id.require' => '商户 id不能为空',
|
||||
'fa_supply_chain_id.require' => '供应链团队id不能为空',
|
||||
'order_sn.require' => '订单编号不能为空',
|
||||
];
|
||||
}
|
22
app/admin/validate/SupplyLevelValidate.php
Normal file
22
app/admin/validate/SupplyLevelValidate.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2021 勾股工作室
|
||||
* @license https://opensource.org/licenses/Apache-2.0
|
||||
* @link https://www.gougucms.com
|
||||
*/
|
||||
|
||||
namespace app\admin\validate;
|
||||
use think\Validate;
|
||||
|
||||
class SupplyLevelValidate extends Validate
|
||||
{
|
||||
protected $rule = [
|
||||
'name' => 'require',
|
||||
'rate' => 'require',
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
'name.require' => '角色名称不能为空',
|
||||
'rate.require' => '分佣比例不能为空',
|
||||
];
|
||||
}
|
36
app/admin/validate/SupplyTeamValidate.php
Normal file
36
app/admin/validate/SupplyTeamValidate.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2021 勾股工作室
|
||||
* @license https://opensource.org/licenses/Apache-2.0
|
||||
* @link https://www.gougucms.com
|
||||
*/
|
||||
|
||||
namespace app\admin\validate;
|
||||
use think\Validate;
|
||||
|
||||
class SupplyTeamValidate extends Validate
|
||||
{
|
||||
protected $rule = [
|
||||
'name' => 'require',
|
||||
'lng' => 'require',
|
||||
'lat' => 'require',
|
||||
'area_id' => 'require',
|
||||
'brokerage' => 'require',
|
||||
'withdraw_brokerage' => 'require',
|
||||
'free_brokerage' => 'require',
|
||||
'supply_level_id' => 'require',
|
||||
'user_id' => 'require',
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
'name.require' => '后台供应链团队分组名称不能为空',
|
||||
'lng.require' => '经度不能为空',
|
||||
'lat.require' => '维度不能为空',
|
||||
'area_id.require' => '区县ID不能为空',
|
||||
'brokerage.require' => '团队分佣金额不能为空',
|
||||
'withdraw_brokerage.require' => '团队分佣已提现金额不能为空',
|
||||
'free_brokerage.require' => '分佣冻结金额不能为空',
|
||||
'supply_level_id.require' => '团队所属等级不能为空',
|
||||
'user_id.require' => '团队后台负责人ID不能为空',
|
||||
];
|
||||
}
|
62
app/admin/view/supply_account/add.html
Normal file
62
app/admin/view/supply_account/add.html
Normal file
@ -0,0 +1,62 @@
|
||||
{extend name="common/base"/}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<form class="layui-form p-4">
|
||||
<h3 class="pb-3">新建供应链团队角色提现账户信息</h3>
|
||||
<table class="layui-table layui-table-form">
|
||||
<tr><td class="layui-td-gray-2">账号<font>*</font></td>
|
||||
<td><input type="text" name="account" lay-verify="required" lay-reqText="请完善账号" value="" autocomplete="off" placeholder="请输入账号" class="layui-input"></td><td class="layui-td-gray-2">用户名<font>*</font></td>
|
||||
<td><input type="text" name="name" lay-verify="required" lay-reqText="请完善用户名" value="" autocomplete="off" placeholder="请输入用户名" class="layui-input"></td><td class="layui-td-gray-2">开户行<font>*</font></td>
|
||||
<td><input type="text" name="bank" lay-verify="required" lay-reqText="请完善开户行" value="" autocomplete="off" placeholder="请输入开户行" class="layui-input"></td>
|
||||
</tr>
|
||||
<tr><td class="layui-td-gray-2">已提现金额<font>*</font></td>
|
||||
<td><input type="text" name="amount" lay-verify="required" lay-reqText="请完善已提现金额" value="" autocomplete="off" placeholder="请输入已提现金额" class="layui-input"></td><td class="layui-td-gray-2">账户余额<font>*</font></td>
|
||||
<td><input type="text" name="balance" lay-verify="required" lay-reqText="请完善账户余额" value="" autocomplete="off" placeholder="请输入账户余额" class="layui-input"></td><td class="layui-td-gray-2">冻结余额<font>*</font></td>
|
||||
<td><input type="text" name="free_balance" lay-verify="required" lay-reqText="请完善冻结余额" value="" autocomplete="off" placeholder="请输入冻结余额" class="layui-input"></td>
|
||||
</tr>
|
||||
<tr><td class="layui-td-gray-2">所属后台供应链团队ID<font>*</font></td>
|
||||
<td>
|
||||
<select name="fa_supply_team_id" lay-verify="required" lay-reqText="请完善所属后台供应链团队ID">
|
||||
<option value="">请选择</option>
|
||||
{volist name='team' id='vo'}
|
||||
<option value="{$vo.id}" >{$vo.name}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</td><td colspan='4'></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="pt-3">
|
||||
<input type="hidden" name="id" value="0"/>
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||
</div>
|
||||
</form>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script>
|
||||
var moduleInit = ['tool'];
|
||||
|
||||
function gouguInit() {
|
||||
var form = layui.form, tool = layui.tool;
|
||||
|
||||
|
||||
|
||||
//监听提交
|
||||
form.on('submit(webform)', function (data) {
|
||||
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
tool.sideClose(1000);
|
||||
}
|
||||
}
|
||||
tool.post("/admin/supply_account/add", data.field, callback);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
148
app/admin/view/supply_account/datalist.html
Normal file
148
app/admin/view/supply_account/datalist.html
Normal file
@ -0,0 +1,148 @@
|
||||
{extend name="common/base"/}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
|
||||
<div class="p-3">
|
||||
<form class="layui-form gg-form-bar border-t border-x">
|
||||
<div class="layui-input-inline" style="width:300px;">
|
||||
<input type="text" name="keywords" placeholder="请输入关键字" class="layui-input" autocomplete="off" />
|
||||
</div>
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="searchform">提交搜索</button>
|
||||
</form>
|
||||
<table class="layui-hide" id="supply_account" lay-filter="supply_account"></table>
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="toolbarDemo">
|
||||
<div class="layui-btn-container">
|
||||
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加供应链团队角色提现账户信息">+ 添加供应链团队角色提现账户信息</span>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="barDemo">
|
||||
<div class="layui-btn-group"><a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a><a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a><a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a></div>
|
||||
</script>
|
||||
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script>
|
||||
const moduleInit = ['tool'];
|
||||
function gouguInit() {
|
||||
var table = layui.table,tool = layui.tool, form = layui.form;
|
||||
layui.pageTable = table.render({
|
||||
elem: '#supply_account',
|
||||
title: '供应链团队角色提现账户信息列表',
|
||||
toolbar: '#toolbarDemo',
|
||||
url: '/admin/supply_account/datalist',
|
||||
page: true,
|
||||
limit: 20,
|
||||
cellMinWidth: 300,
|
||||
cols: [
|
||||
[
|
||||
{
|
||||
fixed: 'left',
|
||||
field: 'id',
|
||||
title: '编号',
|
||||
align: 'center',
|
||||
width: 80
|
||||
},{
|
||||
field: 'account',
|
||||
title: '账号',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'name',
|
||||
title: '用户名',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'bank',
|
||||
title: '开户行',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'amount',
|
||||
title: '已提现金额',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'balance',
|
||||
title: '账户余额',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'free_balance',
|
||||
title: '冻结余额',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'fa_supply_team_id',
|
||||
title: '所属后台供应链团队ID',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
fixed: 'right',
|
||||
field: 'right',
|
||||
title: '操作',
|
||||
toolbar: '#barDemo',
|
||||
width: 136,
|
||||
align: 'center'
|
||||
}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
//监听表头工具栏事件
|
||||
table.on('toolbar(supply_account)', function(obj){
|
||||
if (obj.event === 'add') {
|
||||
tool.side("/admin/supply_account/add");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
//监听表格行工具事件
|
||||
table.on('tool(supply_account)', function(obj) {
|
||||
var data = obj.data;
|
||||
if (obj.event === 'read') {
|
||||
tool.side('/admin/supply_account/read?id='+obj.data.id);
|
||||
}
|
||||
else if (obj.event === 'edit') {
|
||||
tool.side('/admin/supply_account/edit?id='+obj.data.id);
|
||||
}
|
||||
else if (obj.event === 'del') {
|
||||
layer.confirm('确定要删除该记录吗?', {
|
||||
icon: 3,
|
||||
title: '提示'
|
||||
}, function(index) {
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
obj.del();
|
||||
}
|
||||
}
|
||||
tool.delete("/admin/supply_account/del", { id: data.id }, callback);
|
||||
layer.close(index);
|
||||
});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
//监听搜索提交
|
||||
form.on('submit(searchform)', function(data) {
|
||||
layui.pageTable.reload({
|
||||
where: {
|
||||
keywords: data.field.keywords
|
||||
},
|
||||
page: {
|
||||
curr: 1
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
62
app/admin/view/supply_account/edit.html
Normal file
62
app/admin/view/supply_account/edit.html
Normal file
@ -0,0 +1,62 @@
|
||||
{extend name="common/base"/}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<form class="layui-form p-4">
|
||||
<h3 class="pb-3">编辑供应链团队角色提现账户信息</h3>
|
||||
<table class="layui-table layui-table-form">
|
||||
<tr><td class="layui-td-gray-2">账号<font>*</font></td>
|
||||
<td><input type="text" name="account" lay-verify="required" lay-reqText="请完善账号" value="{$detail.account}" autocomplete="off" placeholder="请输入账号" class="layui-input"></td><td class="layui-td-gray-2">用户名<font>*</font></td>
|
||||
<td><input type="text" name="name" lay-verify="required" lay-reqText="请完善用户名" value="{$detail.name}" autocomplete="off" placeholder="请输入用户名" class="layui-input"></td><td class="layui-td-gray-2">开户行<font>*</font></td>
|
||||
<td><input type="text" name="bank" lay-verify="required" lay-reqText="请完善开户行" value="{$detail.bank}" autocomplete="off" placeholder="请输入开户行" class="layui-input"></td>
|
||||
</tr>
|
||||
<tr><td class="layui-td-gray-2">已提现金额<font>*</font></td>
|
||||
<td><input type="text" name="amount" lay-verify="required" lay-reqText="请完善已提现金额" value="{$detail.amount}" autocomplete="off" placeholder="请输入已提现金额" class="layui-input"></td><td class="layui-td-gray-2">账户余额<font>*</font></td>
|
||||
<td><input type="text" name="balance" lay-verify="required" lay-reqText="请完善账户余额" value="{$detail.balance}" autocomplete="off" placeholder="请输入账户余额" class="layui-input"></td><td class="layui-td-gray-2">冻结余额<font>*</font></td>
|
||||
<td><input type="text" name="free_balance" lay-verify="required" lay-reqText="请完善冻结余额" value="{$detail.free_balance}" autocomplete="off" placeholder="请输入冻结余额" class="layui-input"></td>
|
||||
</tr>
|
||||
<tr><td class="layui-td-gray-2">所属后台供应链团队ID<font>*</font></td>
|
||||
<td>
|
||||
<select name="fa_supply_team_id" lay-verify="required" lay-reqText="请完善所属后台供应链团队ID">
|
||||
<option value="">请选择</option>
|
||||
{volist name='team' id='vo'}
|
||||
<option value="{$vo.id}" {eq name="$detail.fa_supply_team_id" value="$vo.id"} selected{/eq}>{$vo.name}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</td><td colspan='4'></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="py-3">
|
||||
<input type="hidden" name="id" value="{$detail.id}"/>
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||
</div>
|
||||
</form>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script>
|
||||
var moduleInit = ['tool'];
|
||||
|
||||
function gouguInit() {
|
||||
var form = layui.form, tool = layui.tool;
|
||||
|
||||
|
||||
|
||||
//监听提交
|
||||
form.on('submit(webform)', function (data) {
|
||||
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
tool.sideClose(1000);
|
||||
}
|
||||
}
|
||||
tool.post("/admin/supply_account/edit", data.field, callback);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
28
app/admin/view/supply_account/read.html
Normal file
28
app/admin/view/supply_account/read.html
Normal file
@ -0,0 +1,28 @@
|
||||
{extend name="common/base"/}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<div class="layui-form p-4">
|
||||
<h3 class="pb-3">供应链团队角色提现账户信息详情</h3>
|
||||
<table class="layui-table layui-table-form">
|
||||
<tr><td class="layui-td-gray-2">账号</td>
|
||||
<td>{$detail.account}</td><td class="layui-td-gray-2">用户名</td>
|
||||
<td>{$detail.name}</td><td class="layui-td-gray-2">开户行</td>
|
||||
<td>{$detail.bank}</td>
|
||||
</tr><tr><td class="layui-td-gray-2">已提现金额</td>
|
||||
<td>{$detail.amount}</td><td class="layui-td-gray-2">账户余额</td>
|
||||
<td>{$detail.balance}</td><td class="layui-td-gray-2">冻结余额</td>
|
||||
<td>{$detail.free_balance}</td>
|
||||
</tr><tr><td class="layui-td-gray-2">所属后台供应链团队ID</td>
|
||||
<td>
|
||||
<select name="fa_supply_team_id" lay-verify="required" lay-reqText="请完善所属后台供应链团队ID">
|
||||
<option value="">请选择</option>
|
||||
{volist name='team' id='vo'}
|
||||
<option value="{$vo.id}" {eq name="$detail.fa_supply_team_id" value="$vo.id"} selected{/eq}>{$vo.name}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</td><td colspan='4'></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
45
app/admin/view/supply_brokerage/add.html
Normal file
45
app/admin/view/supply_brokerage/add.html
Normal file
@ -0,0 +1,45 @@
|
||||
{extend name="common/base"/}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<form class="layui-form p-4">
|
||||
<h3 class="pb-3">新建供应链团队佣金记录表</h3>
|
||||
<table class="layui-table layui-table-form">
|
||||
<tr><td class="layui-td-gray-2">供应链佣金流水号</td>
|
||||
<td><input type="text" name="supply_sn" value="" autocomplete="off" placeholder="请输入供应链佣金流水号" class="layui-input"></td><td colspan='4'></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="pt-3">
|
||||
<input type="hidden" name="id" value="0"/>
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||
</div>
|
||||
</form>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script>
|
||||
var moduleInit = ['tool'];
|
||||
|
||||
function gouguInit() {
|
||||
var form = layui.form, tool = layui.tool;
|
||||
|
||||
|
||||
|
||||
//监听提交
|
||||
form.on('submit(webform)', function (data) {
|
||||
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
tool.sideClose(1000);
|
||||
}
|
||||
}
|
||||
tool.post("/admin/supply_brokerage/add", data.field, callback);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
188
app/admin/view/supply_brokerage/datalist.html
Normal file
188
app/admin/view/supply_brokerage/datalist.html
Normal file
@ -0,0 +1,188 @@
|
||||
{extend name="common/base"/}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
|
||||
<div class="p-3">
|
||||
<form class="layui-form gg-form-bar border-t border-x">
|
||||
<div class="layui-input-inline" style="width:300px;">
|
||||
<input type="text" name="keywords" placeholder="请输入关键字" class="layui-input" autocomplete="off" />
|
||||
</div>
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="searchform">提交搜索</button>
|
||||
</form>
|
||||
<table class="layui-hide" id="supply_brokerage" lay-filter="supply_brokerage"></table>
|
||||
</div>
|
||||
|
||||
<!--<script type="text/html" id="toolbarDemo">-->
|
||||
<!-- <div class="layui-btn-container">-->
|
||||
<!-- <span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加供应链团队佣金记录表">+ 添加供应链团队佣金记录表</span>-->
|
||||
<!-- </div>-->
|
||||
<!--</script>-->
|
||||
|
||||
<script type="text/html" id="barDemo">
|
||||
<div class="layui-btn-group"><a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a><a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a></div>
|
||||
</script>
|
||||
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script>
|
||||
const moduleInit = ['tool'];
|
||||
function gouguInit() {
|
||||
var table = layui.table,tool = layui.tool, form = layui.form;
|
||||
layui.pageTable = table.render({
|
||||
elem: '#supply_brokerage',
|
||||
title: '供应链团队佣金记录表列表',
|
||||
toolbar: '#toolbarDemo',
|
||||
url: '/admin/supply_brokerage/datalist',
|
||||
page: true,
|
||||
limit: 20,
|
||||
cellMinWidth: 300,
|
||||
cols: [
|
||||
[
|
||||
{
|
||||
fixed: 'left',
|
||||
field: 'id',
|
||||
title: '编号',
|
||||
align: 'center',
|
||||
width: 80
|
||||
},{
|
||||
field: 'supply_sn',
|
||||
title: '供应链佣金流水号',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'mer_id',
|
||||
title: '商户',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'fa_supply_chain_id',
|
||||
title: '供应链团队',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'order_sn',
|
||||
title: '订单编号',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'order_id',
|
||||
title: '订单ID',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'user_info',
|
||||
title: '用户名',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'user_id',
|
||||
title: '小组服务用户ID',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'supply_userId',
|
||||
title: '供应链用户ID',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'pay_price',
|
||||
title: '订单金额',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'brokerage_price',
|
||||
title: '佣金金额',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'brokerage_rate',
|
||||
title: '分佣比例',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'status',
|
||||
title: '分佣状态',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'supply_level_id',
|
||||
title: '分佣等级',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'group_user',
|
||||
title: '用户组',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'create_time',
|
||||
title: '创建时间',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
fixed: 'right',
|
||||
field: 'right',
|
||||
title: '操作',
|
||||
toolbar: '#barDemo',
|
||||
width: 136,
|
||||
align: 'center'
|
||||
}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
//监听表头工具栏事件
|
||||
table.on('toolbar(supply_brokerage)', function(obj){
|
||||
if (obj.event === 'add') {
|
||||
tool.side("/admin/supply_brokerage/add");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
//监听表格行工具事件
|
||||
table.on('tool(supply_brokerage)', function(obj) {
|
||||
var data = obj.data;
|
||||
if (obj.event === 'read') {
|
||||
tool.side('/admin/supply_brokerage/read?id='+obj.data.id);
|
||||
}
|
||||
else if (obj.event === 'edit') {
|
||||
tool.side('/admin/supply_brokerage/edit?id='+obj.data.id);
|
||||
}
|
||||
else if (obj.event === 'del') {
|
||||
layer.confirm('确定要删除该记录吗?', {
|
||||
icon: 3,
|
||||
title: '提示'
|
||||
}, function(index) {
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
obj.del();
|
||||
}
|
||||
}
|
||||
tool.delete("/admin/supply_brokerage/del", { id: data.id }, callback);
|
||||
layer.close(index);
|
||||
});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
//监听搜索提交
|
||||
form.on('submit(searchform)', function(data) {
|
||||
layui.pageTable.reload({
|
||||
where: {
|
||||
keywords: data.field.keywords
|
||||
},
|
||||
page: {
|
||||
curr: 1
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
45
app/admin/view/supply_brokerage/edit.html
Normal file
45
app/admin/view/supply_brokerage/edit.html
Normal file
@ -0,0 +1,45 @@
|
||||
{extend name="common/base"/}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<form class="layui-form p-4">
|
||||
<h3 class="pb-3">编辑供应链团队佣金记录表</h3>
|
||||
<table class="layui-table layui-table-form">
|
||||
<tr><td class="layui-td-gray-2">供应链佣金流水号</td>
|
||||
<td><input type="text" name="supply_sn" value="{$detail.supply_sn}" autocomplete="off" placeholder="请输入供应链佣金流水号" class="layui-input"></td><td colspan='4'></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="py-3">
|
||||
<input type="hidden" name="id" value="{$detail.id}"/>
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||
</div>
|
||||
</form>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script>
|
||||
var moduleInit = ['tool'];
|
||||
|
||||
function gouguInit() {
|
||||
var form = layui.form, tool = layui.tool;
|
||||
|
||||
|
||||
|
||||
//监听提交
|
||||
form.on('submit(webform)', function (data) {
|
||||
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
tool.sideClose(1000);
|
||||
}
|
||||
}
|
||||
tool.post("/admin/supply_brokerage/edit", data.field, callback);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
31
app/admin/view/supply_brokerage/read.html
Normal file
31
app/admin/view/supply_brokerage/read.html
Normal file
@ -0,0 +1,31 @@
|
||||
{extend name="common/base"/}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<div class="layui-form p-4">
|
||||
<h3 class="pb-3">供应链团队佣金记录表详情</h3>
|
||||
<table class="layui-table layui-table-form">
|
||||
<tr><td class="layui-td-gray-2">供应链佣金流水号</td>
|
||||
<td>{$detail.supply_sn}</td><td class="layui-td-gray-2">商户 id</td>
|
||||
<td>{$detail.mer_id}</td><td class="layui-td-gray-2">供应链团队id</td>
|
||||
<td>{$detail.fa_supply_chain_id}</td>
|
||||
</tr><tr><td class="layui-td-gray-2">订单编号</td>
|
||||
<td>{$detail.order_sn}</td><td class="layui-td-gray-2">订单ID</td>
|
||||
<td>{$detail.order_id}</td><td class="layui-td-gray-2">用户名</td>
|
||||
<td>{$detail.user_info}</td>
|
||||
</tr><tr><td class="layui-td-gray-2">小组服务用户ID</td>
|
||||
<td>{$detail.user_id}</td><td class="layui-td-gray-2">供应链用户ID</td>
|
||||
<td>{$detail.supply_userId}</td><td class="layui-td-gray-2">订单金额</td>
|
||||
<td>{$detail.pay_price}</td>
|
||||
</tr><tr><td class="layui-td-gray-2">佣金金额</td>
|
||||
<td>{$detail.brokerage_price}</td><td class="layui-td-gray-2">分佣比例</td>
|
||||
<td>{$detail.brokerage_rate}</td><td class="layui-td-gray-2">分佣状态</td>
|
||||
<td>{$detail.status}</td>
|
||||
</tr><tr><td class="layui-td-gray-2">分佣等级</td>
|
||||
<td>{$detail.supply_level_id}</td><td class="layui-td-gray-2">用户组</td>
|
||||
<td>{$detail.group_user}</td><td class="layui-td-gray-2">创建时间</td>
|
||||
<td>{$detail.create_time}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
46
app/admin/view/supply_level/add.html
Normal file
46
app/admin/view/supply_level/add.html
Normal file
@ -0,0 +1,46 @@
|
||||
{extend name="common/base"/}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<form class="layui-form p-4">
|
||||
<h3 class="pb-3">新建供应链团队角色</h3>
|
||||
<table class="layui-table layui-table-form">
|
||||
<tr><td class="layui-td-gray-2">角色名称<font>*</font></td>
|
||||
<td><input type="text" name="name" lay-verify="required" lay-reqText="请完善角色名称" value="" autocomplete="off" placeholder="请输入角色名称" class="layui-input"></td><td class="layui-td-gray-2">分佣比例<font>*</font></td>
|
||||
<td><input type="text" name="rate" lay-verify="required" lay-reqText="请完善分佣比例" value="" autocomplete="off" placeholder="请输入分佣比例" class="layui-input"></td><td colspan='2'></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="pt-3">
|
||||
<input type="hidden" name="id" value="0"/>
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||
</div>
|
||||
</form>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script>
|
||||
var moduleInit = ['tool'];
|
||||
|
||||
function gouguInit() {
|
||||
var form = layui.form, tool = layui.tool;
|
||||
|
||||
|
||||
|
||||
//监听提交
|
||||
form.on('submit(webform)', function (data) {
|
||||
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
tool.sideClose(1000);
|
||||
}
|
||||
}
|
||||
tool.post("/admin/supply_level/add", data.field, callback);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
123
app/admin/view/supply_level/datalist.html
Normal file
123
app/admin/view/supply_level/datalist.html
Normal file
@ -0,0 +1,123 @@
|
||||
{extend name="common/base"/}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
|
||||
<div class="p-3">
|
||||
<form class="layui-form gg-form-bar border-t border-x">
|
||||
<div class="layui-input-inline" style="width:300px;">
|
||||
<input type="text" name="keywords" placeholder="请输入关键字" class="layui-input" autocomplete="off" />
|
||||
</div>
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="searchform">提交搜索</button>
|
||||
</form>
|
||||
<table class="layui-hide" id="supply_level" lay-filter="supply_level"></table>
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="toolbarDemo">
|
||||
<div class="layui-btn-container">
|
||||
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加供应链团队角色">+ 添加供应链团队角色</span>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="barDemo">
|
||||
<div class="layui-btn-group"><a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a><a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a><a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a></div>
|
||||
</script>
|
||||
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script>
|
||||
const moduleInit = ['tool'];
|
||||
function gouguInit() {
|
||||
var table = layui.table,tool = layui.tool, form = layui.form;
|
||||
layui.pageTable = table.render({
|
||||
elem: '#supply_level',
|
||||
title: '供应链团队角色列表',
|
||||
toolbar: '#toolbarDemo',
|
||||
url: '/admin/supply_level/datalist',
|
||||
page: true,
|
||||
limit: 20,
|
||||
cellMinWidth: 300,
|
||||
cols: [
|
||||
[
|
||||
{
|
||||
fixed: 'left',
|
||||
field: 'id',
|
||||
title: '编号',
|
||||
align: 'center',
|
||||
width: 80
|
||||
},{
|
||||
field: 'name',
|
||||
title: '角色名称',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'rate',
|
||||
title: '分佣比例',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
fixed: 'right',
|
||||
field: 'right',
|
||||
title: '操作',
|
||||
toolbar: '#barDemo',
|
||||
width: 136,
|
||||
align: 'center'
|
||||
}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
//监听表头工具栏事件
|
||||
table.on('toolbar(supply_level)', function(obj){
|
||||
if (obj.event === 'add') {
|
||||
tool.side("/admin/supply_level/add");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
//监听表格行工具事件
|
||||
table.on('tool(supply_level)', function(obj) {
|
||||
var data = obj.data;
|
||||
if (obj.event === 'read') {
|
||||
tool.side('/admin/supply_level/read?id='+obj.data.id);
|
||||
}
|
||||
else if (obj.event === 'edit') {
|
||||
tool.side('/admin/supply_level/edit?id='+obj.data.id);
|
||||
}
|
||||
else if (obj.event === 'del') {
|
||||
layer.confirm('确定要删除该记录吗?', {
|
||||
icon: 3,
|
||||
title: '提示'
|
||||
}, function(index) {
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
obj.del();
|
||||
}
|
||||
}
|
||||
tool.delete("/admin/supply_level/del", { id: data.id }, callback);
|
||||
layer.close(index);
|
||||
});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
//监听搜索提交
|
||||
form.on('submit(searchform)', function(data) {
|
||||
layui.pageTable.reload({
|
||||
where: {
|
||||
keywords: data.field.keywords
|
||||
},
|
||||
page: {
|
||||
curr: 1
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
46
app/admin/view/supply_level/edit.html
Normal file
46
app/admin/view/supply_level/edit.html
Normal file
@ -0,0 +1,46 @@
|
||||
{extend name="common/base"/}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<form class="layui-form p-4">
|
||||
<h3 class="pb-3">编辑供应链团队角色</h3>
|
||||
<table class="layui-table layui-table-form">
|
||||
<tr><td class="layui-td-gray-2">角色名称<font>*</font></td>
|
||||
<td><input type="text" name="name" lay-verify="required" lay-reqText="请完善角色名称" value="{$detail.name}" autocomplete="off" placeholder="请输入角色名称" class="layui-input"></td><td class="layui-td-gray-2">分佣比例<font>*</font></td>
|
||||
<td><input type="text" name="rate" lay-verify="required" lay-reqText="请完善分佣比例" value="{$detail.rate}" autocomplete="off" placeholder="请输入分佣比例" class="layui-input"></td><td colspan='2'></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="py-3">
|
||||
<input type="hidden" name="id" value="{$detail.id}"/>
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||
</div>
|
||||
</form>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script>
|
||||
var moduleInit = ['tool'];
|
||||
|
||||
function gouguInit() {
|
||||
var form = layui.form, tool = layui.tool;
|
||||
|
||||
|
||||
|
||||
//监听提交
|
||||
form.on('submit(webform)', function (data) {
|
||||
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
tool.sideClose(1000);
|
||||
}
|
||||
}
|
||||
tool.post("/admin/supply_level/edit", data.field, callback);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
14
app/admin/view/supply_level/read.html
Normal file
14
app/admin/view/supply_level/read.html
Normal file
@ -0,0 +1,14 @@
|
||||
{extend name="common/base"/}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<div class="layui-form p-4">
|
||||
<h3 class="pb-3">供应链团队角色详情</h3>
|
||||
<table class="layui-table layui-table-form">
|
||||
<tr><td class="layui-td-gray-2">角色名称</td>
|
||||
<td>{$detail.name}</td><td class="layui-td-gray-2">分佣比例</td>
|
||||
<td>{$detail.rate}</td><td colspan='2'></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
83
app/admin/view/supply_team/add.html
Normal file
83
app/admin/view/supply_team/add.html
Normal file
@ -0,0 +1,83 @@
|
||||
{extend name="common/base"/}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<form class="layui-form p-4">
|
||||
<h3 class="pb-3">新建供应链分组</h3>
|
||||
<table class="layui-table layui-table-form">
|
||||
<tr><td class="layui-td-gray-2">后台供应链团队分组名称<font>*</font></td>
|
||||
<td><input type="text" name="name" lay-verify="required" lay-reqText="请完善后台供应链团队分组名称" value="" autocomplete="off" placeholder="请输入后台供应链团队分组名称" class="layui-input"></td><td class="layui-td-gray-2">经度<font>*</font></td>
|
||||
<td><input type="text" name="lng" lay-verify="required" lay-reqText="请完善经度" value="" autocomplete="off" placeholder="请输入经度" class="layui-input"></td><td class="layui-td-gray-2">维度<font>*</font></td>
|
||||
<td><input type="text" name="lat" lay-verify="required" lay-reqText="请完善维度" value="" autocomplete="off" placeholder="请输入维度" class="layui-input"></td>
|
||||
</tr>
|
||||
<tr><td class="layui-td-gray-2">区县ID<font>*</font></td>
|
||||
<td>
|
||||
<select name="area_id" lay-verify="required" lay-reqText="请完善区县ID">
|
||||
<option value="">请选择</option>
|
||||
{volist name='geo_area' id='vo'}
|
||||
<option value="{$vo.area_id}" >{$vo.area_name}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</td><td class="layui-td-gray-2">团队分佣金额<font>*</font></td>
|
||||
<td><input type="text" name="brokerage" lay-verify="required" lay-reqText="请完善团队分佣金额" value="" autocomplete="off" placeholder="请输入团队分佣金额" class="layui-input"></td><td class="layui-td-gray-2">团队分佣已提现金额<font>*</font></td>
|
||||
<td><input type="text" name="withdraw_brokerage" lay-verify="required" lay-reqText="请完善团队分佣已提现金额" value="" autocomplete="off" placeholder="请输入团队分佣已提现金额" class="layui-input"></td>
|
||||
</tr>
|
||||
<tr><td class="layui-td-gray-2">分佣冻结金额<font>*</font></td>
|
||||
<td><input type="text" name="free_brokerage" lay-verify="required" lay-reqText="请完善分佣冻结金额" value="" autocomplete="off" placeholder="请输入分佣冻结金额" class="layui-input"></td>
|
||||
|
||||
<td class="layui-td-gray-2">团队所属等级<font>*</font></td>
|
||||
<td>
|
||||
|
||||
<select name="supply_level_id" lay-verify="required" lay-reqText="请完善团队所属等级">
|
||||
<option value="">请选择</option>
|
||||
{volist name='level' id='vo'}
|
||||
<option value="{$vo.id}" >{$vo.name}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</td>
|
||||
<td class="layui-td-gray-2">团队后台负责人ID<font>*</font></td>
|
||||
<td>
|
||||
<select name="user_id" lay-verify="required" lay-reqText="请完善团队后台负责人ID">
|
||||
<option value="">请选择</option>
|
||||
{volist name='users' id='vo'}
|
||||
<option value="{$vo.user_id}" >{$vo.name}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<div class="pt-3">
|
||||
<input type="hidden" name="id" value="0"/>
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||
</div>
|
||||
</form>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script>
|
||||
var moduleInit = ['tool'];
|
||||
|
||||
function gouguInit() {
|
||||
var form = layui.form, tool = layui.tool;
|
||||
|
||||
|
||||
|
||||
//监听提交
|
||||
form.on('submit(webform)', function (data) {
|
||||
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
tool.sideClose(1000);
|
||||
}
|
||||
}
|
||||
tool.post("/admin/supply_team/add", data.field, callback);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
158
app/admin/view/supply_team/datalist.html
Normal file
158
app/admin/view/supply_team/datalist.html
Normal file
@ -0,0 +1,158 @@
|
||||
{extend name="common/base"/}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
|
||||
<div class="p-3">
|
||||
<form class="layui-form gg-form-bar border-t border-x">
|
||||
<div class="layui-input-inline" style="width:300px;">
|
||||
<input type="text" name="keywords" placeholder="请输入关键字" class="layui-input" autocomplete="off" />
|
||||
</div>
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="searchform">提交搜索</button>
|
||||
</form>
|
||||
<table class="layui-hide" id="supply_team" lay-filter="supply_team"></table>
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="toolbarDemo">
|
||||
<div class="layui-btn-container">
|
||||
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加供应链分组">+ 添加供应链分组</span>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="barDemo">
|
||||
<div class="layui-btn-group"><a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a><a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a><a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a></div>
|
||||
</script>
|
||||
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script>
|
||||
const moduleInit = ['tool'];
|
||||
function gouguInit() {
|
||||
var table = layui.table,tool = layui.tool, form = layui.form;
|
||||
layui.pageTable = table.render({
|
||||
elem: '#supply_team',
|
||||
title: '供应链分组列表',
|
||||
toolbar: '#toolbarDemo',
|
||||
url: '/admin/supply_team/datalist',
|
||||
page: true,
|
||||
limit: 20,
|
||||
cellMinWidth: 300,
|
||||
cols: [
|
||||
[
|
||||
{
|
||||
fixed: 'left',
|
||||
field: 'id',
|
||||
title: '编号',
|
||||
align: 'center',
|
||||
width: 80
|
||||
},{
|
||||
field: 'name',
|
||||
title: '后台供应链团队分组名称',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'lng',
|
||||
title: '经度',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'lat',
|
||||
title: '维度',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'area_id',
|
||||
title: '区县ID',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'brokerage',
|
||||
title: '团队分佣金额',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'withdraw_brokerage',
|
||||
title: '团队分佣已提现金额',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'free_brokerage',
|
||||
title: '分佣冻结金额',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'supply_level_id',
|
||||
title: '团队所属等级',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'user_id',
|
||||
title: '团队后台负责人ID',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
fixed: 'right',
|
||||
field: 'right',
|
||||
title: '操作',
|
||||
toolbar: '#barDemo',
|
||||
width: 136,
|
||||
align: 'center'
|
||||
}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
//监听表头工具栏事件
|
||||
table.on('toolbar(supply_team)', function(obj){
|
||||
if (obj.event === 'add') {
|
||||
tool.side("/admin/supply_team/add");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
//监听表格行工具事件
|
||||
table.on('tool(supply_team)', function(obj) {
|
||||
var data = obj.data;
|
||||
if (obj.event === 'read') {
|
||||
tool.side('/admin/supply_team/read?id='+obj.data.id);
|
||||
}
|
||||
else if (obj.event === 'edit') {
|
||||
tool.side('/admin/supply_team/edit?id='+obj.data.id);
|
||||
}
|
||||
else if (obj.event === 'del') {
|
||||
layer.confirm('确定要删除该记录吗?', {
|
||||
icon: 3,
|
||||
title: '提示'
|
||||
}, function(index) {
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
obj.del();
|
||||
}
|
||||
}
|
||||
tool.delete("/admin/supply_team/del", { id: data.id }, callback);
|
||||
layer.close(index);
|
||||
});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
//监听搜索提交
|
||||
form.on('submit(searchform)', function(data) {
|
||||
layui.pageTable.reload({
|
||||
where: {
|
||||
keywords: data.field.keywords
|
||||
},
|
||||
page: {
|
||||
curr: 1
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
79
app/admin/view/supply_team/edit.html
Normal file
79
app/admin/view/supply_team/edit.html
Normal file
@ -0,0 +1,79 @@
|
||||
{extend name="common/base"/}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<form class="layui-form p-4">
|
||||
<h3 class="pb-3">编辑供应链分组</h3>
|
||||
<table class="layui-table layui-table-form">
|
||||
<tr><td class="layui-td-gray-2">后台供应链团队分组名称<font>*</font></td>
|
||||
<td><input type="text" name="name" lay-verify="required" lay-reqText="请完善后台供应链团队分组名称" value="{$detail.name}" autocomplete="off" placeholder="请输入后台供应链团队分组名称" class="layui-input"></td><td class="layui-td-gray-2">经度<font>*</font></td>
|
||||
<td><input type="text" name="lng" lay-verify="required" lay-reqText="请完善经度" value="{$detail.lng}" autocomplete="off" placeholder="请输入经度" class="layui-input"></td><td class="layui-td-gray-2">维度<font>*</font></td>
|
||||
<td><input type="text" name="lat" lay-verify="required" lay-reqText="请完善维度" value="{$detail.lat}" autocomplete="off" placeholder="请输入维度" class="layui-input"></td>
|
||||
</tr>
|
||||
<tr><td class="layui-td-gray-2">区县ID<font>*</font></td>
|
||||
<td>
|
||||
<select name="area_id" lay-verify="required" lay-reqText="请完善区县ID">
|
||||
{volist name='geo_area' id='vo'}
|
||||
<option value="{$vo.area_id}" {eq name="$detail.area_id" value="$vo.area_id"} selected{/eq}>{$vo.area_name}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</td><td class="layui-td-gray-2">团队分佣金额<font>*</font></td>
|
||||
<td><input type="text" name="brokerage" lay-verify="required" lay-reqText="请完善团队分佣金额" value="{$detail.brokerage}" autocomplete="off" placeholder="请输入团队分佣金额" class="layui-input"></td><td class="layui-td-gray-2">团队分佣已提现金额<font>*</font></td>
|
||||
<td><input type="text" name="withdraw_brokerage" lay-verify="required" lay-reqText="请完善团队分佣已提现金额" value="{$detail.withdraw_brokerage}" autocomplete="off" placeholder="请输入团队分佣已提现金额" class="layui-input"></td>
|
||||
</tr>
|
||||
<tr><td class="layui-td-gray-2">分佣冻结金额<font>*</font></td>
|
||||
<td><input type="text" name="free_brokerage" lay-verify="required" lay-reqText="请完善分佣冻结金额" value="{$detail.free_brokerage}" autocomplete="off" placeholder="请输入分佣冻结金额" class="layui-input"></td>
|
||||
<td class="layui-td-gray-2">团队所属等级<font>*</font></td>
|
||||
<td>
|
||||
<select name="supply_level_id" lay-verify="required" lay-reqText="请完善团队所属等级">
|
||||
<option value="">请选择</option>
|
||||
{volist name='level' id='vo'}
|
||||
<option value="{$vo.id}" {eq name="$detail.supply_level_id" value="$vo.id"} selected{/eq}>{$vo.name}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</td>
|
||||
<td class="layui-td-gray-2">团队后台负责人ID<font>*</font></td>
|
||||
<td>
|
||||
<select name="user_id" lay-verify="required" lay-reqText="请完善团队后台负责人ID">
|
||||
{volist name='users' id='vo'}
|
||||
<option value="{$vo.user_id}" {eq name="$detail.user_id" value="$vo.user_id"} selected{/eq}>{$vo.name}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<div class="py-3">
|
||||
<input type="hidden" name="id" value="{$detail.id}"/>
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||
</div>
|
||||
</form>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script>
|
||||
var moduleInit = ['tool'];
|
||||
|
||||
function gouguInit() {
|
||||
var form = layui.form, tool = layui.tool;
|
||||
|
||||
|
||||
|
||||
//监听提交
|
||||
form.on('submit(webform)', function (data) {
|
||||
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
tool.sideClose(1000);
|
||||
}
|
||||
}
|
||||
tool.post("/admin/supply_team/edit", data.field, callback);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
44
app/admin/view/supply_team/read.html
Normal file
44
app/admin/view/supply_team/read.html
Normal file
@ -0,0 +1,44 @@
|
||||
{extend name="common/base"/}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<div class="layui-form p-4">
|
||||
<h3 class="pb-3">供应链分组详情</h3>
|
||||
<table class="layui-table layui-table-form">
|
||||
<tr><td class="layui-td-gray-2">后台供应链团队分组名称</td>
|
||||
<td>{$detail.name}</td><td class="layui-td-gray-2">经度</td>
|
||||
<td>{$detail.lng}</td><td class="layui-td-gray-2">维度</td>
|
||||
<td>{$detail.lat}</td>
|
||||
</tr><tr><td class="layui-td-gray-2">区县ID</td>
|
||||
<td>
|
||||
<select name="area_id" lay-verify="required" lay-reqText="请完善区县ID">
|
||||
{volist name='geo_area' id='vo'}
|
||||
<option value="{$vo.area_id}" {eq name="$detail.area_id" value="$vo.area_id"} selected{/eq}>{$vo.area_name}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</td><td class="layui-td-gray-2">团队分佣金额</td>
|
||||
<td>{$detail.brokerage}</td><td class="layui-td-gray-2">团队分佣已提现金额</td>
|
||||
<td>{$detail.withdraw_brokerage}</td>
|
||||
</tr><tr><td class="layui-td-gray-2">分佣冻结金额</td>
|
||||
<td>{$detail.free_brokerage}</td>
|
||||
<td class="layui-td-gray-2">团队所属等级</td>
|
||||
<td>
|
||||
<select name="supply_level_id" lay-verify="required" lay-reqText="请完善团队所属等级">
|
||||
<option value="">请选择</option>
|
||||
{volist name='level' id='vo'}
|
||||
<option value="{$vo.id}" {eq name="$detail.supply_level_id" value="$vo.id"} selected{/eq}>{$vo.name}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</td>
|
||||
<td class="layui-td-gray-2">团队后台负责人ID</td>
|
||||
<td>
|
||||
<select name="user_id" lay-verify="required" lay-reqText="请完善团队后台负责人ID">
|
||||
{volist name='users' id='vo'}
|
||||
<option value="{$vo.user_id}" {eq name="$detail.user_id" value="$vo.user_id"} selected{/eq}>{$vo.name}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
Loading…
x
Reference in New Issue
Block a user