合并
This commit is contained in:
commit
3ac2567f06
56
.env.debug
56
.env.debug
@ -4,4 +4,58 @@ APP_DEBUG = true
|
||||
DEFAULT_TIMEZONE = Asia/Shanghai
|
||||
|
||||
[LANG]
|
||||
default_lang = zh-cn
|
||||
default_lang = zh-cn
|
||||
|
||||
[DATABASE]
|
||||
TYPE = mysql
|
||||
HOSTNAME = 47.92.112.123
|
||||
DATABASE = nk_lihaink_cn
|
||||
PREFIX = cms_
|
||||
USERNAME = nk_lihaink_cn
|
||||
PASSWORD = 5MnmkZTW2tmahha7
|
||||
HOSTPORT = 3306
|
||||
CHARSET = utf8mb4
|
||||
DEBUG = true
|
||||
|
||||
TYPE = mysql
|
||||
HOSTNAME = 47.92.112.123
|
||||
DATABASE = nk_lihaink_cn
|
||||
PREFIX = cms_
|
||||
USERNAME = view_oa_lihaink_cn
|
||||
PASSWORD = 5MnmkZTW2tmahha7
|
||||
HOSTPORT = 3306
|
||||
CHARSET = utf8mb4
|
||||
DEBUG = true
|
||||
|
||||
[DATABASE]
|
||||
TYPE = mysql
|
||||
HOSTNAME = 47.92.112.123
|
||||
DATABASE = nk_lihaink_cn
|
||||
PREFIX = cms_
|
||||
USERNAME = view_oa_lihaink_cn
|
||||
PASSWORD = 5MnmkZTW2tmahha7
|
||||
HOSTPORT = 3306
|
||||
CHARSET = utf8mb4
|
||||
DEBUG = true
|
||||
|
||||
[DATABASESHOP]
|
||||
TYPE = mysql
|
||||
HOSTNAME = 47.108.186.87
|
||||
HOSTPORT = 3306
|
||||
USERNAME = shop_lihaink_com
|
||||
PASSWORD = EeYym2PFctFfrMde
|
||||
DATABASE = shop_lihaink_com
|
||||
PREFIX = eb_
|
||||
CHARSET = utf8
|
||||
DEBUG = true
|
||||
|
||||
[DATABASESHOP]
|
||||
TYPE = mysql
|
||||
HOSTNAME = 122.9.139.134
|
||||
HOSTPORT = 3306
|
||||
USERNAME = shop_lihaink_com
|
||||
PASSWORD = EeYym2PFctFfrMde
|
||||
DATABASE = shop_lihaink_com
|
||||
PREFIX = eb_
|
||||
CHARSET = utf8
|
||||
DEBUG = true
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -3,6 +3,7 @@
|
||||
/.gitee
|
||||
*.log
|
||||
*.env
|
||||
*.env.debug
|
||||
*.lock
|
||||
*.ini
|
||||
.htaccess
|
||||
@ -14,3 +15,5 @@
|
||||
/public/static/home/dev
|
||||
/public/static/home/oa
|
||||
/config/database.php
|
||||
/public/.htaccess
|
||||
/public/nginx.htaccess
|
||||
|
@ -146,6 +146,8 @@ class Admin extends BaseController
|
||||
View::assign('department', $department);
|
||||
View::assign('position', $position);
|
||||
View::assign('id', $id);
|
||||
$team = Db::table('fa_supply_team')->select();
|
||||
View::assign('team', $team);
|
||||
return view();
|
||||
}
|
||||
}
|
||||
|
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 = 1;
|
||||
|
||||
$this->model->delSupplyAccountById($id,$type);
|
||||
}
|
||||
}
|
144
app/admin/controller/SupplyBrokerage.php
Normal file
144
app/admin/controller/SupplyBrokerage.php
Normal file
@ -0,0 +1,144 @@
|
||||
<?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');
|
||||
$list[$k]['supply_userId'] = Db::table('cms_admin')->where('id',$v['supply_userId'])->value('nickname');
|
||||
|
||||
}
|
||||
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 = 1;
|
||||
|
||||
$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 = 1;
|
||||
|
||||
$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 = 1;
|
||||
|
||||
$this->model->delSupplyTeamById($id,$type);
|
||||
}
|
||||
}
|
149
app/admin/controller/UserExtract.php
Normal file
149
app/admin/controller/UserExtract.php
Normal file
@ -0,0 +1,149 @@
|
||||
<?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\UserExtract as UserExtractModel;
|
||||
use app\admin\validate\UserExtractValidate;
|
||||
use think\exception\ValidateException;
|
||||
use think\facade\Db;
|
||||
use think\facade\View;
|
||||
|
||||
class UserExtract extends BaseController
|
||||
|
||||
{
|
||||
/**
|
||||
* 构造函数
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->model = new UserExtractModel();
|
||||
$this->uid = get_login_admin('id');
|
||||
}
|
||||
/**
|
||||
* 数据列表
|
||||
*/
|
||||
public function datalist()
|
||||
{
|
||||
if (request()->isAjax()) {
|
||||
$param = get_params();
|
||||
$where = [];
|
||||
|
||||
$list = $this->model->getUserExtractList($where,$param);
|
||||
foreach ($list as $k =>$v){
|
||||
$list[$k]['uid'] = Db::connect('shop')->table('eb_user')->where('uid',$v['uid'])->value('nickname');
|
||||
if($v['extract_type'] == 0){
|
||||
$list[$k]['extract_type'] = '银行卡';
|
||||
}
|
||||
if($v['extract_type'] == 1){
|
||||
$list[$k]['extract_type'] = '支付宝';
|
||||
}
|
||||
if($v['extract_type'] == 2){
|
||||
$list[$k]['extract_type'] = '微信';
|
||||
}
|
||||
if($v['extract_type'] == 3){
|
||||
$list[$k]['extract_type'] = '零钱';
|
||||
}
|
||||
|
||||
$list[$k]['admin_id'] = Db::connect('shop')->table('eb_system_admin')->where('admin_id',$v['admin_id'])->value('real_name');
|
||||
|
||||
}
|
||||
return table_assign(0, '', $list);
|
||||
}
|
||||
else{
|
||||
return view();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if (request()->isAjax()) {
|
||||
$param = get_params();
|
||||
|
||||
// 检验完整性
|
||||
try {
|
||||
validate(UserExtractValidate::class)->check($param);
|
||||
} catch (ValidateException $e) {
|
||||
// 验证失败 输出错误信息
|
||||
return to_assign(1, $e->getError());
|
||||
}
|
||||
|
||||
$this->model->addUserExtract($param);
|
||||
}else{
|
||||
return view();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$param = get_params();
|
||||
|
||||
if (request()->isAjax()) {
|
||||
// 检验完整性
|
||||
try {
|
||||
validate(UserExtractValidate::class)->check($param);
|
||||
} catch (ValidateException $e) {
|
||||
// 验证失败 输出错误信息
|
||||
return to_assign(1, $e->getError());
|
||||
}
|
||||
|
||||
$this->model->editUserExtract($param);
|
||||
}else{
|
||||
$extract_id = isset($param['extract_id']) ? $param['extract_id'] : 0;
|
||||
$detail = $this->model->getUserExtractById($extract_id);
|
||||
if (!empty($detail)) {
|
||||
View::assign('detail', $detail);
|
||||
return view();
|
||||
}
|
||||
else{
|
||||
throw new \think\exception\HttpException(404, '找不到页面');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查看信息
|
||||
*/
|
||||
public function read()
|
||||
{
|
||||
$param = get_params();
|
||||
$extract_id = isset($param['extract_id']) ? $param['extract_id'] : 0;
|
||||
$detail = $this->model->getUserExtractById($extract_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();
|
||||
$extract_id = isset($param['extract_id']) ? $param['extract_id'] : 0;
|
||||
$type = 1;
|
||||
|
||||
$this->model->delUserExtractById($extract_id,$type);
|
||||
}
|
||||
}
|
77
app/admin/controller/merchant/system/Cache.php
Normal file
77
app/admin/controller/merchant/system/Cache.php
Normal file
@ -0,0 +1,77 @@
|
||||
<?php
|
||||
/**
|
||||
* 商城 cache 管理
|
||||
* 说明: 主要是一些说明、协议之类的文档管理
|
||||
*
|
||||
* @author:刘孝全
|
||||
* @email:q8197264@126.com
|
||||
* @date :2023年03月3日
|
||||
*/
|
||||
namespace app\admin\controller\merchant\system;
|
||||
|
||||
use app\admin\BaseController;
|
||||
use think\App;
|
||||
use app\common\model\merchant\system\Cache as CacheModel;
|
||||
|
||||
class Cache extends BaseController
|
||||
{
|
||||
protected $cache;
|
||||
|
||||
public function __construct(App $app, CacheModel $cache)
|
||||
{
|
||||
parent::__construct($app);
|
||||
$this->cache = $cache;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function getKeyLst()
|
||||
{
|
||||
$type = $this->request->param('type',0);
|
||||
$data = $this->cache->getAgreeList($type);
|
||||
|
||||
return to_assign(0,'',$data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getAgree($key)
|
||||
{
|
||||
$allow = $this->cache->getAgreeKey();
|
||||
if (!in_array($key, $allow)) return app('json')->fail('数据不存在');
|
||||
$data = $this->cache->getResult($key);
|
||||
|
||||
return to_assign(0,'success', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function saveAgree($key)
|
||||
{
|
||||
$allow = $this->cache->getAgreeKey();
|
||||
if (!in_array($key, $allow)) return app('json')->fail('KEY不存在');
|
||||
|
||||
$value = get_params('agree');
|
||||
$this->cache->saveCache($key, $value);
|
||||
|
||||
if ($key == CacheModel::USER_PRIVACY)
|
||||
$this->cache->setUserAgreement($value);
|
||||
if ($key == CacheModel::USER_AGREE)
|
||||
$this->cache->setUserRegister($value);
|
||||
|
||||
return to_assign(0, '保存成功');
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO 清除缓存
|
||||
* @return \think\response\Json
|
||||
*/
|
||||
public function clearCache()
|
||||
{
|
||||
return to_assign(0,'清除缓存成功');
|
||||
}
|
||||
}
|
@ -42,7 +42,7 @@ class Menu extends BaseController
|
||||
*/
|
||||
function Lst(){
|
||||
// 查出商户所有菜单数据
|
||||
$data = $this->menu->Search([], 1);
|
||||
$data = $this->menu->getList([], 1);
|
||||
|
||||
to_assign(0,'',$data['list']);
|
||||
}
|
||||
@ -62,9 +62,9 @@ class Menu extends BaseController
|
||||
View::assign('detail', $detail);
|
||||
}
|
||||
// 查出商户所有菜单数据
|
||||
$data = $this->menu->Search([], 1);
|
||||
$data = $this->menu->getList([], 1);
|
||||
$menus = $format->DropDownMenu($data['list']);
|
||||
|
||||
|
||||
View::assign('id', $id);
|
||||
View::assign('pid', $pid);
|
||||
View::assign('menus',$menus);
|
||||
|
@ -1,26 +1,30 @@
|
||||
<?php
|
||||
/**
|
||||
* 表单页面
|
||||
*
|
||||
*/
|
||||
namespace app\admin\controller\merchant\system;
|
||||
|
||||
use app\admin\BaseController;
|
||||
|
||||
class Merchant extends BaseController{
|
||||
|
||||
protected $model;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
function classify(){
|
||||
|
||||
}
|
||||
|
||||
public function system() {
|
||||
|
||||
}
|
||||
|
||||
<?php
|
||||
/**
|
||||
* @date :2023年03月2日
|
||||
* @author:刘孝全
|
||||
* @email:q8197264@126.com
|
||||
*
|
||||
* @ 商户管理
|
||||
*/
|
||||
namespace app\admin\controller\merchant\system;
|
||||
|
||||
use app\admin\BaseController;
|
||||
use app\common\model\merchant\system\merchant\Merchant as MerchantModel;
|
||||
|
||||
class Merchant extends BaseController{
|
||||
|
||||
protected $model;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
function classify(){
|
||||
|
||||
}
|
||||
|
||||
public function system() {
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -1,118 +1,118 @@
|
||||
<?php
|
||||
/**
|
||||
* @date :2023年03月2日
|
||||
* @author:刘孝全
|
||||
* @email:q8197264@126.com
|
||||
*
|
||||
* @ 商户入驻申请管理
|
||||
*/
|
||||
namespace app\admin\controller\merchant\system;
|
||||
|
||||
use app\admin\BaseController;
|
||||
use app\validate\merchant\MerchantApplymentsValidate;
|
||||
use app\admin\model\merchant\MerchantApplyments as MerchantApplymentsModel;
|
||||
|
||||
class MerchantApplyments extends BaseController
|
||||
{
|
||||
/**
|
||||
* @var MerchantModel
|
||||
*/
|
||||
protected $model;
|
||||
|
||||
/**
|
||||
* Merchant constructor.
|
||||
* @param App $app
|
||||
* @param MerchantRepository $repository
|
||||
*/
|
||||
function __construct(MerchantApplymentsModel $model){
|
||||
$this->model = $model;
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO 创建申请
|
||||
* @param MerchantApplymentsValidate $validate
|
||||
* @return \think\response\Json
|
||||
* @author Qinii
|
||||
* @day 6/22/21
|
||||
*/
|
||||
public function create(MerchantApplymentsValidate $validate)
|
||||
{
|
||||
// if(!systemConfig('open_wx_sub_mch')) return app('json')->fail('未开启子商户入驻');
|
||||
$data = $this->checkParams($validate);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO 创建申请
|
||||
* @param MerchantApplymentsValidate $validate
|
||||
* @return \think\response\Json
|
||||
* @author Qinii
|
||||
* @day 6/22/21
|
||||
*/
|
||||
public function detail()
|
||||
{}
|
||||
|
||||
/**
|
||||
* TODO 编辑提交
|
||||
* @param MerchantApplymentsValidate $validate
|
||||
* @return \think\response\Json
|
||||
* @author Qinii
|
||||
* @day 6/22/21
|
||||
*/
|
||||
public function update($id,MerchantApplymentsValidate $validate)
|
||||
{}
|
||||
|
||||
/**
|
||||
* TODO 查询更新状态
|
||||
* @param MerchantApplymentsValidate $validate
|
||||
* @return \think\response\Json
|
||||
* @author Qinii
|
||||
* @day 6/22/21
|
||||
*/
|
||||
public function check()
|
||||
{}
|
||||
|
||||
/**
|
||||
* TODO 上传图片
|
||||
* @param MerchantApplymentsValidate $validate
|
||||
* @return \think\response\Json
|
||||
* @author Qinii
|
||||
* @day 6/22/21
|
||||
*/
|
||||
public function uploadImage($field)
|
||||
{}
|
||||
|
||||
/**
|
||||
* TODO 检验参数
|
||||
* @param MerchantApplymentsValidate $validate
|
||||
* @return \think\response\Json
|
||||
* @author Qinii
|
||||
* @day 6/22/21
|
||||
*/
|
||||
public function checkParams(MerchantApplymentsValidate $validate)
|
||||
{
|
||||
//'organization_cert_info',
|
||||
$data = $this->request->params([
|
||||
'organization_type','business_license_info','id_doc_type','id_card_info','id_doc_info','need_account_info','account_info','contact_info','sales_scene_info','merchant_shortname','qualifications','business_addition_pics','business_addition_desc'
|
||||
]);
|
||||
|
||||
if($data['id_doc_type'] == 1){
|
||||
unset($data['id_doc_info']);
|
||||
}else{
|
||||
unset($data['id_card_info']);
|
||||
}
|
||||
|
||||
if(in_array($data['organization_type'],['2401','2500'])){
|
||||
unset($data['business_license_info']);
|
||||
}
|
||||
|
||||
if(isset($data['qualifications']) && !$data['qualifications']) unset($data['qualifications']);
|
||||
|
||||
if(isset($data['business_addition_pics']) && !$data['business_addition_pics']) unset($data['business_addition_pics']);
|
||||
if($data['organization_type'] !== 2 && isset($data['id_card_info']['id_card_address'])){
|
||||
unset($data['id_card_info']['id_card_address']);
|
||||
}
|
||||
$validate->check($data);
|
||||
return $data;
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* @date :2023年03月2日
|
||||
* @author:刘孝全
|
||||
* @email:q8197264@126.com
|
||||
*
|
||||
* @ 商户入驻申请管理
|
||||
*/
|
||||
namespace app\admin\controller\merchant\system\merchant;
|
||||
|
||||
use app\admin\BaseController;
|
||||
use app\validate\merchant\MerchantApplymentsValidate;
|
||||
use app\common\model\merchant\system\merchant\MerchantApplyments as MerchantApplymentsModel;
|
||||
|
||||
class MerchantApplyments extends BaseController
|
||||
{
|
||||
/**
|
||||
* @var MerchantModel
|
||||
*/
|
||||
protected $model;
|
||||
|
||||
/**
|
||||
* Merchant constructor.
|
||||
* @param App $app
|
||||
* @param MerchantRepository $repository
|
||||
*/
|
||||
function __construct(MerchantApplymentsModel $model){
|
||||
$this->model = $model;
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO 创建申请
|
||||
* @param MerchantApplymentsValidate $validate
|
||||
* @return \think\response\Json
|
||||
* @author Qinii
|
||||
* @day 6/22/21
|
||||
*/
|
||||
public function create(MerchantApplymentsValidate $validate)
|
||||
{
|
||||
// if(!systemConfig('open_wx_sub_mch')) return app('json')->fail('未开启子商户入驻');
|
||||
$data = $this->checkParams($validate);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO 创建申请
|
||||
* @param MerchantApplymentsValidate $validate
|
||||
* @return \think\response\Json
|
||||
* @author Qinii
|
||||
* @day 6/22/21
|
||||
*/
|
||||
public function detail()
|
||||
{}
|
||||
|
||||
/**
|
||||
* TODO 编辑提交
|
||||
* @param MerchantApplymentsValidate $validate
|
||||
* @return \think\response\Json
|
||||
* @author Qinii
|
||||
* @day 6/22/21
|
||||
*/
|
||||
public function update($id,MerchantApplymentsValidate $validate)
|
||||
{}
|
||||
|
||||
/**
|
||||
* TODO 查询更新状态
|
||||
* @param MerchantApplymentsValidate $validate
|
||||
* @return \think\response\Json
|
||||
* @author Qinii
|
||||
* @day 6/22/21
|
||||
*/
|
||||
public function check()
|
||||
{}
|
||||
|
||||
/**
|
||||
* TODO 上传图片
|
||||
* @param MerchantApplymentsValidate $validate
|
||||
* @return \think\response\Json
|
||||
* @author Qinii
|
||||
* @day 6/22/21
|
||||
*/
|
||||
public function uploadImage($field)
|
||||
{}
|
||||
|
||||
/**
|
||||
* TODO 检验参数
|
||||
* @param MerchantApplymentsValidate $validate
|
||||
* @return \think\response\Json
|
||||
* @author Qinii
|
||||
* @day 6/22/21
|
||||
*/
|
||||
public function checkParams(MerchantApplymentsValidate $validate)
|
||||
{
|
||||
//'organization_cert_info',
|
||||
$data = $this->request->params([
|
||||
'organization_type','business_license_info','id_doc_type','id_card_info','id_doc_info','need_account_info','account_info','contact_info','sales_scene_info','merchant_shortname','qualifications','business_addition_pics','business_addition_desc'
|
||||
]);
|
||||
|
||||
if($data['id_doc_type'] == 1){
|
||||
unset($data['id_doc_info']);
|
||||
}else{
|
||||
unset($data['id_card_info']);
|
||||
}
|
||||
|
||||
if(in_array($data['organization_type'],['2401','2500'])){
|
||||
unset($data['business_license_info']);
|
||||
}
|
||||
|
||||
if(isset($data['qualifications']) && !$data['qualifications']) unset($data['qualifications']);
|
||||
|
||||
if(isset($data['business_addition_pics']) && !$data['business_addition_pics']) unset($data['business_addition_pics']);
|
||||
if($data['organization_type'] !== 2 && isset($data['id_card_info']['id_card_address'])){
|
||||
unset($data['id_card_info']['id_card_address']);
|
||||
}
|
||||
$validate->check($data);
|
||||
return $data;
|
||||
}
|
||||
}
|
@ -0,0 +1,151 @@
|
||||
<?php
|
||||
/**
|
||||
* 店铺入驻申请审核管理
|
||||
*
|
||||
* @author:刘孝全
|
||||
* @email:q8197264@126.com
|
||||
* @date :2023年03月3日
|
||||
*/
|
||||
declare (strict_types = 1);
|
||||
|
||||
namespace app\admin\controller\merchant\system\merchant;
|
||||
|
||||
use app\admin\BaseController;
|
||||
use think\facade\Request;
|
||||
use app\common\model\merchant\system\merchant\MerchantIntention as MerchantIntentionModel;
|
||||
use think\facade\View;
|
||||
use app\common\model\merchant\system\merchant\MerchantCategory;
|
||||
use app\common\model\merchant\system\merchant\MerchantType;
|
||||
|
||||
class MerchantIntention extends BaseController
|
||||
{
|
||||
protected $path;
|
||||
protected $request;
|
||||
protected $intention;
|
||||
|
||||
public function __construct(Request $request, MerchantIntentionModel $intention)
|
||||
{
|
||||
$this->request = $request;
|
||||
$this->intention = $intention;
|
||||
$this->path = [
|
||||
'index' => 'merchant/system/merchant/intention/lst',
|
||||
'status' => 'merchant/system/merchant/intention/status',
|
||||
'mark' => 'merchant/system/merchant/intention/mark',
|
||||
'read' => 'merchant/system/merchant/intention/read',
|
||||
'add' => 'merchant/system/merchant/intention/add'
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示资源列表
|
||||
*
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function Index(MerchantCategory $category, MerchantType $type)
|
||||
{
|
||||
// 商户分类
|
||||
$category = $category->select();
|
||||
|
||||
//审核
|
||||
// 店铺类弄
|
||||
$type = $type->select();
|
||||
// search
|
||||
|
||||
View::assign('category',$category);
|
||||
View::assign('type',$type);
|
||||
|
||||
return View($this->path['index']);
|
||||
}
|
||||
|
||||
public function Lst()
|
||||
{
|
||||
$params = get_params();
|
||||
$page = empty($params['page'])? 1 : (int)$params['page'];
|
||||
$limit = empty($params['limit'])? (int)get_config('app . page_size') : (int)$params['limit'];
|
||||
$where = get_params(['mer_name', 'status', 'date', 'keywords', 'mer_intention_id', 'category_id', 'type_id', 'start_date','end_date']);
|
||||
|
||||
$data = $this->intention->GetList($where, $page, $limit);
|
||||
|
||||
|
||||
return to_assign(0, '', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核表单
|
||||
*/
|
||||
public function StatusForm()
|
||||
{
|
||||
$id = get_params('id');
|
||||
if (!$this->intention->getWhereCount(['mer_intention_id' => $id, 'is_del' => 0]))
|
||||
return to_assign(1,'数据不存在');
|
||||
|
||||
return View($this->path['status'], ['id'=>$id]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核
|
||||
*/
|
||||
public function SwitchStatus()
|
||||
{
|
||||
$params = get_params(['status','fail_msg','create_mer','id']);
|
||||
$id = $params['id'];
|
||||
|
||||
//创建
|
||||
if (!$this->intention->GetWhereCount(['mer_intention_id' => $id, 'is_del' => 0]))
|
||||
return to_assign(1,'数据不存在');
|
||||
|
||||
$params['status'] = $params['status'] == 1 ? 1 : 2;
|
||||
$this->intention->updateStatus($id, $params);
|
||||
|
||||
return to_assign(0,'修改成功');
|
||||
}
|
||||
|
||||
/**
|
||||
* 备注表单页
|
||||
*/
|
||||
public function MarkForm()
|
||||
{
|
||||
$id = get_params('id');
|
||||
|
||||
if (!$this->intention->getWhereCount(['mer_intention_id' => $id, 'is_del' => 0]))
|
||||
return to_assign(1, '数据不存在');
|
||||
|
||||
View::assign('id', $id);
|
||||
return View($this->path['mark']);
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示创建资源表单页.
|
||||
*
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function SetMark()
|
||||
{
|
||||
$id = get_params('id');
|
||||
$mark = get_params('mark');
|
||||
if (!$this->intention->getWhereCount($id))
|
||||
return to_assign(1, '数据不存在');
|
||||
|
||||
$rows = $this->intention->Edit($id, ['mark' => $mark]);
|
||||
|
||||
return $rows>0?to_assign(0, '修改成功'):to_assign(0, '修改失败');
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 删除指定资源
|
||||
*
|
||||
* @param int $id
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function del()
|
||||
{
|
||||
$id = get_params('id');
|
||||
if (!$this->intention->getWhereCount(['mer_intention_id' => $id, 'is_del' => 0]))
|
||||
return to_assign(1,'数据不存在');
|
||||
$this->intention->Edit($id, ['is_del' => 1]);
|
||||
|
||||
return to_assign(0,'删除成功');
|
||||
}
|
||||
}
|
@ -11,8 +11,12 @@ declare (strict_types = 1);
|
||||
namespace app\admin\controller\merchant\system\merchant;
|
||||
|
||||
use app\admin\BaseController;
|
||||
use think\Request;
|
||||
use app\common\model\merchant\system\merchant\MerchantMargin as MarchantMarginModel;
|
||||
use app\common\model\merchant\system\serve\ServeOrder as ServeOrderModel;
|
||||
use app\common\model\merchant\user\UserBill as UserBillModel;
|
||||
use app\common\model\merchant\system\merchant\Merchant as MerchantModel;
|
||||
use think\facade\View;
|
||||
use think\exception\ValidateException;
|
||||
use think\facade\Request;
|
||||
|
||||
/**
|
||||
* 店铺保证金管理类
|
||||
@ -21,32 +25,108 @@ class MerchantMargin extends BaseController
|
||||
{
|
||||
|
||||
protected $margin;
|
||||
protected $path;
|
||||
|
||||
public function __construct(MarchantMarginModel $margin)
|
||||
public function __construct()
|
||||
{
|
||||
$this->margin = $margin;
|
||||
// $this->margin = $margin;
|
||||
$this->path = [
|
||||
'index' => 'merchant/system/merchant/margin/list',
|
||||
'read' => 'merchant/system/merchant/margin/read',
|
||||
'edit' => 'merchant/system/merchant/margin/edit'
|
||||
];
|
||||
}
|
||||
|
||||
public function Index()
|
||||
{
|
||||
return View($this->path['index']);
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示资源列表
|
||||
* 显示保证金列表
|
||||
*
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function lst()
|
||||
public function Lst(ServeOrderModel $order)
|
||||
{
|
||||
echo 'margin list';
|
||||
$params = get_params();
|
||||
$page = empty($params['page'])? 1 : (int)$params['page'];
|
||||
$limit = empty($params['limit'])? (int)get_config('app . page_size') : (int)$params['limit'];
|
||||
$where = ['date','keyword','is_trader','category_id','type_id'];
|
||||
$where['type'] = 10;//10==保证金
|
||||
|
||||
$data = $order->GetList($where, $page, $limit);
|
||||
|
||||
return to_assign(0,'success', $data['data']=$data['list']);
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开保证金扣费记录面
|
||||
*
|
||||
* @param int $id
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function GetMarginLstForm($id)
|
||||
{
|
||||
view::assign('id', $id);
|
||||
return View($this->path['read']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取保证金扣费记录 record
|
||||
*
|
||||
*/
|
||||
public function GetMarginLst(UserBillModel $bill)
|
||||
{
|
||||
$params = get_params();
|
||||
$mer_id = empty($params['id']) ? 0 : $params['id'];
|
||||
$page = empty($params['page'])? 1 : (int)$params['page'];
|
||||
$limit = empty($params['limit'])? (int)get_config('app . page_size') :(int)$params['limit'];
|
||||
|
||||
$where['mer_id'] = (int)$mer_id;
|
||||
$where['category'] = 'mer_margin';
|
||||
|
||||
$data = $bill->GetList($where, $page, $limit);
|
||||
|
||||
return to_assign(0,'请求成功', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示创建资源表单页.
|
||||
*
|
||||
* @return \think\Response
|
||||
* 设置扣减保证金表单
|
||||
*/
|
||||
public function create()
|
||||
public function setMarginForm(MerchantModel $merchant)
|
||||
{
|
||||
//
|
||||
|
||||
$mer_id = get_params('id');
|
||||
$data = $merchant->GetMerchantById($mer_id);
|
||||
if (isset($data->is_margin) && $data->is_margin !== 10) {
|
||||
throw new ValidateException('商户无保证金可扣');
|
||||
}
|
||||
|
||||
return View($this->path['edit'], ['data'=>$data]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置扣减保证金
|
||||
*/
|
||||
public function setMargin(MerchantModel $merchant)
|
||||
{
|
||||
$data = get_params(['mer_id','number','mer_name','margin','mark']);
|
||||
if (empty($data['mer_name']) || empty($data['mer_id'])) {
|
||||
return to_assign(0,'商户信息不能为空');
|
||||
}
|
||||
$data['title'] = '保证金扣除';
|
||||
$data['type'] = 'mer_margin';//明细类型=保证金扣除
|
||||
if (!empty($data['number']) && $data['number'] < 0)
|
||||
return to_assign(0,'扣除金额不能小于0');
|
||||
|
||||
$data = $merchant->SetMargin($data);
|
||||
|
||||
return to_assign(0,'扣除保证金成功',[]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 保存新建的资源
|
||||
*
|
||||
@ -58,16 +138,7 @@ class MerchantMargin extends BaseController
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示指定的资源
|
||||
*
|
||||
* @param int $id
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function read($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 显示编辑资源表单页.
|
||||
@ -92,14 +163,4 @@ class MerchantMargin extends BaseController
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除指定资源
|
||||
*
|
||||
* @param int $id
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function delete($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
|
@ -7,16 +7,18 @@
|
||||
* @email:q8197264@126.com
|
||||
* @date :2023年03月3日
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\admin\controller\merchant\system\merchant;
|
||||
|
||||
use app\admin\BaseController;
|
||||
use app\admin\controller\merchant\system\auth\Menu;
|
||||
use app\common\model\merchant\system\merchant\MerchantType as MerchantTypeModel;
|
||||
use app\common\model\merchant\system\auth\Menu as MenuModel;
|
||||
use app\common\controller\FormatList;
|
||||
use think\facade\View;
|
||||
use think\exception\ValidateException;
|
||||
use app\validate\merchant\admin\MerchantTypeValidate;
|
||||
|
||||
/**
|
||||
* 店铺类型管理类
|
||||
@ -32,7 +34,8 @@ class MerchantType extends BaseController
|
||||
$this->path = [
|
||||
'index' => 'merchant/system/merchant/type/index',
|
||||
'read' => 'merchant/system/merchant/type/read',
|
||||
'add' => 'merchant/system/merchant/type/add'
|
||||
'add' => 'merchant/system/merchant/type/add',
|
||||
'edit' => 'merchant/system/merchant/type/edit'
|
||||
];
|
||||
}
|
||||
|
||||
@ -55,6 +58,8 @@ class MerchantType extends BaseController
|
||||
if (!empty($id)) {
|
||||
// 进入编辑页,显示店铺数据
|
||||
$detail = $this->merchant->Find($id);
|
||||
View::assign('id', $id);
|
||||
|
||||
}
|
||||
if (empty($detail)) {
|
||||
$detail = [
|
||||
@ -70,12 +75,34 @@ class MerchantType extends BaseController
|
||||
];
|
||||
}
|
||||
|
||||
// 查出商户所有菜单数据
|
||||
$data = $menu->Search([], 1);
|
||||
View::assign('dataTree', $format->FormatCategory($data['list']));
|
||||
// 查出商户所有菜单数据权限 tree
|
||||
$data = $menu->getList([],1);
|
||||
|
||||
$checked_list = [];
|
||||
if (!empty($id) && $id>0) {
|
||||
// 获取已有菜单权限
|
||||
$checked_list = $this->merchant->getList(['mer_type_id'=>$id]);
|
||||
|
||||
// 给菜单权限附加选中状态
|
||||
foreach($data['list'] as $k=>$item) {
|
||||
foreach ($checked_list['list'] as $auth) {
|
||||
if (in_array($item['id'], $auth['auth_ids'])) {
|
||||
$data['list'][$k]['checked'] = true;
|
||||
$data['list'][$k]['spread'] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 递归分类, 顺便去掉所有父节点的 checked
|
||||
$treelist = $format->FormatCategory($data['list']);
|
||||
|
||||
View::assign('dataTree', $treelist);
|
||||
View::assign('detail', $detail);
|
||||
|
||||
return view($this->path['add']);
|
||||
$path = empty($id)?'add':'edit';
|
||||
|
||||
return View($this->path[$path]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -89,9 +116,9 @@ class MerchantType extends BaseController
|
||||
$page = empty($param['page']) ? 1 : (int)$param['page'];
|
||||
$limit = empty($param['limit']) ? 10 : (int)$param['limit'];
|
||||
|
||||
$data = $this->merchant->GetList($page, $limit);
|
||||
|
||||
return table_assign(0, '', $data);
|
||||
$data = $this->merchant->getList([], $page, $limit);
|
||||
|
||||
return to_assign(0, '', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -117,7 +144,6 @@ class MerchantType extends BaseController
|
||||
|
||||
$rows = $this->merchant->Add($batch);
|
||||
|
||||
|
||||
return $rows>0?to_assign(0, '操作成功'):to_assign(1, '操作失败');
|
||||
}
|
||||
|
||||
@ -131,9 +157,31 @@ class MerchantType extends BaseController
|
||||
$param = get_params();
|
||||
$id = isset($param['id']) ? (int)$param['id'] : 0;
|
||||
|
||||
$detail = $this->merchant->Find($id);
|
||||
$detail = $this->merchant->getDetail($id);
|
||||
|
||||
if (!empty($detail)) {
|
||||
// 查出商户所有菜单数据权限 tree
|
||||
$menu = app()->make(MenuModel::class);
|
||||
$data = $menu->getList([],1);
|
||||
|
||||
// 获取已有权限
|
||||
$checked_list = $this->merchant->getList(['mer_type_id'=>$id]);
|
||||
|
||||
// 给菜单权限附加选中状态
|
||||
$list = [];
|
||||
foreach($data['list'] as $k=>$item) {
|
||||
foreach ($checked_list['list'] as $auth) {
|
||||
if (in_array($item['id'], $auth['auth_ids'])) {
|
||||
if ($item['pid']>0 && $item['title']!='权限')
|
||||
$data['list'][$k]['checked'] = true;
|
||||
$data['list'][$k]['spread'] = true;
|
||||
array_push($list, $data['list'][$k]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$format = app()->make(FormatList::class);
|
||||
View::assign('dataTree', $format->FormatCategory($list));
|
||||
View::assign('detail', $detail);
|
||||
return view($this->path['read']);
|
||||
} else {
|
||||
@ -150,21 +198,34 @@ class MerchantType extends BaseController
|
||||
*/
|
||||
public function Edit()
|
||||
{
|
||||
$params = get_params();
|
||||
$id = (int)get_params('id');
|
||||
$data = get_params(['type_name', 'type_info', 'is_margin', 'margin', 'auth','description']);
|
||||
$data['auth'] = explode(',',$data['auth']);
|
||||
|
||||
$batch['type_name'] = $params['type_name'];
|
||||
$batch['description'] = $params['description'];
|
||||
$batch['is_margin'] = $params['is_margin'];
|
||||
$batch['margin'] = $params['margin'];
|
||||
$batch['type_info'] = $params['type_info'];
|
||||
$menu_ids = $params['auth'];
|
||||
// 检查id是否存在
|
||||
if (!$this->merchant->exist($id)) {
|
||||
return to_assign(1,'数据不存在');
|
||||
}
|
||||
|
||||
// 更新权限
|
||||
// $this->menu->update($menu_ids);
|
||||
// 更新信息
|
||||
$msg = $this->merchant->modify($id, $this->getValidParams($data));
|
||||
|
||||
$rows = $this->merchant->Add($batch);
|
||||
return $msg['code']==0?to_assign(0, '操作成功'):to_assign(1, $msg['msg']);
|
||||
}
|
||||
|
||||
return $rows>0?to_assign(0, '操作成功'):to_assign(1, '操作失败');
|
||||
/**
|
||||
* 参数验证
|
||||
*/
|
||||
protected function getValidParams($data)
|
||||
{
|
||||
$validate = app()->make(MerchantTypeValidate::class);
|
||||
$validate->check($data);
|
||||
if ($data['is_margin'] == 1) {
|
||||
if ($data['margin'] <= 0) throw new ValidateException('保证金必须大于0');
|
||||
} else {
|
||||
$data['margin'] = 0;
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -181,16 +242,16 @@ class MerchantType extends BaseController
|
||||
}
|
||||
$id = (int)$param['id'];
|
||||
|
||||
$rows = $this->merchant->Del($id);
|
||||
if (!$this->merchant->exist($id)) {
|
||||
return to_assign(1, '数据不存在');
|
||||
}
|
||||
|
||||
return $rows>0?to_assign(0, '操作成功'):to_assign(1, '操作失败');
|
||||
$res = $this->merchant->Del($id);
|
||||
|
||||
return $res['code']==0?to_assign(0, '操作成功'):to_assign(1, $res['msg']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 备注表单页
|
||||
*/
|
||||
|
||||
/**
|
||||
* 店铺类型备注
|
||||
*/
|
||||
|
@ -1,8 +1,10 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2021 勾股工作室
|
||||
* @license https://opensource.org/licenses/Apache-2.0
|
||||
* @link https://www.gougucms.com
|
||||
* @date :2023年03月9日
|
||||
* @author:刘孝全
|
||||
* @email:q8197264@126.com
|
||||
*
|
||||
* @ 商品参数列表与模板添加
|
||||
*/
|
||||
namespace app\admin\controller\product;
|
||||
|
||||
@ -12,7 +14,6 @@ use think\facade\View;
|
||||
use app\admin\model\Merchant; // 商户模型
|
||||
use app\admin\model\StoreCategory; // 商品分类模型
|
||||
use app\admin\model\StoreProductReply; // 商品评论模型
|
||||
use app\admin\model\StoreBrandCategory; // 商品品牌分类模型
|
||||
use app\admin\model\Guarantee as GuaranteeModel; // 商品保障服务模型
|
||||
use app\admin\model\GeoCity; // 省市模型
|
||||
use app\admin\model\GeoArea; // 区域模型
|
||||
@ -21,78 +22,113 @@ use app\admin\model\SupplyChain; // 供应链模型
|
||||
use app\api\model\Area as AreaModel; // 市场区域模型
|
||||
use app\api\model\AreaManager as AreaManagerModel; // 区域负责人模型
|
||||
|
||||
use app\admin\model\store\paramter\ParameterTemplate as ParameterTemplateModel;//商品参数model
|
||||
use app\common\controller\FormatList;
|
||||
|
||||
/**
|
||||
*
|
||||
* 平台商品参数控制器
|
||||
*
|
||||
*
|
||||
*/
|
||||
class Specs extends BaseController
|
||||
class Parameter extends BaseController
|
||||
{
|
||||
public function __construct()
|
||||
protected $url;
|
||||
protected $adminInfo;
|
||||
protected $temp;
|
||||
|
||||
public function __construct(ParameterTemplateModel $temp)
|
||||
{
|
||||
$this->adminInfo = get_login_admin();
|
||||
$this->category_id=354;
|
||||
$this->temp = $temp;
|
||||
$this->url=[
|
||||
'/admin/product.priceDescription/index?category_id='.$this->category_id,
|
||||
'/admin/product.priceDescription/add',
|
||||
'/admin/product.priceDescription/edit',
|
||||
'/admin/product.priceDescription/del',
|
||||
'/admin/product.priceDescription/index',
|
||||
'/admin/product/params/index',
|
||||
'/admin/product/params/add',
|
||||
'/admin/product/params/edit',
|
||||
'/admin/product/params/del',
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* 商品价格列表
|
||||
*
|
||||
* 非超级管理员登入 需更新当前用户所属地区
|
||||
* @param array $where 地区id数组
|
||||
* @return array $where 更改后的地区id数组
|
||||
*/
|
||||
public function index()
|
||||
protected function auth(array $where):array
|
||||
{
|
||||
if($this->adminInfo['position_id'] != 1){ //不是超级管理员
|
||||
$www['admin_id'] = $this->adminInfo['id'];
|
||||
$user_address = Db::table('fa_szxc_information_useraddress')->where($www)->find();
|
||||
if ($user_address){
|
||||
if($user_address['auth_range'] == 1){
|
||||
$where[] = ['village_id','=',$user_address['village_id']];
|
||||
}elseif ($user_address['auth_range'] == 2){
|
||||
$where[] = ['street_id','=',$user_address['street_id']];
|
||||
}elseif ($user_address['auth_range'] == 3){
|
||||
$where[] = ['area_id','=',$user_address['area_id']];
|
||||
}else{
|
||||
$where[] = ['village_id','=',$user_address['village_id']];
|
||||
}
|
||||
}else{
|
||||
$where[] = ['village_id','=',''];
|
||||
}
|
||||
}
|
||||
|
||||
return $where;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品参数列表
|
||||
* @
|
||||
*/
|
||||
public function index(StoreCategory $category)
|
||||
{
|
||||
if (request()->isAjax()) {
|
||||
// Ajax 获取列表数据
|
||||
|
||||
$params= get_params();
|
||||
|
||||
// 构建查询条件
|
||||
$where = [];
|
||||
|
||||
if (isset($params['keywords']) && !empty($params['keywords'])){
|
||||
$where[]= ['name','like','%'.$params['keywords'].'%'];
|
||||
}
|
||||
if($this->adminInfo['position_id'] != 1){ //不是超级管理员
|
||||
$www['admin_id'] = $this->adminInfo['id'];
|
||||
$user_address = Db::table('fa_szxc_information_useraddress')->where($www)->find();
|
||||
if ($user_address){
|
||||
if($user_address['auth_range'] == 1){
|
||||
$where[] = ['village_id','=',$user_address['village_id']];
|
||||
}elseif ($user_address['auth_range'] == 2){
|
||||
$where[] = ['street_id','=',$user_address['street_id']];
|
||||
}elseif ($user_address['auth_range'] == 3){
|
||||
$where[] = ['area_id','=',$user_address['area_id']];
|
||||
}else{
|
||||
$where[] = ['village_id','=',$user_address['village_id']];
|
||||
}
|
||||
}else{
|
||||
$where[] = ['village_id','=',''];
|
||||
}
|
||||
$where = $this->auth($where);
|
||||
|
||||
// 获取列表数据
|
||||
$page = empty($params['page'])? 1 : (int)$params['page'];
|
||||
$limit = empty($params['limit'])? (int)get_config('app . page_size') : (int)$params['limit'];
|
||||
|
||||
$where['template_name'] = empty($params['template_name'])?'':$params['template_name'];
|
||||
$where['cate_id'] = empty($params['cate_id'])?'':$params['cate_id'];
|
||||
$where['mer_name'] = empty($params['mer_name'])?'':$params['mer_name'];
|
||||
$where['mer_id'] = empty($params['mer_id'])?'':$params['mer_id'];
|
||||
|
||||
if (isset($params['is_mer'])) {
|
||||
$merId = $params['mer_id'];
|
||||
$where['mer_id'] = $merId;
|
||||
unset($where['is_mer']);
|
||||
}
|
||||
$data = $this->temp->getList($where,$page, $limit);
|
||||
$data['list'] = [[
|
||||
'template_id'=>1,
|
||||
'template_name'=>'测试',
|
||||
'cateid'=>'',
|
||||
'sort'=>'1',
|
||||
'create_time'=> '2023-03-09 17:13:22',
|
||||
]];
|
||||
|
||||
$total = StoreBrandCategory::where($where)->count();
|
||||
|
||||
$list = StoreBrandCategory::order('sort desc')->select();
|
||||
|
||||
View::assign('url', $this->url);
|
||||
View::assign('list', $list);
|
||||
|
||||
$result = ['total' => $total, 'data' => $list];
|
||||
|
||||
return table_assign(0, '', $result);
|
||||
|
||||
return to_assign(0, '', $data);
|
||||
}else{
|
||||
|
||||
$list = StoreBrandCategory::select();
|
||||
// 初始空页面展示
|
||||
$where['mer_id'] = 0;
|
||||
$where['is_show'] = 0;
|
||||
$cate_list = $category->getList($where);
|
||||
$cate_list = FormatList::DropDownMenu($cate_list);
|
||||
|
||||
View::assign('url', $this->url);
|
||||
View::assign('list', $list);
|
||||
View::assign('cate_list', $cate_list);
|
||||
return view();
|
||||
}
|
||||
}
|
||||
@ -115,13 +151,13 @@ class Specs extends BaseController
|
||||
$data['create_time'] = date('Y-m-d H:i:s');
|
||||
|
||||
// 数据入库
|
||||
$res = StoreBrandCategory::create($data);
|
||||
// $res = StoreBrandCategory::create($data);
|
||||
|
||||
if ($res){
|
||||
return to_assign(0,'操作成功',['aid'=>$res]);
|
||||
}
|
||||
// if ($res){
|
||||
// return to_assign(0,'操作成功',['aid'=>$res]);
|
||||
// }
|
||||
|
||||
return to_assign(1, '操作失败,原因:'.$res);
|
||||
// return to_assign(1, '操作失败,原因:'.$res);
|
||||
|
||||
}else{
|
||||
|
@ -11,12 +11,16 @@ use think\facade\Db;
|
||||
use think\facade\View;
|
||||
use app\admin\model\Merchant; // 商户模型
|
||||
use app\admin\model\EbStoreProduct; // 商品模型
|
||||
use app\admin\model\GeoCity; // 省市模型
|
||||
use app\admin\model\GeoArea; // 区域模型
|
||||
use app\admin\model\GeoStreet; // 街道模型
|
||||
use app\admin\model\StoreCategory; // 商品分类模型
|
||||
use app\common\controller\FormatList;
|
||||
|
||||
// use app\admin\model\GeoCity; // 省市模型
|
||||
// use app\admin\model\GeoArea; // 区域模型
|
||||
// use app\admin\model\GeoStreet; // 街道模型
|
||||
use app\admin\model\SupplyChain; // 供应链模型
|
||||
use app\api\model\Area as AreaModel; // 市场区域模型
|
||||
use app\api\model\AreaManager as AreaManagerModel; // 区域负责人模型
|
||||
// use app\api\model\Area as AreaModel; // 市场区域模型
|
||||
// use app\api\model\AreaManager as AreaManagerModel; // 区域负责人模型
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
@ -25,12 +29,18 @@ use app\api\model\AreaManager as AreaManagerModel; // 区域负责人模型
|
||||
*/
|
||||
class Product extends BaseController
|
||||
{
|
||||
public function __construct()
|
||||
|
||||
protected $adminInfo;
|
||||
protected $url;
|
||||
protected $product;
|
||||
protected $mer_id = 4;//待开发成自动获取商城登陆商户id
|
||||
|
||||
public function __construct(EbStoreProduct $product)
|
||||
{
|
||||
$this->adminInfo = get_login_admin();
|
||||
$this->category_id=354;
|
||||
$this->product = $product;
|
||||
$this->url=[
|
||||
'/admin/product.product/index?category_id='.$this->category_id,
|
||||
'/admin/product.product/index',
|
||||
'/admin/product.product/add',
|
||||
'/admin/product.product/edit',
|
||||
'/admin/product.product/delete',
|
||||
@ -38,48 +48,88 @@ class Product extends BaseController
|
||||
];
|
||||
}
|
||||
|
||||
protected function auth()
|
||||
{
|
||||
$where = [];
|
||||
if($this->adminInfo['position_id'] != 1){ //不是超级管理员
|
||||
$www['admin_id'] = $this->adminInfo['id'];
|
||||
$user_address = Db::table('fa_szxc_information_useraddress')->where($www)->find();
|
||||
if ($user_address){
|
||||
if($user_address['auth_range'] == 1){
|
||||
$where[] = ['village_id','=',$user_address['village_id']];
|
||||
}elseif ($user_address['auth_range'] == 2){
|
||||
$where[] = ['street_id','=',$user_address['street_id']];
|
||||
}elseif ($user_address['auth_range'] == 3){
|
||||
$where[] = ['area_id','=',$user_address['area_id']];
|
||||
}else{
|
||||
$where[] = ['village_id','=',$user_address['village_id']];
|
||||
}
|
||||
}else{
|
||||
$where[] = ['village_id','=',''];
|
||||
}
|
||||
}
|
||||
|
||||
return $where;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 供应链团队列表
|
||||
* 商户商品列表
|
||||
*
|
||||
*/
|
||||
public function index()
|
||||
public function index(StoreCategory $category)
|
||||
{
|
||||
if (request()->isAjax()) {
|
||||
|
||||
// request()->isAjax()
|
||||
// Ajax 前端获取数据
|
||||
$params= get_params();
|
||||
|
||||
$where = [];
|
||||
$where = self::auth();
|
||||
|
||||
if (isset($params['keywords']) && !empty($params['keywords'])){
|
||||
$where[]= ['name','like','%'.$params['keywords'].'%'];
|
||||
}
|
||||
if($this->adminInfo['position_id'] != 1){ //不是超级管理员
|
||||
$www['admin_id'] = $this->adminInfo['id'];
|
||||
$user_address = Db::table('fa_szxc_information_useraddress')->where($www)->find();
|
||||
if ($user_address){
|
||||
if($user_address['auth_range'] == 1){
|
||||
$where[] = ['village_id','=',$user_address['village_id']];
|
||||
}elseif ($user_address['auth_range'] == 2){
|
||||
$where[] = ['street_id','=',$user_address['street_id']];
|
||||
}elseif ($user_address['auth_range'] == 3){
|
||||
$where[] = ['area_id','=',$user_address['area_id']];
|
||||
}else{
|
||||
$where[] = ['village_id','=',$user_address['village_id']];
|
||||
}
|
||||
}else{
|
||||
$where[] = ['village_id','=',''];
|
||||
}
|
||||
// $where[]= ['sotre_name','like','%'.$params['keywords'].'%'];
|
||||
$where['keywords'] = $where['store_name'] = $params['keywords'];
|
||||
}
|
||||
|
||||
$total = EbStoreProduct::where($where)->count();
|
||||
$page = empty($params['page'])?1:$params['page'];
|
||||
$limit = empty($params['limit'])?10:$params['limit'];
|
||||
|
||||
$list = EbStoreProduct::with(['merchant' => ['merchantType', 'category']])->order('product_id desc')->select();
|
||||
// 平台商品分类id
|
||||
$where['cate_id'] = empty($params['plate_cate'])?'':$params['plate_cate'];
|
||||
|
||||
// 商户商品分类id
|
||||
// $where['mer_cate_id'] = empty($params['store_cate'])?'':$params['store_cate'];
|
||||
$where['is_trader'] = isset($params['is_trader'])?$params['is_trader']:1; // 是否自营 1自营, 0 不是自营
|
||||
|
||||
// product
|
||||
$where['is_gift_bag'] = empty($params['is_gift'])?'':$params['is_gift'];
|
||||
$where['is_show'] = empty($params['state'])?'':$params['state'];
|
||||
$where['temp_id'] = empty($params['shipping_tem'])?'':$params['shipping_tem'];
|
||||
$where['labels'] = empty($params['tag'])?'':$params['tag'];
|
||||
$where['type'] = empty($params['type'])?'':$params['type'];//实体商品:0 虚拟商品:1
|
||||
// $where['status'] = 0;//管理、审核、通过
|
||||
|
||||
|
||||
// $where['is_ficti'] = 1;//是否虚拟销量
|
||||
// $where['product_id'] = 0;
|
||||
// ['order','sort']
|
||||
// soft //软删除
|
||||
// $params['mer_id'] = $this->mer_id;
|
||||
if (!empty($params['mer_id'])) {
|
||||
$mer_id = get_params('mer_id');
|
||||
$where = array_merge($where, $this->switchType($where['type'],$mer_id,0));
|
||||
}
|
||||
$mer_id = isset($params['mer_id'])?$params['mer_id']:NULL;
|
||||
|
||||
$data = $this->product->getList($mer_id, $where, $page, $limit);
|
||||
|
||||
|
||||
// $list = EbStoreProduct::with(['merchant' => ['merchantType', 'category']])->order('product_id desc')->select();
|
||||
|
||||
View::assign('url', $this->url);
|
||||
View::assign('list', $list);
|
||||
View::assign('list', $data['list']);
|
||||
|
||||
$result = ['total' => $total, 'data' => $list];
|
||||
$result = ['total' => $data['count'], 'data' => $data['list']];
|
||||
|
||||
return table_assign(0, '', $result);
|
||||
|
||||
@ -87,12 +137,77 @@ class Product extends BaseController
|
||||
|
||||
$list = SupplyChain::with(['merchant' => ['merchantType', 'category']])->select();
|
||||
|
||||
// 初始空页面展示
|
||||
$where['mer_id'] = 0;
|
||||
$where['is_show'] = 0;
|
||||
$cate_list = $category->getList($where);
|
||||
$cate_list = FormatList::DropDownMenu($cate_list);
|
||||
|
||||
View::assign('cate_list', $cate_list);
|
||||
View::assign('url', $this->url);
|
||||
View::assign('list', $list);
|
||||
return view();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 与类型相对应的sql字段
|
||||
*
|
||||
* @Author:Liuxiaoquan
|
||||
* @Date: 2020/5/18
|
||||
* @param $type 商
|
||||
* @param int|null $merId 商户id
|
||||
* @param int|null $productType 产品类型
|
||||
* @return array $where 条件
|
||||
*/
|
||||
public function switchType($type, ?int $merId = 0, $productType = 0)
|
||||
{
|
||||
$stock = 0;
|
||||
// 获得库存
|
||||
// if ($merId) $stock = merchantConfig($merId, 'mer_store_stock');
|
||||
switch ($type) {
|
||||
case 1:
|
||||
$where = ['is_show' => 1, 'status' => 1,];
|
||||
break;
|
||||
case 2:
|
||||
$where = ['is_show' => 0, 'status' => 1];
|
||||
break;
|
||||
case 3:
|
||||
$where = ['is_show' => 1, 'stock' => 0, 'status' => 1];
|
||||
break;
|
||||
case 4:
|
||||
$where = ['stock' => $stock ? $stock : 0, 'status' => 1];
|
||||
break;
|
||||
case 5:
|
||||
$where = ['soft' => true];
|
||||
break;
|
||||
case 6:
|
||||
$where = ['status' => 0];
|
||||
break;
|
||||
case 7:
|
||||
$where = ['status' => -1];
|
||||
break;
|
||||
case 20:
|
||||
$where = ['status' => 1];
|
||||
break;
|
||||
default:
|
||||
// $where = ['is_show' => 1, 'status' => 1];
|
||||
break;
|
||||
}
|
||||
if ($productType == 0) {
|
||||
$where['product_type'] = $productType;
|
||||
if (!$merId) $where['is_gift_bag'] = 0;
|
||||
}
|
||||
if ($productType == 1) {
|
||||
$where['product_type'] = $productType;
|
||||
}
|
||||
if ($productType == 10) {
|
||||
$where['is_gift_bag'] = 1;
|
||||
}
|
||||
if (!$merId) $where['star'] = '';
|
||||
return $where;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 新增
|
||||
|
56
app/admin/controller/product/StoreCategory.php
Normal file
56
app/admin/controller/product/StoreCategory.php
Normal file
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/**
|
||||
* @date :2023年03月11日
|
||||
* @author:刘孝全
|
||||
* @email:q8197264@126.com
|
||||
*
|
||||
* @ 商品分类列表
|
||||
*/
|
||||
namespace app\admin\controller\product;
|
||||
|
||||
use app\admin\BaseController;
|
||||
use app\admin\model\StoreCategory as StoreCategoryModel;
|
||||
use app\common\controller\FormatList;
|
||||
|
||||
use app\common\model\merchant\user\UserMerchant;
|
||||
|
||||
class StoreCategory extends BaseController
|
||||
{
|
||||
protected $category;
|
||||
protected $mer_id = 4;
|
||||
|
||||
public function __construct(StoreCategoryModel $category)
|
||||
{
|
||||
$this->category = $category;
|
||||
}
|
||||
|
||||
protected function getMerId(UserMerchant $user)
|
||||
{
|
||||
// $user->isMerUser($uid, $mer_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 平台商品分类Tree列表
|
||||
*
|
||||
*/
|
||||
public function getList()
|
||||
{
|
||||
$where['mer_id'] = 0;
|
||||
$where['is_show'] = 0;
|
||||
$list = $this->category->getList($where);
|
||||
$list = FormatList::DropDownMenu($list);
|
||||
|
||||
return to_assign(0,'', $list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 商户商品分类Tree列表
|
||||
*/
|
||||
public function getStoreCategoryList(){
|
||||
$data = $this->category->getStoreCategoryList($this->mer_id, 1);
|
||||
$list = FormatList::FormatCategory($data,'store_category_id', 'pid', 'cate_name','child', 'id', 'title');
|
||||
|
||||
return to_assign(0, '', $list);
|
||||
}
|
||||
|
||||
}
|
@ -129,8 +129,10 @@ class Merchant extends BaseController
|
||||
|
||||
$total = StoreOrderModel::where($where)->count();
|
||||
|
||||
$list = StoreOrderModel::with(['merchant'])->order('order_id desc')->select();
|
||||
|
||||
$list = StoreOrderModel::with(['merchant'])->order('order_id desc')->page($params['page'])->limit($params['limit'])->select();
|
||||
foreach ($list as $k =>$v){
|
||||
$list[$k]['uid'] = Db::connect('shop')->table('eb_user')->where('uid',$v['uid'])->value('nickname');
|
||||
}
|
||||
View::assign('url', $this->url);
|
||||
View::assign('list', $list);
|
||||
|
||||
|
@ -1,31 +1,242 @@
|
||||
<?php
|
||||
/**
|
||||
* 时间:2023年03月04日
|
||||
* 作者:墨楠小
|
||||
* 邮箱:monanxiao@qq.com
|
||||
* 订单模型
|
||||
* @date :2023年03月04日
|
||||
* @author:刘孝全、墨楠小
|
||||
* @email:q8197264@126.com、monanxiao@qq.com
|
||||
*
|
||||
* @ 商品分类列表
|
||||
*/
|
||||
namespace app\admin\model;
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class EbStoreProduct extends Model
|
||||
{
|
||||
// 设置当前模型的数据库连接
|
||||
protected $connection = 'shop';
|
||||
use think\Model;
|
||||
use app\admin\model\store\ProductCate;
|
||||
|
||||
|
||||
class EbStoreProduct extends Model
|
||||
{
|
||||
// 设置当前模型的数据库连接
|
||||
protected $connection = 'shop';
|
||||
|
||||
// 设置当前模型对应的完整数据表名称
|
||||
protected $table = 'eb_store_product';
|
||||
protected $pk = 'product_id';
|
||||
|
||||
protected $filed = 'Product.product_id,Product.mer_id,brand_id,unit_name,spec_type,mer_status,rate,reply_count,store_info,cate_id,Product.image,slider_image,Product.store_name,Product.keyword,Product.sort,Product.is_show,Product.sales,Product.price,extension_type,refusal,cost,ot_price,stock,is_gift_bag,Product.care_count,Product.status,is_used,Product.create_time,Product.product_type,old_product_id,integral_total,integral_price_total,mer_labels,Product.is_good,Product.is_del,type,param_temp_id';
|
||||
|
||||
/**
|
||||
*
|
||||
* 关联商户
|
||||
*
|
||||
*/
|
||||
public function merchant()
|
||||
{
|
||||
return $this->hasOne(Merchant::class,'mer_id','mer_id')->field('is_trader,type_id,mer_id,mer_name,mer_avatar,product_score,service_score,postage_score,service_phone,care_count');
|
||||
}
|
||||
|
||||
public function storeCategory()
|
||||
{
|
||||
return $this->hasOne(StoreCategory::class,'store_category_id','cate_id')->field('store_category_id,cate_name');
|
||||
}
|
||||
public function merCateId()
|
||||
{
|
||||
return $this->hasMany(ProductCate::class,'product_id','product_id')->field('product_id, mer_cate_id');
|
||||
}
|
||||
|
||||
public function brand()
|
||||
{
|
||||
return $this->hasOne(StoreBrand::class,'brand_id','brand_id')->field('brand_id,brand_name');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* TODO 商户商品列表
|
||||
* @Author:Qinii
|
||||
* @Date: 2020/5/11
|
||||
* @param int $merId
|
||||
* @param array $where
|
||||
* @param int $page
|
||||
* @param int $limit
|
||||
* @return array
|
||||
*/
|
||||
public function getList(?int $mer_id, array $where, int $page, int $limit)
|
||||
{
|
||||
$query = self::search($mer_id, $where)
|
||||
->with(['merCateId.category', 'storeCategory', 'brand', 'Merchant']);
|
||||
$count = $query->count();
|
||||
$data = $query->field($this->filed)->page($page, $limit)
|
||||
->order('Product.product_id desc')
|
||||
// ->fetchSql()
|
||||
->select();
|
||||
// echo $data;exit('--');
|
||||
$data->append(['us_status']);
|
||||
|
||||
// 设置当前模型对应的完整数据表名称
|
||||
protected $table = 'eb_store_product';
|
||||
protected $pk = 'product_id';
|
||||
$list = $this->searchList(
|
||||
$data,
|
||||
'mer_labels',
|
||||
ProductLabel::class,
|
||||
'product_label_id',
|
||||
'mer_labels',
|
||||
['status' => 1],
|
||||
'product_label_id,product_label_id id,label_name name'
|
||||
);
|
||||
|
||||
/**
|
||||
*
|
||||
* 关联商户
|
||||
*
|
||||
*/
|
||||
public function merchant()
|
||||
{
|
||||
return $this->hasOne(Merchant::class, 'mer_id', 'mer_id');
|
||||
return compact('count', 'list');
|
||||
}
|
||||
|
||||
|
||||
// public function StoreSpu()
|
||||
// {}
|
||||
|
||||
|
||||
/**
|
||||
* @Author:Qinii
|
||||
* @Date: 2020/5/11
|
||||
* @param int $merId
|
||||
* @param array $where
|
||||
* @return mixed
|
||||
*/
|
||||
protected function search(?int $merId, array $where)
|
||||
{
|
||||
$keyArray = $whereArr = [];
|
||||
unset($where['type']);
|
||||
|
||||
// 以下字段为要搜索的字段
|
||||
$out = ['soft', 'us_status', 'mer_labels', 'sys_labels', 'order', 'hot_type'];
|
||||
foreach ($where as $key => $item) {
|
||||
if ($item !== '' && !in_array($key, $out)) {
|
||||
$keyArray[] = $key;
|
||||
$whereArr[$key] = $item;
|
||||
}
|
||||
}
|
||||
}
|
||||
// $query = isset($where['soft']) ? model::onlyTrashed()->alias('Product') : model::alias('Product');
|
||||
|
||||
$query = self::alias('Product');
|
||||
if (isset($where['is_trader']) && $where['is_trader'] !== '') {
|
||||
// hasWhere添加别名不生效 alias, 改为Join
|
||||
// $query->hasWhere('merchant',
|
||||
// function ($query) use ($where) {
|
||||
// $query->where('is_trader', $where['is_trader']);
|
||||
// }
|
||||
// );
|
||||
$query->Join('Merchant', 'Merchant.mer_id = Product.mer_id')
|
||||
->where('Merchant.is_trader', $where['is_trader']);
|
||||
}
|
||||
$query->withSearch($keyArray, $whereArr)
|
||||
|
||||
->Join('StoreSpu U', 'Product.product_id = U.product_id')
|
||||
->where('U.product_type', $where['product_type'] ?? 0)
|
||||
->when(($merId !== null),
|
||||
function ($query) use ($merId) {
|
||||
$query->where('Product.mer_id', $merId);
|
||||
}
|
||||
)
|
||||
->when(isset($where['hot_type']) && $where['hot_type'] !== '',
|
||||
function ($query) use ($where) {
|
||||
if ($where['hot_type'] == 'new')
|
||||
$query->where('is_new', 1);
|
||||
else if ($where['hot_type'] == 'hot')
|
||||
$query->where('is_hot', 1);
|
||||
else if ($where['hot_type'] == 'best')
|
||||
$query->where('is_best', 1);
|
||||
else if ($where['hot_type'] == 'good')
|
||||
$query->where('is_benefit', 1);
|
||||
}
|
||||
)
|
||||
->when(isset($where['pid']) && $where['pid'] !== '',
|
||||
function ($query) use ($where) {
|
||||
$ids = array_merge(self::findChildrenId((int)$where['pid']), [(int)$where['pid']]);
|
||||
if (count($ids)) $query->whereIn('cate_id', $ids);
|
||||
}
|
||||
)
|
||||
->when(isset($where['us_status']) && $where['us_status'] !== '', function ($query) use ($where) {
|
||||
if ($where['us_status'] == 0) {
|
||||
$query->where('Product.is_show', 0)->where('Product.is_used', 1)->where('Product.status', 1);
|
||||
}
|
||||
if ($where['us_status'] == 1) {
|
||||
$query->where('Product.is_show', 1)->where('Product.is_used', 1)->where('Product.status', 1);
|
||||
}
|
||||
if ($where['us_status'] == -1) {
|
||||
$query->where(function ($query) {
|
||||
$query->where('Product.is_used', 0)->whereOr('Product.status', '<>', 1);
|
||||
});
|
||||
}
|
||||
})
|
||||
->when(isset($where['mer_labels']) && $where['mer_labels'] !== '', function ($query) use ($where) {
|
||||
$query->whereLike('U.mer_labels', "%,{$where['mer_labels']},%");
|
||||
})
|
||||
->when(isset($where['sys_labels']) && $where['sys_labels'] !== '', function ($query) use ($where) {
|
||||
$query->whereLike('U.sys_labels', "%,{$where['sys_labels']},%");
|
||||
})
|
||||
->when(isset($where['order']), function ($query) use ($where, $merId) {
|
||||
if (in_array($where['order'], ['is_new', 'price_asc', 'price_desc', 'rate', 'sales'])) {
|
||||
if ($where['order'] == 'price_asc') {
|
||||
$where['order'] = 'price ASC';
|
||||
} else if ($where['order'] == 'price_desc') {
|
||||
$where['order'] = 'price DESC';
|
||||
} else {
|
||||
$where['order'] = $where['order'] . ' DESC';
|
||||
}
|
||||
$query->order($where['order'] . ',rank DESC ,create_time DESC ');
|
||||
} else if ($where['order'] !== '') {
|
||||
$query->order('U.' . $where['order'] . ' DESC,U.create_time DESC');
|
||||
} else {
|
||||
$query->order('U.create_time DESC');
|
||||
}
|
||||
})
|
||||
->when(isset($where['star']), function ($query) use ($where) {
|
||||
$query->when($where['star'] !== '', function ($query) use ($where) {
|
||||
$query->where('U.star', $where['star']);
|
||||
});
|
||||
$query->order('U.star DESC,U.rank DESC,Product.create_time DESC');
|
||||
});
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function findChildrenId($id)
|
||||
{
|
||||
return StoreCategory::whereLike('path', '%/' . $id . '/%')->column('store_category_id');
|
||||
}
|
||||
|
||||
protected function searchList($collection, $field, $model, $searchKey, $insertKey, $where = [] ,$select = '*')
|
||||
{
|
||||
$ids = [];
|
||||
$link = [];
|
||||
|
||||
if (!$collection) return [];
|
||||
$collection = $collection->toArray();
|
||||
foreach ($collection as $k => $item) {
|
||||
if (is_array($item[$field])) {
|
||||
$link[$k] = array_unique($item[$field]);
|
||||
$ids = array_merge($item[$field], $ids);
|
||||
} else {
|
||||
$link[$k] = array_unique(explode(',', $item[$field]));
|
||||
}
|
||||
$ids = array_merge($link[$k], $ids);
|
||||
if (isset($collection[$k][$insertKey])) unset($collection[$k][$insertKey]);
|
||||
}
|
||||
$ids = array_filter(array_unique($ids));
|
||||
if (!count($ids)) {
|
||||
return $collection;
|
||||
}
|
||||
$many = $model::whereIn($searchKey, array_unique($ids))->where($where)->field($select)->select();
|
||||
|
||||
if (!$many) return $collection;
|
||||
$many = $many->toArray();
|
||||
foreach ($link as $k => $val) {
|
||||
foreach ($many as $item) {
|
||||
if (in_array($item[$searchKey], $val)) {
|
||||
|
||||
if (!isset($collection[$k][$insertKey])) $collection[$k][$insertKey] = [];
|
||||
|
||||
$collection[$k][$insertKey][] = $item;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $collection;
|
||||
}
|
||||
}
|
||||
|
58
app/admin/model/ProductLabel.php
Normal file
58
app/admin/model/ProductLabel.php
Normal file
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\common\model\store\product;
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
|
||||
class ProductLabel extends BaseModel
|
||||
{
|
||||
/**
|
||||
* TODO
|
||||
* @return string
|
||||
* @author Qinii
|
||||
* @day 8/17/21
|
||||
*/
|
||||
public static function tablePk(): string
|
||||
{
|
||||
return 'product_label_id';
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO
|
||||
* @return string
|
||||
* @author Qinii
|
||||
* @day 8/17/21
|
||||
*/
|
||||
public static function tableName(): string
|
||||
{
|
||||
return 'store_product_label';
|
||||
}
|
||||
|
||||
public function searchMerIdAttr($query, $value)
|
||||
{
|
||||
$query->where('mer_id', $value);
|
||||
}
|
||||
|
||||
public function searchStatusAttr($query, $value)
|
||||
{
|
||||
$query->where('status', $value);
|
||||
}
|
||||
|
||||
public function searchNameAttr($query, $value)
|
||||
{
|
||||
$query->whereLike('name', "%{$value}%");
|
||||
}
|
||||
|
||||
public function searchIsDelAttr($query, $value)
|
||||
{
|
||||
$query->where('is_del', $value);
|
||||
}
|
||||
}
|
@ -27,4 +27,81 @@
|
||||
return $this->hasOne(StoreCategory::class, 'store_category_id', 'pid');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取商品分类表数据
|
||||
*@author Liuxiaoquan
|
||||
*
|
||||
*@param array $where 查询条件
|
||||
*@return object|array $list 查询商品分类结果集
|
||||
*/
|
||||
public function getList($where)
|
||||
{
|
||||
$where['is_show'] = empty($where['is_show'])? 1 : $where['is_show'];
|
||||
$list = self::search($where)
|
||||
->field('store_category_id as id,pid,cate_name,path,sort,pic,level,is_hot')
|
||||
->order('sort DESC')->select();
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
||||
public function getStoreCategoryList(int $merId = 0,$status = 0)
|
||||
{
|
||||
$data = self::getAllOptions($merId,$status);
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取列表 -- 筛选用
|
||||
* @Date: 2020/5/16
|
||||
* @param int|null $mer_id
|
||||
* @return mixed
|
||||
*/
|
||||
protected function getAllOptions($mer_id = null,$status = null,$level = null)
|
||||
{
|
||||
$field = 'pid,cate_name';
|
||||
$query = StoreCategory::when(($mer_id !== null),
|
||||
function($query)use($mer_id){
|
||||
$query->where('mer_id', $mer_id);
|
||||
})
|
||||
->when($status,function($query)use($status){
|
||||
$query->where('is_show',$status);
|
||||
})
|
||||
->when(($level != '' && $level != null),function($query)use($level){
|
||||
$query->where('level','<',$level);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
return $query->order('sort DESC,'.$this->getPk().' DESC')->column($field, $this->getPk());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询语句构建
|
||||
*@author Liuxiaoquan
|
||||
*
|
||||
*@param array $where 查询条件
|
||||
*@return Query
|
||||
*/
|
||||
protected function search($where)
|
||||
{
|
||||
$query = self::when(isset($where['mer_id'])&&$where['mer_id']!=='',
|
||||
function ($query)use($where) {
|
||||
$query->where('mer_id', $where['mer_id']);
|
||||
}
|
||||
)
|
||||
->when(isset($where['level'])&&$where['level']!=='',
|
||||
function($query)use($where){
|
||||
$query->where('level', $where['level']);
|
||||
}
|
||||
)
|
||||
->when(isset($where['is_show'])&&$where['is_show']!=='',
|
||||
function($query)use($where){
|
||||
$query->where('is_show', $where['is_show']);
|
||||
}
|
||||
);
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
}
|
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();
|
||||
}
|
||||
}
|
||||
|
102
app/admin/model/UserExtract.php
Normal file
102
app/admin/model/UserExtract.php
Normal file
@ -0,0 +1,102 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2021 勾股工作室
|
||||
* @license https://opensource.org/licenses/Apache-2.0
|
||||
* @link https://www.gougucms.com
|
||||
*/
|
||||
namespace app\admin\model;
|
||||
use think\facade\Db;
|
||||
use think\model;
|
||||
class UserExtract extends Model
|
||||
{
|
||||
protected $connection = 'shop';
|
||||
// 设置当前模型对应的完整数据表名称
|
||||
protected $table = 'eb_user_extract';
|
||||
|
||||
/**
|
||||
* 获取分页列表
|
||||
* @param $where
|
||||
* @param $param
|
||||
*/
|
||||
public function getUserExtractList($where, $param)
|
||||
{
|
||||
$rows = empty($param['limit']) ? get_config('app . page_size') : $param['limit'];
|
||||
$order = empty($param['order']) ? 'extract_id desc' : $param['order'];
|
||||
$list = self::where($where)->field('extract_id,extract_id,uid,extract_sn,real_name,extract_type,bank_code,bank_address,alipay_code,wechat,extract_pic,extract_price,balance,mark,admin_id,fail_msg,status_time,create_time,status,bank_name')->order($order)->paginate($rows, false, ['query' => $param]);
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加数据
|
||||
* @param $param
|
||||
*/
|
||||
public function addUserExtract($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 editUserExtract($param)
|
||||
{
|
||||
try {
|
||||
$param['update_time'] = time();
|
||||
self::where('extract_id', $param['extract_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 getUserExtractById($id)
|
||||
{
|
||||
$info = self::where('extract_id', $id)->find();
|
||||
return $info;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除信息
|
||||
* @param $id
|
||||
* @return array
|
||||
*/
|
||||
public function delUserExtractById($id,$type=0)
|
||||
{
|
||||
if($type==0){
|
||||
//逻辑删除
|
||||
try {
|
||||
$param['delete_time'] = time();
|
||||
self::where('extract_id', $id)->update(['delete_time'=>time()]);
|
||||
add_log('delete', $id);
|
||||
} catch(\Exception $e) {
|
||||
return to_assign(1, '操作失败,原因:'.$e->getMessage());
|
||||
}
|
||||
}
|
||||
else{
|
||||
//物理删除
|
||||
try {
|
||||
self::where('extract_id', $id)->delete();
|
||||
add_log('delete', $id);
|
||||
} catch(\Exception $e) {
|
||||
return to_assign(1, '操作失败,原因:'.$e->getMessage());
|
||||
}
|
||||
}
|
||||
return to_assign();
|
||||
}
|
||||
}
|
||||
|
542
app/admin/model/store/Product.php
Normal file
542
app/admin/model/store/Product.php
Normal file
@ -0,0 +1,542 @@
|
||||
<?php
|
||||
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\common\model\store\product;
|
||||
|
||||
use app\common\dao\store\StoreSeckillActiveDao;
|
||||
use app\common\model\BaseModel;
|
||||
use app\common\model\store\coupon\StoreCouponProduct;
|
||||
use app\common\model\store\Guarantee;
|
||||
use app\common\model\store\GuaranteeTemplate;
|
||||
use app\common\model\store\GuaranteeValue;
|
||||
use app\common\model\store\parameter\ParameterValue;
|
||||
use app\common\model\store\shipping\ShippingTemplate;
|
||||
use app\common\model\store\StoreBrand;
|
||||
use app\common\model\store\StoreCategory;
|
||||
use app\common\model\store\StoreSeckillActive;
|
||||
use app\common\model\system\merchant\Merchant;
|
||||
use app\common\repositories\store\StoreCategoryRepository;
|
||||
use crmeb\services\VicWordService;
|
||||
use Darabonba\GatewaySpi\Models\InterceptorContext\request;
|
||||
use think\db\BaseQuery;
|
||||
use think\facade\Db;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
/**
|
||||
* TODO:
|
||||
*/
|
||||
class Product extends BaseModel
|
||||
{
|
||||
use SoftDelete;
|
||||
|
||||
|
||||
protected $deleteTime = 'is_del';
|
||||
protected $defaultSoftDelete = 0;
|
||||
|
||||
|
||||
/**
|
||||
* @Author:Qinii
|
||||
* @Date: 2020/5/8
|
||||
* @return string
|
||||
*/
|
||||
public static function tablePk(): string
|
||||
{
|
||||
return 'product_id';
|
||||
}
|
||||
|
||||
/**
|
||||
* @Author:Qinii
|
||||
* @Date: 2020/5/8
|
||||
* @return string
|
||||
*/
|
||||
public static function tableName(): string
|
||||
{
|
||||
return 'store_product';
|
||||
}
|
||||
|
||||
/*
|
||||
* -----------------------------------------------------------------------------------------------------------------
|
||||
* 属性
|
||||
* -----------------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
public function getSliderImageAttr($value)
|
||||
{
|
||||
return $value ? explode(',',$value) : [];
|
||||
}
|
||||
public function getGiveCouponIdsAttr($value)
|
||||
{
|
||||
return $value ? explode(',',$value) : [];
|
||||
}
|
||||
public function getMaxExtensionAttr($value)
|
||||
{
|
||||
if($this->extension_type){
|
||||
$org_extension = ($this->attrValue()->order('extension_two DESC')->value('extension_one'));
|
||||
} else {
|
||||
$org_extension = bcmul(($this->attrValue()->order('price DESC')->value('price')) , systemConfig('extension_one_rate'),2);
|
||||
}
|
||||
$spreadUser = (request()->isLogin() && request()->userType() == 1 ) ? request()->userInfo() : null;
|
||||
if ($spreadUser && $spreadUser->brokerage_level > 0 && $spreadUser->brokerage && $spreadUser->brokerage->extension_one_rate > 0) {
|
||||
$org_extension = bcmul($org_extension, 1 + $spreadUser->brokerage->extension_one_rate, 2);
|
||||
}
|
||||
return $org_extension;
|
||||
}
|
||||
public function getMinExtensionAttr($value)
|
||||
{
|
||||
if($this->extension_type){
|
||||
$org_extension = ($this->attrValue()->order('extension_two ASC')->value('extension_two'));
|
||||
} else {
|
||||
$org_extension = bcmul(($this->attrValue()->order('price ASC')->value('price')) , systemConfig('extension_one_rate'),2);
|
||||
}
|
||||
$spreadUser = (request()->isLogin() && request()->userType() == 1 ) ? request()->userInfo() : null;
|
||||
if ($spreadUser && $spreadUser->brokerage_level > 0 && $spreadUser->brokerage && $spreadUser->brokerage->extension_one_rate > 0) {
|
||||
$org_extension = bcmul($org_extension, 1 + $spreadUser->brokerage->extension_one_rate, 2);
|
||||
}
|
||||
return $org_extension;
|
||||
}
|
||||
|
||||
public function check()
|
||||
{
|
||||
if(!$this || !$this->is_show || !$this->is_used || !$this->status || $this->is_del || !$this->mer_status) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO 秒杀商品结束时间
|
||||
* @return false|int
|
||||
* @author Qinii
|
||||
* @day 2020-08-15
|
||||
*/
|
||||
public function getEndTimeAttr()
|
||||
{
|
||||
if($this->product_type !== 1) return true;
|
||||
$day = date('Y-m-d',time());
|
||||
$_day = strtotime($day);
|
||||
$end_day = strtotime($this->seckillActive['end_day']);
|
||||
if($end_day >= $_day)
|
||||
return strtotime($day.$this->seckillActive['end_time'].':00:00');
|
||||
if($end_day < strtotime($day))
|
||||
return strtotime(date('Y-m-d',$end_day).$this->seckillActive['end_time'].':00:00');
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO 秒杀商品状态
|
||||
* @return array|int
|
||||
* @author Qinii
|
||||
* @day 2020-08-19
|
||||
*/
|
||||
public function getSeckillStatusAttr()
|
||||
{
|
||||
if($this->product_type !== 1) return true;
|
||||
$day = strtotime(date('Y-m-d',time()));
|
||||
$_h = date('H',time());
|
||||
$start_day = strtotime($this->seckillActive['start_day']);
|
||||
$end_day = strtotime($this->seckillActive['end_day']);
|
||||
if(!$this->seckillActive) return '';
|
||||
if($this->seckillActive['status'] !== -1){
|
||||
//还未开始
|
||||
if($start_day > time() || $this->is_show !== 1)return 0;
|
||||
//已结束
|
||||
if($end_day < $day) return -1;
|
||||
//开始 - 结束
|
||||
if($start_day <= $day && $day <= $end_day){
|
||||
//未开始
|
||||
if($this->seckillActive['start_time'] > $_h) return 0;
|
||||
//已结束
|
||||
if($this->seckillActive['end_time'] <= $_h) return -1;
|
||||
//进行中
|
||||
if($this->seckillActive['start_time'] <= $_h && $this->seckillActive['end_time'] > $_h) return 1;
|
||||
}
|
||||
}
|
||||
//已结束
|
||||
return -1;
|
||||
|
||||
}
|
||||
|
||||
public function getImageAttr($value)
|
||||
{
|
||||
if (is_int(strpos($value, 'http'))){
|
||||
return $value;
|
||||
}else{
|
||||
return rtrim(systemConfig('site_url'),'/') .$value;
|
||||
}
|
||||
}
|
||||
|
||||
public function getTopReplyAttr()
|
||||
{
|
||||
$res = ProductReply::where('product_id',$this->product_id)->where('is_del',0)->with(['orderProduct'])->field('reply_id,uid,nickname,merchant_reply_content,avatar,order_product_id,product_id,product_score,service_score,postage_score,comment,pics,rate,create_time')
|
||||
->order('sort DESC,create_time DESC')->limit(1)->find();
|
||||
if(!$res) return null;
|
||||
if ($res['orderProduct'])
|
||||
$res['sku'] = $res['orderProduct']['cart_info']['productAttr']['sku'];
|
||||
unset($res['orderProduct']);
|
||||
if (strlen($res['nickname']) > 1) {
|
||||
$str = mb_substr($res['nickname'],0,1) . '*';
|
||||
if (strlen($res['nickname']) > 2) {
|
||||
$str .= mb_substr($res['nickname'], -1,1);
|
||||
}
|
||||
$res['nickname'] = $str;
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
public function getUsStatusAttr()
|
||||
{
|
||||
return ($this->status == 1) ? ($this->is_used == 1 ? ( $this->is_show ? 1 : 0 ) : -1) : -1;
|
||||
}
|
||||
|
||||
public function getGuaranteeTemplateAttr()
|
||||
{
|
||||
$gua = GuaranteeTemplate::where('guarantee_template_id',$this->guarantee_template_id)->where('status',1)->where('is_del',0)->find();
|
||||
if(!$gua) return [];
|
||||
$guarantee_id = GuaranteeValue::where('guarantee_template_id',$this->guarantee_template_id)->column('guarantee_id');
|
||||
return Guarantee::where('guarantee_id','in',$guarantee_id)->where('status',1)->where('is_del',0)->select();
|
||||
}
|
||||
|
||||
public function getMaxIntegralAttr()
|
||||
{
|
||||
if(systemConfig('integral_status') && merchantConfig($this->mer_id,'mer_integral_status')){
|
||||
$price = ($this->attrValue()->order('price DESC')->value('price'));
|
||||
$rate = ($this->integral_rate < 0) ? merchantConfig($this->mer_id,'mer_integral_rate') : $this->integral_rate;
|
||||
$rate = $rate < 0 ? $rate / 100 : 0;
|
||||
return bcmul($price ,$rate,2);
|
||||
}
|
||||
return '0';
|
||||
}
|
||||
|
||||
public function getHotRankingAttr()
|
||||
{
|
||||
if ($this->product_type == 0) {
|
||||
$where = [
|
||||
'is_show' => 1,
|
||||
'status' => 1,
|
||||
'is_used' => 1,
|
||||
'product_type' => 0,
|
||||
'mer_status' => 1,
|
||||
'is_gift_bag' => 0,
|
||||
'cate_id' => $this->cate_id
|
||||
];
|
||||
self::where($where)->order('sales DESC');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO 商品参数
|
||||
* @author Qinii
|
||||
* @day 2022/11/24
|
||||
*/
|
||||
public function getParamsAttr()
|
||||
{
|
||||
if(in_array($this->product_type,[0,2])) {
|
||||
$product_id = $this->product_id;
|
||||
} else {
|
||||
$product_id = $this->old_product_id;
|
||||
}
|
||||
return ParameterValue::where('product_id',$product_id)->order('parameter_value_id ASC')->select();
|
||||
}
|
||||
|
||||
public function getParamTempIdAttr($value)
|
||||
{
|
||||
return $value ? explode(',',$value) : $value;
|
||||
}
|
||||
|
||||
/*
|
||||
* -----------------------------------------------------------------------------------------------------------------
|
||||
* 关联模型
|
||||
* -----------------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
public function merCateId()
|
||||
{
|
||||
return $this->hasMany(ProductCate::class,'product_id','product_id')->field('product_id,mer_cate_id');
|
||||
}
|
||||
public function attr()
|
||||
{
|
||||
return $this->hasMany(ProductAttr::class,'product_id','product_id');
|
||||
}
|
||||
public function attrValue()
|
||||
{
|
||||
return $this->hasMany(ProductAttrValue::class,'product_id','product_id');
|
||||
}
|
||||
public function oldAttrValue()
|
||||
{
|
||||
return $this->hasMany(ProductAttrValue::class,'product_id','old_product_id');
|
||||
}
|
||||
public function content()
|
||||
{
|
||||
return $this->hasOne(ProductContent::class,'product_id','product_id');
|
||||
}
|
||||
protected function temp()
|
||||
{
|
||||
return $this->hasOne(ShippingTemplate::class,'shipping_template_id','temp_id');
|
||||
}
|
||||
public function storeCategory()
|
||||
{
|
||||
return $this->hasOne(StoreCategory::class,'store_category_id','cate_id')->field('store_category_id,cate_name');
|
||||
}
|
||||
public function merchant()
|
||||
{
|
||||
return $this->hasOne(Merchant::class,'mer_id','mer_id')->field('is_trader,type_id,mer_id,mer_name,mer_avatar,product_score,service_score,postage_score,service_phone,care_count');
|
||||
}
|
||||
public function reply()
|
||||
{
|
||||
return $this->hasMany(ProductReply::class,'product_id','product_id')->order('create_time DESC');
|
||||
}
|
||||
public function brand()
|
||||
{
|
||||
return $this->hasOne(StoreBrand::class,'brand_id','brand_id')->field('brand_id,brand_name');
|
||||
}
|
||||
public function seckillActive()
|
||||
{
|
||||
return $this->hasOne(StoreSeckillActive::class,'product_id','product_id');
|
||||
}
|
||||
public function issetCoupon()
|
||||
{
|
||||
return $this->hasOne(StoreCouponProduct::class, 'product_id', 'product_id')->alias('A')
|
||||
->rightJoin('StoreCoupon B', 'A.coupon_id = B.coupon_id')->where(function (BaseQuery $query) {
|
||||
$query->where('B.is_limited', 0)->whereOr(function (BaseQuery $query) {
|
||||
$query->where('B.is_limited', 1)->where('B.remain_count', '>', 0);
|
||||
});
|
||||
})->where(function (BaseQuery $query) {
|
||||
$query->where('B.is_timeout', 0)->whereOr(function (BaseQuery $query) {
|
||||
$time = date('Y-m-d H:i:s');
|
||||
$query->where('B.is_timeout', 1)->where('B.start_time', '<', $time)->where('B.end_time', '>', $time);
|
||||
});
|
||||
})->field('A.product_id,B.*')->where('status', 1)->where('type', 1)->where('send_type', 0)->where('is_del', 0)
|
||||
->order('sort DESC,coupon_id DESC')->hidden(['is_del', 'status']);
|
||||
}
|
||||
public function assist()
|
||||
{
|
||||
return $this->hasOne(ProductAssist::class,'product_id','product_id');
|
||||
}
|
||||
public function productGroup()
|
||||
{
|
||||
return $this->hasOne(ProductGroup::class,'product_id','product_id');
|
||||
}
|
||||
public function guarantee()
|
||||
{
|
||||
return $this->hasOne(GuaranteeTemplate::class,'guarantee_template_id','guarantee_template_id')->where('status',1)->where('is_del',0);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* TODO 是否是会员
|
||||
* @return bool
|
||||
* @author Qinii
|
||||
* @day 2023/1/4
|
||||
*/
|
||||
public function getIsVipAttr()
|
||||
{
|
||||
if (request()->isLogin()) {
|
||||
if (request()->userType() == 1) {
|
||||
$userInfo = request()->userInfo();
|
||||
return $userInfo->is_svip ? true : false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* TODO 是否展示会员价
|
||||
* @return bool
|
||||
* @author Qinii
|
||||
* @day 2023/1/4
|
||||
*/
|
||||
public function getShowSvipPriceAttr()
|
||||
{
|
||||
if ($this->mer_svip_status != 0 && (systemConfig('svip_show_price') != 1 || $this->is_vip) && $this->svip_price_type > 0 ) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* TODO 是否显示会员价等信息
|
||||
* @return array
|
||||
* @author Qinii
|
||||
* @day 2022/11/24
|
||||
*/
|
||||
public function getShowSvipInfoAttr()
|
||||
{
|
||||
$res = [
|
||||
'show_svip' => true, //是否展示会员入口
|
||||
'is_svip' => false, //当前用户是否是会员
|
||||
'show_svip_price' => false, //是否展示会员价
|
||||
'save_money' => 0, //当前商品会员优化多少钱
|
||||
];
|
||||
if ($this->product_type == 0) {
|
||||
if (!systemConfig('svip_switch_status')) {
|
||||
$res['show_svip'] = false;
|
||||
} else {
|
||||
$res['is_svip'] = $this->is_vip;
|
||||
if ($this->show_svip_price) {
|
||||
$res['show_svip_price'] = true;
|
||||
$res['save_money'] = bcsub($this->price, $this->svip_price, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO 获取会员价
|
||||
* @return int|string
|
||||
* @author Qinii
|
||||
* @day 2023/1/4
|
||||
*/
|
||||
public function getSvipPriceAttr()
|
||||
{
|
||||
if ($this->product_type == 0 && $this->mer_svip_status != 0 && $this->show_svip_price) {
|
||||
//默认比例
|
||||
if ($this->svip_price_type == 1) {
|
||||
$rate = merchantConfig($this->mer_id,'svip_store_rate');
|
||||
$svip_store_rate = $rate > 0 ? bcdiv($rate,100,2) : 0;
|
||||
$price = $this->attrValue()->order('price ASC')->value('price');
|
||||
return bcmul($price,$svip_store_rate,2);
|
||||
}
|
||||
//自定义
|
||||
if ($this->svip_price_type == 2) {
|
||||
return $this->getData('svip_price');
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* -----------------------------------------------------------------------------------------------------------------
|
||||
* 搜索器
|
||||
* -----------------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
public function searchMerCateIdAttr($query, $value)
|
||||
{
|
||||
$cate_ids = (StoreCategory::where('path','like','%/'.$value.'/%'))->column('store_category_id');
|
||||
$cate_ids[] = intval($value);
|
||||
$product_id = ProductCate::whereIn('mer_cate_id',$cate_ids)->column('product_id');
|
||||
$query->whereIn('Product.product_id',$product_id);
|
||||
}
|
||||
public function searchKeywordAttr($query, $value)
|
||||
{
|
||||
if (!$value) return;
|
||||
if (is_numeric($value)) {
|
||||
$query->whereLike("Product.store_name|Product.keyword|bar_code|Product.product_id", "%{$value}%");
|
||||
} else {
|
||||
$word = app()->make(VicWordService::class)->getWord($value);
|
||||
$query->where(function ($query) use ($word, $value) {
|
||||
foreach ($word as $item) {
|
||||
$query->whereOr('Product.store_name|Product.keyword', 'LIKE', "%$item%");
|
||||
}
|
||||
$query->order(Db::raw('REPLACE(Product.store_name,\'' . $value . '\',\'\')'));
|
||||
});
|
||||
}
|
||||
}
|
||||
public function searchStatusAttr($query, $value)
|
||||
{
|
||||
if($value === -1){
|
||||
$query->where('Product.status', 'in',[-1,-2]);
|
||||
}else {
|
||||
$query->where('Product.status',$value);
|
||||
}
|
||||
}
|
||||
public function searchCateIdAttr($query, $value)
|
||||
{
|
||||
$query->where('cate_id',$value);
|
||||
}
|
||||
public function searchCateIdsAttr($query, $value)
|
||||
{
|
||||
$query->whereIn('cate_id',$value);
|
||||
}
|
||||
public function searchIsShowAttr($query, $value)
|
||||
{
|
||||
$query->where('is_show',$value);
|
||||
}
|
||||
public function searchPidAttr($query, $value)
|
||||
{
|
||||
$cateId = app()->make(StoreCategoryRepository::class)->allChildren(intval($value));
|
||||
$query->whereIn('cate_id', $cateId);
|
||||
}
|
||||
public function searchStockAttr($query, $value)
|
||||
{
|
||||
$value ? $query->where('stock','<=', $value) : $query->where('stock', $value);
|
||||
}
|
||||
public function searchIsNewAttr($query, $value)
|
||||
{
|
||||
$query->where('is_new',$value);
|
||||
}
|
||||
public function searchPriceAttr($query, $value)
|
||||
{
|
||||
if(empty($value[0]) && !empty($value[1]))
|
||||
$query->where('price','<',$value[1]);
|
||||
if(!empty($value[0]) && empty($value[1]))
|
||||
$query->where('price','>',$value[0]);
|
||||
if(!empty($value[0]) && !empty($value[1]))
|
||||
$query->whereBetween('price',[$value[0],$value[1]]);
|
||||
}
|
||||
public function searchBrandIdAttr($query, $value)
|
||||
{
|
||||
$query->whereIn('brand_id',$value);
|
||||
}
|
||||
public function searchIsGiftBagAttr($query, $value)
|
||||
{
|
||||
$query->where('is_gift_bag',$value);
|
||||
}
|
||||
public function searchIsGoodAttr($query, $value)
|
||||
{
|
||||
$query->where('is_good',$value);
|
||||
}
|
||||
public function searchIsUsedAttr($query, $value)
|
||||
{
|
||||
$query->where('is_used',$value);
|
||||
}
|
||||
public function searchProductTypeAttr($query, $value)
|
||||
{
|
||||
$query->where('Product.product_type',$value);
|
||||
}
|
||||
public function searchSeckillStatusAttr($query, $value)
|
||||
{
|
||||
$product_id = (new StoreSeckillActiveDao())->getStatus($value)->column('product_id');
|
||||
$query->whereIn('Product.product_id',$product_id);
|
||||
}
|
||||
public function searchStoreNameAttr($query, $value)
|
||||
{
|
||||
$query->where('Product.store_name','like','%'.$value.'%');
|
||||
}
|
||||
public function searchMerStatusAttr($query, $value)
|
||||
{
|
||||
$query->where('mer_status',$value);
|
||||
}
|
||||
public function searchProductIdAttr($query, $value)
|
||||
{
|
||||
$query->where('Product.product_id',$value);
|
||||
}
|
||||
public function searchPriceOnAttr($query, $value)
|
||||
{
|
||||
$query->where('price','>=',$value);
|
||||
}
|
||||
public function searchPriceOffAttr($query, $value)
|
||||
{
|
||||
$query->where('price','<=',$value);
|
||||
}
|
||||
public function searchisFictiAttr($query, $value)
|
||||
{
|
||||
$query->where('type',$value);
|
||||
}
|
||||
public function searchGuaranteeTemplateIdAttr($query, $value)
|
||||
{
|
||||
$query->whereIn('guarantee_template_id',$value);
|
||||
}
|
||||
public function searchTempIdAttr($query, $value)
|
||||
{
|
||||
$query->whereIn('Product.temp_id',$value);
|
||||
}
|
||||
}
|
32
app/admin/model/store/ProductCate.php
Normal file
32
app/admin/model/store/ProductCate.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\model\store;
|
||||
|
||||
use think\Model;
|
||||
use app\admin\model\StoreCategory;
|
||||
|
||||
class ProductCate extends Model
|
||||
{
|
||||
protected $connection = 'shop';
|
||||
protected $table = 'eb_store_product_cate';
|
||||
|
||||
public function category()
|
||||
{
|
||||
return $this->hasOne(StoreCategory::class,'store_category_id','mer_cate_id')->field('store_category_id, cate_name');
|
||||
}
|
||||
|
||||
public function searchProductIdAttr($query, $value)
|
||||
{
|
||||
$query->where('product_id',$value);
|
||||
}
|
||||
}
|
59
app/admin/model/store/paramter/Parameter.php
Normal file
59
app/admin/model/store/paramter/Parameter.php
Normal file
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\admin\model\store\paramter;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class Parameter extends Model
|
||||
{
|
||||
protected $connection = 'shop';
|
||||
protected $pk = 'parameter_id';
|
||||
|
||||
|
||||
// public static function tablePk(): string
|
||||
// {
|
||||
// return 'parameter_id';
|
||||
// }
|
||||
|
||||
// public static function tableName(): string
|
||||
// {
|
||||
// return 'parameter';
|
||||
// }
|
||||
|
||||
public function searchTemplateIdAttr($query, $value)
|
||||
{
|
||||
$query->where('template_id',$value);
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO 搜索
|
||||
* @param $where
|
||||
*/
|
||||
public function getSearch(array $where)
|
||||
{
|
||||
foreach ($where as $key => $item) {
|
||||
if ($item !== '') {
|
||||
$keyArray[] = $key;
|
||||
$whereArr[$key] = $item;
|
||||
}
|
||||
}
|
||||
// var_dump($where);
|
||||
$class = get_called_class();
|
||||
if(empty($keyArray)){
|
||||
return $class::self();
|
||||
}else{
|
||||
return $class::withSearch($keyArray, $whereArr);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
129
app/admin/model/store/paramter/ParameterTemplate.php
Normal file
129
app/admin/model/store/paramter/ParameterTemplate.php
Normal file
@ -0,0 +1,129 @@
|
||||
<?php
|
||||
/**
|
||||
* @date :2023年03月9日
|
||||
* @author:刘孝全
|
||||
* @email:q8197264@126.com
|
||||
*
|
||||
* @ 商品参数列表与模板添加
|
||||
*/
|
||||
namespace app\admin\model\store\paramter;
|
||||
|
||||
use think\Model;
|
||||
use app\common\model\merchant\system\merchant\Merchant;
|
||||
use app\common\model\merchant\system\Relevance;
|
||||
// use app\admin\model\store\paramter\Parameter as ParameterModel;
|
||||
|
||||
class ParameterTemplate extends Model
|
||||
{
|
||||
|
||||
protected $connection = 'shop';
|
||||
|
||||
|
||||
public static function tablePk(): string
|
||||
{
|
||||
return 'template_id';
|
||||
}
|
||||
|
||||
public static function tableName(): string
|
||||
{
|
||||
return 'eb_parameter_template';
|
||||
}
|
||||
|
||||
public function merchant()
|
||||
{
|
||||
return $this->hasOne(Merchant::class,'mer_id','mer_id');
|
||||
}
|
||||
|
||||
public function parameter()
|
||||
{
|
||||
return $this->hasMany(Parameter::class,'template_id','template_id');
|
||||
}
|
||||
|
||||
public function cateId()
|
||||
{
|
||||
return $this->hasMany(Relevance::class,'left_id','template_id')->where('type', 'product_params_cate');
|
||||
}
|
||||
|
||||
public function searchCateIdAttr($query, $value)
|
||||
{
|
||||
$id = Relevance::where('right_id',$value)->where('type', 'product_params_cate')->column('left_id');
|
||||
$query->where('template_id','in',$id);
|
||||
}
|
||||
|
||||
public function searchTemplateNameAttr($query, $value)
|
||||
{
|
||||
$query->whereLike('template_name',"%{$value}%");
|
||||
}
|
||||
|
||||
public function searchTemplateIdsAttr($query, $value)
|
||||
{
|
||||
$query->whereIn('template_id',$value);
|
||||
}
|
||||
|
||||
public function searchMerIdAttr($query, $value)
|
||||
{
|
||||
$query->where('mer_id',$value);
|
||||
}
|
||||
|
||||
public function searchMerNameAttr($query, $value)
|
||||
{
|
||||
$value = Merchant::whereLike('mer_name',"%{$value}%")->coupon('mer_id');
|
||||
$query->whereIn('mer_id',$value);
|
||||
}
|
||||
|
||||
public function searchIsMerAttr($query, $value)
|
||||
{
|
||||
if ($value == 1) {
|
||||
$query->where('mer_id','>',0);
|
||||
} else {
|
||||
$query->where('mer_id',0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function getList($where, $page, $limit)
|
||||
{
|
||||
$paramterModel = new Parameter();
|
||||
$query = self::getSearch($where)->field('template_id,mer_id,template_name,sort,create_time')
|
||||
->with([
|
||||
'cateId' => function($query){
|
||||
$query->with(['category' =>function($query) {
|
||||
$query->field('store_category_id,cate_name');
|
||||
}]);
|
||||
},
|
||||
'merchant' => function($query) {
|
||||
$query->field('mer_id,mer_name');
|
||||
}
|
||||
// 'parameter' =>function($query){
|
||||
// $query->field('parameter_id,template_id,name,value,sort')->order('sort DESC');
|
||||
// }
|
||||
])
|
||||
->order('sort DESC,create_time DESC');
|
||||
$count = $query->count();
|
||||
$list = $query->page($page, $limit)->select();
|
||||
|
||||
return compact('count', 'list');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* TODO 搜索
|
||||
* @param $where
|
||||
*/
|
||||
public static function getSearch(array $where)
|
||||
{
|
||||
foreach ($where as $key => $item) {
|
||||
if ($item !== '') {
|
||||
$keyArray[] = $key;
|
||||
$whereArr[$key] = $item;
|
||||
}
|
||||
}
|
||||
|
||||
if(empty($keyArray)){
|
||||
return new self;
|
||||
}else{
|
||||
return self::withSearch($keyArray, $whereArr);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
35
app/admin/model/store/paramter/ParameterValue.php
Normal file
35
app/admin/model/store/paramter/ParameterValue.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\common\model\store\parameter;
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
|
||||
class ParameterValue extends BaseModel
|
||||
{
|
||||
|
||||
|
||||
public static function tablePk(): string
|
||||
{
|
||||
return 'parameter_attr_id';
|
||||
}
|
||||
|
||||
public static function tableName(): string
|
||||
{
|
||||
return 'parameter_value';
|
||||
}
|
||||
|
||||
public function parameter()
|
||||
{
|
||||
return $this->hasOne(Parameter::class,'parameter_id','parameter_id');
|
||||
}
|
||||
}
|
157
app/admin/model/user/UserMerchant.php
Normal file
157
app/admin/model/user/UserMerchant.php
Normal file
@ -0,0 +1,157 @@
|
||||
<?php
|
||||
|
||||
namespace app\common\dao\user;
|
||||
|
||||
|
||||
// use app\common\model\user\UserLabel;
|
||||
use think\db\BaseQuery;
|
||||
use think\Model;
|
||||
|
||||
/**
|
||||
* Class UserMerchant
|
||||
*/
|
||||
class UserMerchant extends Model
|
||||
{
|
||||
/**
|
||||
* @return string|null
|
||||
* @author xaboy
|
||||
*/
|
||||
public static function tablePk(): ?string
|
||||
{
|
||||
return 'user_merchant_id';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @author xaboy
|
||||
* @day 2020/10/20
|
||||
*/
|
||||
public static function tableName(): string
|
||||
{
|
||||
return 'user_merchant';
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->hasOne(User::class, 'uid', 'uid');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $value
|
||||
* @return array
|
||||
* @author xaboy
|
||||
* @day 2020-05-09
|
||||
*/
|
||||
public function getLabelIdAttr($value)
|
||||
{
|
||||
return $value ? explode(',', $value) : [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $value
|
||||
* @return string
|
||||
* @author xaboy
|
||||
* @day 2020-05-09
|
||||
*/
|
||||
public function setLabelIdAttr($value)
|
||||
{
|
||||
return implode(',', $value);
|
||||
}
|
||||
|
||||
public function getAuthLabelAttr()
|
||||
{
|
||||
return app()->make(UserLabel::class)->whereIn('label_id', $this->label_id)->where('mer_id', $this->mer_id)->where('type', 1)->column('label_id');
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @author xaboy
|
||||
* @day 2020/10/20
|
||||
*/
|
||||
protected function getModel(): string
|
||||
{
|
||||
return UserMerchant::class;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $uid
|
||||
* @param $mer_id
|
||||
* @return bool
|
||||
* @author xaboy
|
||||
* @day 2020/10/20
|
||||
*/
|
||||
public function isMerUser($uid, $mer_id)
|
||||
{
|
||||
return $this->existsWhere(compact('uid', 'mer_id'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $uid
|
||||
* @param $mer_id
|
||||
* @return int
|
||||
* @throws \think\db\exception\DbException
|
||||
* @author xaboy
|
||||
* @day 2020/10/20
|
||||
*/
|
||||
public function updateLastTime($uid, $mer_id)
|
||||
{
|
||||
return UserMerchant::getDB()->where(compact('uid', 'mer_id'))->update([
|
||||
'last_time' => date('Y-m-d H:i:s')
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $where
|
||||
* @return mixed
|
||||
* @author xaboy
|
||||
* @day 2020/10/20
|
||||
*/
|
||||
public function search(array $where)
|
||||
{
|
||||
return UserMerchant::getDB()->alias('A')->leftJoin('User B', 'A.uid = B.uid')
|
||||
->when(isset($where['mer_id']) && $where['mer_id'] !== '', function ($query) use ($where) {
|
||||
$query->where('A.mer_id', $where['mer_id']);
|
||||
})->when(isset($where['nickname']) && $where['nickname'], function (BaseQuery $query) use ($where) {
|
||||
return $query->where('B.nickname', 'like', '%' . $where['nickname'] . '%');
|
||||
})->when(isset($where['sex']) && $where['sex'] !== '', function (BaseQuery $query) use ($where) {
|
||||
return $query->where('B.sex', intval($where['sex']));
|
||||
})->when(isset($where['is_promoter']) && $where['is_promoter'] !== '', function (BaseQuery $query) use ($where) {
|
||||
return $query->where('B.is_promoter', $where['is_promoter']);
|
||||
})->when(isset($where['uids']), function (BaseQuery $query) use ($where) {
|
||||
return $query->whereIn('A.uid', $where['uids']);
|
||||
})->when(isset($where['user_time_type']) && $where['user_time_type'] !== '' && $where['user_time'] != '', function ($query) use ($where) {
|
||||
if ($where['user_time_type'] == 'visit') {
|
||||
getModelTime($query, $where['user_time'], 'A.last_time');
|
||||
}
|
||||
if ($where['user_time_type'] == 'add_time') {
|
||||
getModelTime($query, $where['user_time'], 'A.create_time');
|
||||
}
|
||||
})->when(isset($where['pay_count']) && $where['pay_count'] !== '', function ($query) use ($where) {
|
||||
if ($where['pay_count'] == -1) {
|
||||
$query->where('A.pay_num', 0);
|
||||
} else {
|
||||
$query->where('A.pay_num', '>', $where['pay_count']);
|
||||
}
|
||||
})->when(isset($where['label_id']) && $where['label_id'] !== '', function (BaseQuery $query) use ($where) {
|
||||
return $query->whereRaw('CONCAT(\',\',A.label_id,\',\') LIKE \'%,' . $where['label_id'] . ',%\'');
|
||||
})->when(isset($where['user_type']) && $where['user_type'] !== '', function (BaseQuery $query) use ($where) {
|
||||
return $query->where('B.user_type', $where['user_type']);
|
||||
})->where('A.status', 1);
|
||||
}
|
||||
|
||||
public function numUserIds($mer_id, $min, $max = null)
|
||||
{
|
||||
return UserMerchant::getDB()->where('mer_id', $mer_id)->where('pay_num', '>=', $min)->when(!is_null($max), function ($query) use ($max) {
|
||||
$query->where('pay_num', '<=', $max);
|
||||
})->group('uid')->column('uid');
|
||||
}
|
||||
|
||||
public function priceUserIds($mer_id, $min, $max = null)
|
||||
{
|
||||
return UserMerchant::getDB()->where('mer_id', $mer_id)->where('pay_price', '>=', $min)->when(!is_null($max), function ($query) use ($max, $min) {
|
||||
$query->where('pay_price', $min == $max ? '<=' : '<', $max);
|
||||
})->group('uid')->column('uid');
|
||||
}
|
||||
}
|
@ -1,14 +1,11 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @date :2023年03月2日
|
||||
* @author:刘孝全
|
||||
* @email:q8197264@126.com
|
||||
*
|
||||
* @ 商户菜单路由
|
||||
*/
|
||||
use think\facade\Route;
|
||||
use app\common\middleware\AdminAuthMiddleware;
|
||||
use app\common\middleware\AdminTokenMiddleware;
|
||||
|
@ -44,6 +44,41 @@ Route::group(function(){
|
||||
'_auth' => true,
|
||||
]);
|
||||
|
||||
//入驻申请列表
|
||||
Route::group('merchant/intention', function () {
|
||||
Route::get('index', '/index')->name('systemMerchantIntentionLst')->option([
|
||||
'_alias' => '列表',
|
||||
]);
|
||||
|
||||
Route::get('lst', '/lst')->name('systemMerchantIntentionLst')->option([
|
||||
'_alias' => '列表',
|
||||
]);
|
||||
Route::post('status', '/switchStatus')->name('systemMerchantIntentionStatus')->option([
|
||||
'_alias' => '审核',
|
||||
]);
|
||||
Route::delete('del', '/del')->name('systemMerchantIntentionDelete')->option([
|
||||
'_alias' => '删除',
|
||||
]);
|
||||
Route::get('markform', '/markform')->name('systemMerchantIntentionMarkForm')->option([
|
||||
'_alias' => '备注',
|
||||
'_auth' => false,
|
||||
'_form' => 'systemMerchantIntentionMark',
|
||||
]);
|
||||
Route::get('statusform', '/statusForm')->name('systemMerchantIntentionStatusForm')->option([
|
||||
'_alias' => '申请商户',
|
||||
'_auth' => false,
|
||||
'_form' => 'systemMerchantIntentionStatus',
|
||||
]);
|
||||
|
||||
Route::post('mark', '/setmark')->name('systemMerchantIntentionMark')->option([
|
||||
'_alias' => '备注',
|
||||
]);
|
||||
Route::get('excel', '/excel');
|
||||
})->prefix('merchant.system.merchant.MerchantIntention')->option([
|
||||
'_path' => '/merchant/application',
|
||||
'_auth' => true,
|
||||
]);
|
||||
|
||||
// 店铺类型
|
||||
Route::group('/merchant/type',function(){
|
||||
Route::get('index', '/index')->name('systemMerchantTypeLst')->option([
|
||||
@ -91,22 +126,33 @@ Route::group(function(){
|
||||
|
||||
//店铺保证金
|
||||
Route::group('/margin', function(){
|
||||
|
||||
// 主页
|
||||
Route::get('index', '/index')->name('systemMerchantMarginIndex'
|
||||
)->option([
|
||||
'_alias'=>'主页列表 ',
|
||||
]);
|
||||
|
||||
//缴纳记录
|
||||
Route::get('lst', '/lst')->name('systemMerchantMarginLst')->option([
|
||||
'_alias' => '缴纳记录',
|
||||
]);
|
||||
//扣费记录
|
||||
Route::get('list/:id', '/getMarginLst')->name('systemMarginList')->option([
|
||||
'_alias' => '扣费记录',
|
||||
]);
|
||||
//扣费记录页
|
||||
Route::get('read', '/GetMarginLstForm')->name('systemMarginList')->option([
|
||||
'_alias' => '扣费记录页',
|
||||
]);
|
||||
//扣费记录帐单接口
|
||||
Route::get('reductlst', '/GetMarginLst')->name('systemMarginList')->option([
|
||||
'_alias' => '扣费记录',
|
||||
]);
|
||||
|
||||
//扣除保证金
|
||||
Route::get('set/:id/form', '/setMarginForm')->name('systemMarginSetForm')->option([
|
||||
Route::get('form', '/setMarginForm')->name('systemMarginSetForm')->option([
|
||||
'_alias' => '扣除保证金表单',
|
||||
'_auth' => false,
|
||||
'_form' => 'systemMarginSet',
|
||||
]);
|
||||
Route::post('set', '/setMargin')->name('systemMarginSet')->option([
|
||||
Route::post('reduct', '/setMargin')->name('systemMarginSet')->option([
|
||||
'_alias' => '扣除保证金',
|
||||
]);
|
||||
})->prefix('merchant.system.merchant.MerchantMargin')->option([
|
||||
|
@ -1,82 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
use think\facade\Route;
|
||||
use app\common\middleware\AdminAuthMiddleware;
|
||||
use app\common\middleware\AdminTokenMiddleware;
|
||||
use app\common\middleware\AllowOriginMiddleware;
|
||||
use app\common\middleware\LogMiddleware;
|
||||
|
||||
Route::group(function () {
|
||||
|
||||
//权限管理
|
||||
// Route::group('system/menu', function () {
|
||||
// Route::get('lst', '/getList')->name('systemMenuGetLst')->option([
|
||||
// '_alias' => '平台菜单/权限列表',
|
||||
// ]);
|
||||
// Route::get('create/form', '/createForm')->name('systemMenuCreateForm')->option([
|
||||
// '_alias' => '平台菜单/权限添加表单',
|
||||
// '_auth' => false,
|
||||
// '_form' => 'systemMenuCreate',
|
||||
// ]);
|
||||
// Route::get('update/form/:id', '/updateForm')->name('systemMenuUpdateForm')->option([
|
||||
// '_alias' => '平台菜单/权限编辑表单',
|
||||
// '_auth' => false,
|
||||
// '_form' => 'systemMenuUpdate',
|
||||
// ]);
|
||||
// Route::post('create', '/create')->name('systemMenuCreate')->option([
|
||||
// '_alias' => '平台菜单/权限添加',
|
||||
// ]);
|
||||
// Route::post('update/:id', '/update')->name('systemMenuUpdate')->option([
|
||||
// '_alias' => '平台菜单/权限编辑',
|
||||
// ]);
|
||||
// Route::delete('delete/:id', '/delete')->name('systemMenuDelete')->option([
|
||||
// '_alias' => '平台菜单/权限删除',
|
||||
// ]);
|
||||
// })->prefix('admin.system.auth.Menu')->option([
|
||||
// '_path' => '/setting/menu',
|
||||
// '_auth' => true,
|
||||
// ]);
|
||||
|
||||
//商户权限管理
|
||||
Route::group('merchant/menu', function () {
|
||||
Route::get('lst', '/getList')->name('systemMerchantMenuGetLst')->append(['merchant' => 1])->option([
|
||||
'_alias' => '商户菜单/权限列表',
|
||||
]);
|
||||
Route::get('create/form', '/createForm')->name('systemMerchantMenuCreateForm')->append(['merchant' => 1])->option([
|
||||
'_alias' => '商户菜单/权限添加表单',
|
||||
'_auth' => false,
|
||||
'_form' => 'systemMerchantMenuCreate',
|
||||
]);
|
||||
Route::get('update/form/:id', '/updateForm')->name('systemMerchantMenuUpdateForm')->append(['merchant' => 1])->option([
|
||||
'_alias' => '商户菜单/权限编辑表单',
|
||||
'_auth' => false,
|
||||
'_form' => 'systemMerchantMenuUpdate',
|
||||
]);
|
||||
Route::post('create', '/create')->name('systemMerchantMenuCreate')->append(['merchant' => 1])->option([
|
||||
'_alias' => '商户菜单/权限添加',
|
||||
]);
|
||||
Route::post('update/:id', '/update')->name('systemMerchantMenuUpdate')->append(['merchant' => 1])->option([
|
||||
'_alias' => '商户菜单/权限编辑',
|
||||
]);
|
||||
Route::delete('delete/:id', '/delete')->name('systemMerchantMenuDelete')->append(['merchant' => 1])->option([
|
||||
'_alias' => '商户菜单/权限删除',
|
||||
]);
|
||||
})->prefix('admin.system.auth.Menu')->option([
|
||||
'_path' => '/merchant/system',
|
||||
'_auth' => true,
|
||||
]);
|
||||
|
||||
});
|
||||
// ->middleware(AllowOriginMiddleware::class)
|
||||
// ->middleware(AdminTokenMiddleware::class, true)
|
||||
// ->middleware(AdminAuthMiddleware::class)
|
||||
// ->middleware(LogMiddleware::class);
|
@ -1,246 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
use think\facade\Route;
|
||||
|
||||
Route::group(function () {
|
||||
|
||||
//商户分类
|
||||
Route::group('system/merchant', function () {
|
||||
Route::get('category/lst', '/lst')->name('systemMerchantCategoryLst')->option([
|
||||
'_alias' => '商户分类列表',
|
||||
]);
|
||||
Route::get('category_lst', '/lst')->option([
|
||||
'_alias' => '商户分类列表',
|
||||
'_auth' => false,
|
||||
]);
|
||||
Route::post('category', '/create')->name('systemMerchantCategoryCreate')->option([
|
||||
'_alias' => '商户分类添加',
|
||||
]);
|
||||
Route::get('category/form', '/createForm')->name('systemMerchantCategoryCreateForm')->option([
|
||||
'_alias' => '商户分类添加表单',
|
||||
'_auth' => false,
|
||||
'_form' => 'systemMerchantCategoryCreate',
|
||||
]);
|
||||
Route::delete('category/:id', '/delete')->name('systemMerchantCategoryDelete')->option([
|
||||
'_alias' => '商户分类删除',
|
||||
]);
|
||||
Route::post('category/:id', '/update')->name('systemMerchantCategoryUpdate')->option([
|
||||
'_alias' => '商户分类编辑',
|
||||
]);
|
||||
Route::get('category/form/:id', '/updateForm')->name('systemMerchantCategoryUpdateForm')->option([
|
||||
'_alias' => '商户分类编辑表单',
|
||||
'_auth' => false,
|
||||
'_form' => 'systemMerchantCategoryUpdate',
|
||||
]);
|
||||
Route::get('category/options', '/getOptions')->option([
|
||||
'_alias' => '商户分类筛选',
|
||||
'_auth' => false,
|
||||
]);
|
||||
})->prefix('admin.system.merchant.MerchantCategory')->option([
|
||||
'_path' => '/merchant/classify',
|
||||
'_auth' => true,
|
||||
]);
|
||||
|
||||
//申请列表
|
||||
Route::group('merchant/intention', function () {
|
||||
Route::get('lst', '/lst')->name('systemMerchantIntentionLst')->option([
|
||||
'_alias' => '列表',
|
||||
]);
|
||||
Route::post('status/:id', '/switchStatus')->name('systemMerchantIntentionStatus')->option([
|
||||
'_alias' => '审核',
|
||||
]);
|
||||
Route::delete('delete/:id', '/delete')->name('systemMerchantIntentionDelete')->option([
|
||||
'_alias' => '删除',
|
||||
]);
|
||||
Route::get('mark/:id/form', '/form')->name('systemMerchantIntentionMarkForm')->option([
|
||||
'_alias' => '备注',
|
||||
'_auth' => false,
|
||||
'_form' => 'systemMerchantIntentionMark',
|
||||
]);
|
||||
Route::get('status/:id/form', '/statusForm')->name('systemMerchantIntentionStatusForm')->option([
|
||||
'_alias' => '申请商户',
|
||||
'_auth' => false,
|
||||
'_form' => 'systemMerchantIntentionStatus',
|
||||
]);
|
||||
|
||||
Route::post('mark/:id', '/mark')->name('systemMerchantIntentionMark')->option([
|
||||
'_alias' => '备注',
|
||||
]);
|
||||
Route::get('excel', '/excel');
|
||||
})->prefix('admin.system.merchant.MerchantIntention')->option([
|
||||
'_path' => '/merchant/application',
|
||||
'_auth' => true,
|
||||
]);
|
||||
|
||||
//商户管理
|
||||
Route::group('system/merchant', function () {
|
||||
Route::get('create/form', '.Merchant/createForm')->name('systemMerchantCreateForm')->option([
|
||||
'_alias' => '商户列表',
|
||||
]);
|
||||
Route::get('count', '.Merchant/count')->name('systemMerchantCount')->option([
|
||||
'_alias' => '商户列表统计',
|
||||
]);
|
||||
Route::get('lst', '.Merchant/lst')->name('systemMerchantLst')->option([
|
||||
'_alias' => '商户列表',
|
||||
]);
|
||||
Route::post('create', '.Merchant/create')->name('systemMerchantCreate')->option([
|
||||
'_alias' => '商户添加',
|
||||
]);
|
||||
Route::get('update/form/:id', '.Merchant/updateForm')->name('systemMerchantUpdateForm')->option([
|
||||
'_alias' => '商户编辑表单',
|
||||
'_auth' => false,
|
||||
'_form' => 'systemMerchantUpdate',
|
||||
]);
|
||||
Route::post('update/:id', '.Merchant/update')->name('systemMerchantUpdate')->option([
|
||||
'_alias' => '商户编辑',
|
||||
]);
|
||||
Route::post('status/:id', '.Merchant/switchStatus')->name('systemMerchantStatus')->option([
|
||||
'_alias' => '商户修改推荐',
|
||||
]);
|
||||
Route::post('close/:id', '.Merchant/switchClose')->name('systemMerchantClose')->option([
|
||||
'_alias' => '商户开启/关闭',
|
||||
]);
|
||||
Route::delete('delete/:id', '.Merchant/delete')->name('systemMerchantDelete')->option([
|
||||
'_alias' => '商户删除',
|
||||
]);
|
||||
Route::post('password/:id', '.MerchantAdmin/password')->name('systemMerchantAdminPassword')->option([
|
||||
'_alias' => '商户修改密码',
|
||||
]);
|
||||
Route::get('password/form/:id', '.MerchantAdmin/passwordForm')->name('systemMerchantAdminPasswordForm')->option([
|
||||
'_alias' => '商户修改密码表单',
|
||||
'_auth' => false,
|
||||
'_form' => 'systemMerchantAdminPassword',
|
||||
]);
|
||||
Route::post('login/:id', '.Merchant/login')->name('systemMerchantLogin')->option([
|
||||
'_alias' => '商户登录',
|
||||
]);
|
||||
Route::get('changecopy/:id/form', '.Merchant/changeCopyNumForm')->name('systemMerchantChangeCopyForm')->option([
|
||||
'_alias' => '修改采集商品次数表单',
|
||||
'_auth' => false,
|
||||
'_form' => 'systemMerchantChangeCopy',
|
||||
]);
|
||||
Route::post('changecopy/:id', '.Merchant/changeCopyNum')->name('systemMerchantChangeCopy')->option([
|
||||
'_alias' => '修改采集商品次数',
|
||||
]);
|
||||
})->prefix('admin.system.merchant')->option([
|
||||
'_path' => '/merchant/list',
|
||||
'_auth' => true,
|
||||
'_append'=> [
|
||||
[
|
||||
'_name' =>'uploadImage',
|
||||
'_path' =>'/merchant/list',
|
||||
'_alias' => '上传图片',
|
||||
'_auth' => true,
|
||||
],
|
||||
[
|
||||
'_name' =>'systemAttachmentLst',
|
||||
'_path' =>'/merchant/list',
|
||||
'_alias' => '图片列表',
|
||||
'_auth' => true,
|
||||
],
|
||||
]
|
||||
]);
|
||||
|
||||
// 店铺类型
|
||||
Route::group('merchant/type', function () {
|
||||
Route::get('lst', '/lst')->name('systemMerchantTypeLst')->option([
|
||||
'_alias' => '列表',
|
||||
]);
|
||||
Route::post('create', '/create')->name('systemMerchantTypeCreate')->option([
|
||||
'_alias' => '添加',
|
||||
]);
|
||||
Route::post('update/:id', '/update')->name('systemMerchantTypeUpdate')->option([
|
||||
'_alias' => '编辑',
|
||||
]);
|
||||
Route::delete('delete/:id', '/delete')->name('systemMerchantTypeDelete')->option([
|
||||
'_alias' => '删除',
|
||||
]);
|
||||
Route::get('mark/:id', '/markForm')->name('systemMerchantTypeMarkForm')->option([
|
||||
'_alias' => '备注',
|
||||
'_auth' => false,
|
||||
'_form' => 'systemMerchantTypeMark',
|
||||
]);
|
||||
Route::post('mark/:id', '/mark')->name('systemMerchantTypeMark')->option([
|
||||
'_alias' => '备注',
|
||||
]);
|
||||
|
||||
Route::get('detail/:id', '/detail')->name('systemMerchantTypeDetail')->option([
|
||||
'_alias' => '备注',
|
||||
]);
|
||||
|
||||
Route::get('options', '/options')->option([
|
||||
'_alias' => '筛选',
|
||||
'_auth' => false,
|
||||
]);
|
||||
Route::get('mer_auth', '/mer_auth')->option([
|
||||
'_alias' => '权限',
|
||||
'_auth' => false,
|
||||
]);
|
||||
})->prefix('admin.system.merchant.MerchantType')->option([
|
||||
'_path' => '/merchant/type',
|
||||
'_auth' => true,
|
||||
]);
|
||||
|
||||
//保证金
|
||||
Route::group('margin', function () {
|
||||
//缴纳记录
|
||||
Route::get('lst', 'merchant.MerchantMargin/lst')->name('systemMerchantMarginLst')->option([
|
||||
'_alias' => '缴纳记录',
|
||||
]);
|
||||
//扣费记录
|
||||
Route::get('list/:id', 'merchant.MerchantMargin/getMarginLst')->name('systemMarginList')->option([
|
||||
'_alias' => '扣费记录',
|
||||
]);
|
||||
|
||||
//扣除保证金
|
||||
Route::get('set/:id/form', 'merchant.MerchantMargin/setMarginForm')->name('systemMarginSetForm')->option([
|
||||
'_alias' => '扣除保证金表单',
|
||||
'_auth' => false,
|
||||
'_form' => 'systemMarginSet',
|
||||
]);
|
||||
Route::post('set', 'merchant.MerchantMargin/setMargin')->name('systemMarginSet')->option([
|
||||
'_alias' => '扣除保证金',
|
||||
]);
|
||||
|
||||
//退款申请
|
||||
Route::get('refund/lst', 'financial.Financial/getMarginLst')->name('systemMarginRefundList')->option([
|
||||
'_alias' => '退款申请列表',
|
||||
]);
|
||||
Route::get('refund/show/:id', 'financial.Financial/refundShow')->name('systemMarginRefundShow')->option([
|
||||
'_alias' => '退款申请详情',
|
||||
]);
|
||||
|
||||
//审核
|
||||
Route::get('refund/status/:id/form', 'financial.Financial/statusForm')->name('systemMarginRefundSwitchStatusForm')->option([
|
||||
'_alias' => '审核表单',
|
||||
'_auth' => false,
|
||||
'_form' => 'systemMarginRefundSwitchStatus',
|
||||
]);
|
||||
Route::post('refund/status/:id', 'financial.Financial/switchStatus')->name('systemMarginRefundSwitchStatus')->append(['type' => 1])->option([
|
||||
'_alias' => '审核',
|
||||
]);
|
||||
|
||||
//备注
|
||||
Route::get('refund/mark/:id/form', 'financial.Financial/markMarginForm')->name('systemMarginRefundMarkForm')->option([
|
||||
'_alias' => '备注表单',
|
||||
'_auth' => false,
|
||||
'_form' => 'systemMarginRefundMark',
|
||||
]);
|
||||
Route::post('refund/mark/:id', 'financial.Financial/mark')->name('systemMarginRefundMark')->option([
|
||||
'_alias' => '备注',
|
||||
]);
|
||||
})->prefix('admin.system.')->option([
|
||||
'_path' => '/merchant/deposit_list',
|
||||
'_auth' => true,
|
||||
]);
|
||||
|
||||
});
|
304
app/admin/route/product.php
Normal file
304
app/admin/route/product.php
Normal file
@ -0,0 +1,304 @@
|
||||
<?php
|
||||
/**
|
||||
* @date :2023年03月9日
|
||||
* @author:刘孝全
|
||||
* @email:q8197264@126.com
|
||||
*
|
||||
* @ 商户管理路由
|
||||
*/
|
||||
use think\facade\Route;
|
||||
|
||||
Route::group(function () {
|
||||
|
||||
//参数模板
|
||||
Route::group('/product/params', function () {
|
||||
Route::get('index', '/index')->name('merchantStoreParameterTemplateLst')->option([
|
||||
'_alias' => '列表',
|
||||
]);
|
||||
Route::get('detail/:id', '/detail')->name('merchantStoreParameterTemplateDetail')->option([
|
||||
'_alias' => '详情',
|
||||
]);
|
||||
Route::delete('delete/:id', '/delete')->name('merchantStoreParameterTemplateDelete')->option([
|
||||
'_alias' => '删除',
|
||||
]);
|
||||
Route::get('add', '/add')->name('merchantStoreParameterTemplateCreate')->option([
|
||||
'_alias' => '添加',
|
||||
]);
|
||||
Route::post('update/:id', '/update')->name('merchantStoreParameterTemplateUpdate')->option([
|
||||
'_alias' => '编辑',
|
||||
]);
|
||||
Route::get('select', '/select')->option([
|
||||
'_alias' => '筛选列表',
|
||||
'_auth' => false,
|
||||
]);
|
||||
// Route::get('temp/show', '/show')->option([
|
||||
// '_alias' => '参数',
|
||||
// '_auth' => false,
|
||||
// ]);
|
||||
})->prefix('product.Parameter')->option([
|
||||
'_path' => '/product/params',
|
||||
'_auth' => true,
|
||||
]);
|
||||
|
||||
//商品
|
||||
Route::group('store/product', function () {
|
||||
Route::get('config', '/config')->option([
|
||||
'_alias' => '配置',
|
||||
'_auth' => false,
|
||||
]);
|
||||
Route::get('lst_filter', '/getStatusFilter')->name('merchantStoreProductLstFilter')->option([
|
||||
'_alias' => '头部统计',
|
||||
]);
|
||||
Route::get('lst', '/lst')->name('merchantStoreProductLst')->option([
|
||||
'_alias' => '列表',
|
||||
]);
|
||||
Route::get('list', '/lst')->option([
|
||||
'_alias' => '列表',
|
||||
'_auth' => false,
|
||||
]);
|
||||
Route::post('create', '/create')->name('merchantStoreProductCreate')->option([
|
||||
'_alias' => '添加',
|
||||
]);
|
||||
Route::get('detail/:id', '/detail')->name('merchantStoreProductDetail')->option([
|
||||
'_alias' => '详情',
|
||||
]);
|
||||
Route::get('temp_key', '/temp_key')->name('merchantStoreProductTempKey')->option([
|
||||
'_alias' => '上传视频配置',
|
||||
]);
|
||||
Route::post('update/:id', '/update')->name('merchantStoreProductUpdate')->option([
|
||||
'_alias' => '编辑',
|
||||
]);
|
||||
Route::post('free_trial/:id', '/freeTrial')->name('merchantStoreProductFreeTrial')->option([
|
||||
'_alias' => '免审编辑',
|
||||
]);
|
||||
Route::delete('delete/:id', '/delete')->name('merchantStoreProductDelete')->option([
|
||||
'_alias' => '删除',
|
||||
]);
|
||||
Route::delete('destory/:id', '/destory')->name('merchantStoreProductDestory')->option([
|
||||
'_alias' => '加入回收站',
|
||||
]);
|
||||
Route::post('restore/:id', '/restore')->name('merchantStoreProductRestore')->option([
|
||||
'_alias' => '恢复',
|
||||
]);
|
||||
Route::post('status/:id', '/switchStatus')->name('merchantStoreProductSwitchStatus')->option([
|
||||
'_alias' => '上下架',
|
||||
]);
|
||||
Route::post('batch_status', '/batchShow')->name('merchantStoreProductSwitchBatchStatus')->option([
|
||||
'_alias' => '批量上下架',
|
||||
]);
|
||||
Route::post('batch_temp', '/batchTemplate')->name('merchantStoreProductSwitchBatchTemplate')->option([
|
||||
'_alias' => '批量设置运费模板',
|
||||
]);
|
||||
Route::post('batch_labels', '/batchLabels')->name('merchantStoreProductSwitchBatchLabels')->option([
|
||||
'_alias' => '批量设置标签',
|
||||
]);
|
||||
Route::post('batch_hot', '/batchHot')->name('merchantStoreProductSwitchBatchHot')->option([
|
||||
'_alias' => '批量设置推荐',
|
||||
]);
|
||||
Route::post('batch_ext', '/batchExtension')->name('merchantStoreProductSwitchBatchExtension')->option([
|
||||
'_alias' => '批量设置推荐',
|
||||
]);
|
||||
Route::post('batch_svip', '/batchSvipType')->name('merchantStoreProductSwitchBatchSvipType')->option([
|
||||
'_alias' => '批量设置会员价',
|
||||
]);
|
||||
Route::post('sort/:id', '/updateSort')->name('merchantStoreProductUpdateSort')->option([
|
||||
'_alias' => '排序',
|
||||
]);
|
||||
Route::post('preview', '/preview')->name('merchantStoreProductPreview')->option([
|
||||
'_alias' => '预览',
|
||||
]);
|
||||
Route::post('labels/:id', '/setLabels')->name('merchantStoreProductLabels')->option([
|
||||
'_alias' => '标签',
|
||||
]);
|
||||
Route::get('attr_value/:id', '/getAttrValue')->name('merchantStoreProductAttrValue')->option([
|
||||
'_alias' => '获取规格',
|
||||
]);
|
||||
})->prefix('merchant.store.product.Product')->option([
|
||||
'_path' => '/product/list',
|
||||
'_auth' => true,
|
||||
'_append'=> [
|
||||
[
|
||||
'_name' =>'merchantUploadImage',
|
||||
'_path' =>'/product/list',
|
||||
'_alias' => '上传图片',
|
||||
'_auth' => true,
|
||||
],
|
||||
[
|
||||
'_name' =>'merchantAttachmentLst',
|
||||
'_path' =>'/product/list',
|
||||
'_alias' => '图片列表',
|
||||
'_auth' => true,
|
||||
],
|
||||
|
||||
]
|
||||
]);
|
||||
|
||||
|
||||
//商品分类
|
||||
Route::group('store/category', function () {
|
||||
Route::get('create/form', '/createForm')->name('merchantStoreCategoryCreateForm')->option([
|
||||
'_alias' => '添加表单',
|
||||
'_auth' => false,
|
||||
'_form' => 'merchantStoreCategoryCreate',
|
||||
]);
|
||||
Route::get('update/form/:id', '/updateForm')->name('merchantStoreCategoryUpdateForm')->option([
|
||||
'_alias' => '编辑表单',
|
||||
'_auth' => false,
|
||||
'_form' => 'merchantStoreCategoryUpdate',
|
||||
]);
|
||||
Route::post('update/:id', '/update')->name('merchantStoreCategoryUpdate')->option([
|
||||
'_alias' => '编辑',
|
||||
]);
|
||||
Route::get('lst', '/lst')->name('merchantStoreCategoryLst')->option([
|
||||
'_alias' => '列表',
|
||||
]);
|
||||
Route::get('detail/:id', '/detail')->name('merchantStoreCategoryDtailt')->option([
|
||||
'_alias' => '详情',
|
||||
]);
|
||||
Route::post('create', '/create')->name('merchantStoreCategoryCreate')->option([
|
||||
'_alias' => '添加',
|
||||
]);
|
||||
Route::delete('delete/:id', '/delete')->name('merchantStoreCategoryDelete')->option([
|
||||
'_alias' => '删除',
|
||||
]);
|
||||
Route::post('status/:id', '/switchStatus')->name('merchantStoreCategorySwitchStatus')->option([
|
||||
'_alias' => '修改状态',
|
||||
]);
|
||||
Route::get('list', '/getList')->option([
|
||||
'_alias' => '筛选',
|
||||
'_auth' => false,
|
||||
])->append(['type' => 1]);
|
||||
Route::get('select', '/getStoreCategoryList')->option([
|
||||
'_alias' => '',
|
||||
'_auth' => false,
|
||||
]);
|
||||
Route::get('brandlist', '/BrandList')->option([
|
||||
'_alias' => '品牌列表',
|
||||
'_auth' => false,
|
||||
]);
|
||||
})->prefix('product.StoreCategory')->option([
|
||||
'_path' => '/product/classify',
|
||||
'_auth' => true,
|
||||
'_append'=> [
|
||||
[
|
||||
'_name' =>'merchantUploadImage',
|
||||
'_path' =>'/product/classify',
|
||||
'_alias' => '上传图片',
|
||||
'_auth' => true,
|
||||
],
|
||||
[
|
||||
'_name' =>'merchantAttachmentLst',
|
||||
'_path' =>'/product/classify',
|
||||
'_alias' => '图片列表',
|
||||
'_auth' => true,
|
||||
],
|
||||
]
|
||||
]);
|
||||
|
||||
//品牌分类
|
||||
Route::group('store/brand/category', function () {
|
||||
Route::get('create/form', '/createForm')->name('systemStoreBrandCategoryCreateForm')->option([
|
||||
'_alias' => '添加表单',
|
||||
'_auth' => false,
|
||||
'_form' => 'systemStoreBrandCategoryCreate',
|
||||
]);
|
||||
Route::get('update/form/:id', '/updateForm')->name('systemStoreBrandCategoryUpdateForm')->option([
|
||||
'_alias' => '编辑表单',
|
||||
'_auth' => false,
|
||||
'_form' => 'systemStoreBrandCategoryUpdate',
|
||||
]);
|
||||
Route::post('update/:id', '/update')->name('systemStoreBrandCategoryUpdate')->option([
|
||||
'_alias' => '编辑',
|
||||
]);
|
||||
Route::get('lst', '/lst')->name('systemStoreBrandCategoryLst')->option([
|
||||
'_alias' => '列表',
|
||||
]);
|
||||
Route::get('detail/:id', '/detail')->name('systemStoreBrandCategoryDtailt')->option([
|
||||
'_alias' => '详情',
|
||||
]);
|
||||
Route::post('create', '/create')->name('systemStoreBrandCategoryCreate')->option([
|
||||
'_alias' => '添加',
|
||||
]);
|
||||
Route::delete('delete/:id', '/delete')->name('systemStoreBrandCategoryDelete')->option([
|
||||
'_alias' => '删除',
|
||||
]);
|
||||
Route::post('status/:id', '/switchStatus')->name('systemStoreBrandCategorySwitchStatus')->option([
|
||||
'_alias' => '修改状态',
|
||||
]);
|
||||
})->prefix('admin.store.StoreBrandCategory')->option([
|
||||
'_path' => '/product/band/brandClassify',
|
||||
'_auth' => true,
|
||||
]);
|
||||
|
||||
//品牌
|
||||
Route::group('store/brand', function () {
|
||||
Route::get('create/form', '/createForm')->name('systemStoreBrandCreateForm')->option([
|
||||
'_alias' => '添加表单',
|
||||
'_auth' => false,
|
||||
'_form' => 'systemStoreBrandCreate',
|
||||
]);
|
||||
Route::get('update/form/:id', '/updateForm')->name('systemStoreBrandUpdateForm')->option([
|
||||
'_alias' => '编辑表单',
|
||||
'_auth' => false,
|
||||
'_form' => 'systemStoreBrandUpdate',
|
||||
]);
|
||||
Route::get('lst', '/lst')->name('systemStoreBrandLst')->option([
|
||||
'_alias' => '列表',
|
||||
]);
|
||||
Route::post('status/:id', '/switchStatus')->name('systemStoreBrandSwithStatus')->option([
|
||||
'_alias' => '修改状态',
|
||||
]);
|
||||
Route::post('create', '/create')->name('systemStoreBrandCreate')->option([
|
||||
'_alias' => '添加',
|
||||
]);
|
||||
Route::post('update/:id', '/update')->name('systemStoreBrandUpdate')->option([
|
||||
'_alias' => '编辑',
|
||||
]);
|
||||
Route::delete('delete/:id', '/delete')->name('systemStoreBrandDelete')->option([
|
||||
'_alias' => '删除',
|
||||
]);
|
||||
})->prefix('admin.store.StoreBrand')->option([
|
||||
'_path' => '/product/band/brandList',
|
||||
'_auth' => true,
|
||||
]);
|
||||
|
||||
//商品标签
|
||||
Route::group('product/label', function () {
|
||||
Route::get('lst', '/lst')->name('merchantStoreProductLabelLst')->option([
|
||||
'_alias' => '列表',
|
||||
]);
|
||||
Route::get('create/form', '/createForm')->name('merchantStoreProductLabelCreateForm')->option([
|
||||
'_alias' => '添加表单',
|
||||
'_auth' => false,
|
||||
'_form' => 'merchantStoreProductLabelCreate',
|
||||
]);
|
||||
Route::post('create', '/create')->name('merchantStoreProductLabelCreate')->option([
|
||||
'_alias' => '添加',
|
||||
]);
|
||||
Route::get('update/:id/form', '/updateForm')->name('merchantStoreProductLabelUpdateForm')->option([
|
||||
'_alias' => '编辑表单',
|
||||
'_auth' => false,
|
||||
'_form' => 'merchantStoreProductLabelUpdate',
|
||||
]);
|
||||
Route::post('update/:id', '/update')->name('merchantStoreProductLabelUpdate')->option([
|
||||
'_alias' => '编辑',
|
||||
]);
|
||||
Route::get('detail/:id', '/detail')->name('merchantStoreProductLabelDetail')->option([
|
||||
'_alias' => '详情',
|
||||
]);
|
||||
Route::delete('delete/:id', '/delete')->name('merchantStoreProductLabelDelete')->option([
|
||||
'_alias' => '删除',
|
||||
]);
|
||||
Route::post('status/:id', '/switchWithStatus')->name('merchantStoreProductLabelStatus')->option([
|
||||
'_alias' => '修改状态',
|
||||
]);
|
||||
Route::get('option', '/getOptions')->option([
|
||||
'_alias' => '筛选',
|
||||
'_auth' => false,
|
||||
]);
|
||||
|
||||
})->prefix('merchant.store.product.ProductLabel')->option([
|
||||
'_path' => '/product/label',
|
||||
'_auth' => true,
|
||||
]);
|
||||
});
|
@ -20,7 +20,7 @@ Route::group('agreement', function () {
|
||||
'_init' => [ \crmeb\services\UpdateAuthInit::class,'agreement'],
|
||||
]);
|
||||
|
||||
})->prefix('admin.system.Cache')->option([
|
||||
})->prefix('merchant.system.Cache')->option([
|
||||
'_path' => '/setting/agreements',
|
||||
'_auth' => true,
|
||||
]);
|
@ -14,7 +14,7 @@ class AdminCheck extends Validate
|
||||
protected $regex = [ 'checkUser' => '/^[A-Za-z]{1}[A-Za-z0-9_-]{4,19}$/'];
|
||||
|
||||
protected $rule = [
|
||||
'username' => 'require|regex:checkUser|unique:admin',
|
||||
'username' => 'require|unique:admin',
|
||||
'pwd' => 'require|min:6|confirm',
|
||||
'edit_pwd' => 'min:6|confirm',
|
||||
'mobile' => 'require|mobile',
|
||||
@ -27,7 +27,7 @@ class AdminCheck extends Validate
|
||||
|
||||
protected $message = [
|
||||
'username.require' => '登录账号不能为空',
|
||||
'username.regex' => '登录账号必须是以字母开头,只能包含字母数字下划线和减号,5到20位',
|
||||
// 'username.regex' => '登录账号必须是以字母开头,只能包含字母数字下划线和减号,5到20位',
|
||||
'username.unique' => '同样的登录账号已经存在',
|
||||
'pwd.require' => '密码不能为空',
|
||||
'pwd.min' => '密码至少要6个字符',
|
||||
@ -48,7 +48,7 @@ class AdminCheck extends Validate
|
||||
|
||||
protected $scene = [
|
||||
'add' => ['mobile', 'nickname', 'group_id', 'pwd', 'username', 'status'],
|
||||
'edit' => ['mobile', 'nickname', 'group_id', 'edit_pwd','id', 'username', 'status'],
|
||||
'edit' => ['mobile', 'nickname', 'group_id', 'edit_pwd','id', 'status'],
|
||||
'editPersonal' => ['mobile', 'nickname'],
|
||||
'editpwd' => ['old_pwd', 'pwd'],
|
||||
];
|
||||
|
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不能为空',
|
||||
];
|
||||
}
|
20
app/admin/validate/UserExtractValidate.php
Normal file
20
app/admin/validate/UserExtractValidate.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?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 UserExtractValidate extends Validate
|
||||
{
|
||||
protected $rule = [
|
||||
'extract_id' => 'require',
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
'extract_id.require' => 'ID不能为空',
|
||||
];
|
||||
}
|
@ -81,6 +81,18 @@
|
||||
{/volist}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="layui-td-gray">供应链团队<font>*</font>
|
||||
</td>
|
||||
<td colspan="5">
|
||||
<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>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="layui-td-gray">备注</td>
|
||||
<td colspan="5">
|
||||
@ -169,6 +181,18 @@
|
||||
{/volist}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="layui-td-gray">供应链团队<font>*</font>
|
||||
</td>
|
||||
<td colspan="5">
|
||||
<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="$admin.fa_supply_team_id" value="$vo.id"} selected{/eq}>{$vo.name}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="layui-td-gray">备注</td>
|
||||
<td colspan="5">
|
||||
@ -183,60 +207,60 @@
|
||||
</div>
|
||||
|
||||
|
||||
<div class="layui-col-md6">
|
||||
<select name="city" lay-verify="required" lay-search="">
|
||||
<option value="">带搜索的选择框</option>
|
||||
<option value="1">layer</option>
|
||||
<option value="2">form</option>
|
||||
<option value="3">layim</option>
|
||||
<option value="4">element</option>
|
||||
<option value="5">laytpl</option>
|
||||
<option value="6">upload</option>
|
||||
<option value="7">laydate</option>
|
||||
<option value="8">laypage</option>
|
||||
<option value="9">flow</option>
|
||||
<option value="10">util</option>
|
||||
<option value="11">code</option>
|
||||
<option value="12">tree</option>
|
||||
<option value="13">layedit</option>
|
||||
<option value="14">nav</option>
|
||||
<option value="15">tab</option>
|
||||
<option value="16">table</option>
|
||||
<option value="17">select</option>
|
||||
<option value="18">checkbox</option>
|
||||
<option value="19">switch</option>
|
||||
<option value="20">radio</option>
|
||||
</select>
|
||||
<div class="layui-form-select layui-form-selected">
|
||||
<div class="layui-select-title">
|
||||
<input type="text" placeholder="带搜索的选择框" value="" class="layui-input">
|
||||
<i class="layui-edge"></i>
|
||||
</div>
|
||||
<dl class="layui-anim layui-anim-upbit" style="">
|
||||
<dd lay-value="" class="layui-select-tips layui-this">带搜索的选择框</dd>
|
||||
<dd lay-value="1" class="">layer</dd>
|
||||
<dd lay-value="2" class="">form</dd>
|
||||
<dd lay-value="3" class="">layim</dd>
|
||||
<dd lay-value="4" class="">element</dd>
|
||||
<dd lay-value="5" class="">laytpl</dd>
|
||||
<dd lay-value="6" class="">upload</dd>
|
||||
<dd lay-value="7" class="">laydate</dd>
|
||||
<dd lay-value="8" class="">laypage</dd>
|
||||
<dd lay-value="9" class="">flow</dd>
|
||||
<dd lay-value="10" class="">util</dd>
|
||||
<dd lay-value="11" class="">code</dd>
|
||||
<dd lay-value="12" class="">tree</dd>
|
||||
<dd lay-value="13" class="">layedit</dd>
|
||||
<dd lay-value="14" class="">nav</dd>
|
||||
<dd lay-value="15" class="">tab</dd>
|
||||
<dd lay-value="16" class="">table</dd>
|
||||
<dd lay-value="17" class="">select</dd>
|
||||
<dd lay-value="18" class="">checkbox</dd>
|
||||
<dd lay-value="19" class="">switch</dd>
|
||||
<dd lay-value="20" class="">radio</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="layui-col-md6">-->
|
||||
<!-- <select name="city" lay-verify="required" lay-search="">-->
|
||||
<!-- <option value="">带搜索的选择框</option>-->
|
||||
<!-- <option value="1">layer</option>-->
|
||||
<!-- <option value="2">form</option>-->
|
||||
<!-- <option value="3">layim</option>-->
|
||||
<!-- <option value="4">element</option>-->
|
||||
<!-- <option value="5">laytpl</option>-->
|
||||
<!-- <option value="6">upload</option>-->
|
||||
<!-- <option value="7">laydate</option>-->
|
||||
<!-- <option value="8">laypage</option>-->
|
||||
<!-- <option value="9">flow</option>-->
|
||||
<!-- <option value="10">util</option>-->
|
||||
<!-- <option value="11">code</option>-->
|
||||
<!-- <option value="12">tree</option>-->
|
||||
<!-- <option value="13">layedit</option>-->
|
||||
<!-- <option value="14">nav</option>-->
|
||||
<!-- <option value="15">tab</option>-->
|
||||
<!-- <option value="16">table</option>-->
|
||||
<!-- <option value="17">select</option>-->
|
||||
<!-- <option value="18">checkbox</option>-->
|
||||
<!-- <option value="19">switch</option>-->
|
||||
<!-- <option value="20">radio</option>-->
|
||||
<!-- </select>-->
|
||||
<!-- <div class="layui-form-select layui-form-selected">-->
|
||||
<!-- <div class="layui-select-title">-->
|
||||
<!-- <input type="text" placeholder="带搜索的选择框" value="" class="layui-input">-->
|
||||
<!-- <i class="layui-edge"></i>-->
|
||||
<!-- </div>-->
|
||||
<!-- <dl class="layui-anim layui-anim-upbit" style="">-->
|
||||
<!-- <dd lay-value="" class="layui-select-tips layui-this">带搜索的选择框</dd>-->
|
||||
<!-- <dd lay-value="1" class="">layer</dd>-->
|
||||
<!-- <dd lay-value="2" class="">form</dd>-->
|
||||
<!-- <dd lay-value="3" class="">layim</dd>-->
|
||||
<!-- <dd lay-value="4" class="">element</dd>-->
|
||||
<!-- <dd lay-value="5" class="">laytpl</dd>-->
|
||||
<!-- <dd lay-value="6" class="">upload</dd>-->
|
||||
<!-- <dd lay-value="7" class="">laydate</dd>-->
|
||||
<!-- <dd lay-value="8" class="">laypage</dd>-->
|
||||
<!-- <dd lay-value="9" class="">flow</dd>-->
|
||||
<!-- <dd lay-value="10" class="">util</dd>-->
|
||||
<!-- <dd lay-value="11" class="">code</dd>-->
|
||||
<!-- <dd lay-value="12" class="">tree</dd>-->
|
||||
<!-- <dd lay-value="13" class="">layedit</dd>-->
|
||||
<!-- <dd lay-value="14" class="">nav</dd>-->
|
||||
<!-- <dd lay-value="15" class="">tab</dd>-->
|
||||
<!-- <dd lay-value="16" class="">table</dd>-->
|
||||
<!-- <dd lay-value="17" class="">select</dd>-->
|
||||
<!-- <dd lay-value="18" class="">checkbox</dd>-->
|
||||
<!-- <dd lay-value="19" class="">switch</dd>-->
|
||||
<!-- <dd lay-value="20" class="">radio</dd>-->
|
||||
<!-- </dl>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
|
||||
</form>
|
||||
{/block}
|
||||
|
@ -11,7 +11,7 @@
|
||||
<td>
|
||||
<select name="pid" lay-verify="required" lay-reqText="请选择父级菜单/节点">
|
||||
<option value="0">作为顶级菜单/节点</option>
|
||||
{volist name="$menus" id="v"}
|
||||
{volist name="menus" id="v"}
|
||||
<option value="{$v.id}" {eq name="pid" value="$v.id" }selected="" {/eq}>{$v.title} </option>
|
||||
{/volist}
|
||||
</select>
|
||||
|
@ -8,19 +8,21 @@
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<form class="layui-form p-4">
|
||||
<!-- <h3 class="pb-3">新建文章</h3> -->
|
||||
<table class="layui-table layui-table-form">
|
||||
<tr>
|
||||
<td colspan="6" class="layui-td-gray" style="text-align:left">店铺说明</td>
|
||||
<td colspan="6" class="layui-td-gray" style="text-align:center">
|
||||
<h3>店铺说明</h3>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="6">
|
||||
<textarea class="layui-textarea" id="container_content"></textarea>
|
||||
<textarea class="layui-textarea" id="container_content">
|
||||
</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<div class="pt-3">
|
||||
<div class="pt-3" style="text-align: center;">
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||
</div>
|
||||
@ -35,99 +37,47 @@
|
||||
var moduleInit = ['tool', 'tagpicker', 'tinymce'];
|
||||
var group_access = "{:session('gougu_admin')['group_access']}"
|
||||
function gouguInit() {
|
||||
var form =layui.form, tool = layui.tool,tagspicker = layui.tagpicker,laydate=layui.laydate;
|
||||
laydate.render({
|
||||
elem: '#test1' //指定元素
|
||||
var form =layui.form, tool = layui.tool
|
||||
// ,tagspicker = layui.tagpicker,laydate=layui.laydate;
|
||||
|
||||
var editor = layui.tinymce;
|
||||
var edit = editor.render({
|
||||
selector: "#container_content",
|
||||
height: 500
|
||||
});
|
||||
//上传缩略图
|
||||
var upload_thumb = layui.upload.render({
|
||||
elem: '#upload_btn_thumb',
|
||||
url: '/admin/api/upload',
|
||||
done: function (res) {
|
||||
//如果上传失败
|
||||
if (res.code == 1) {
|
||||
return layer.msg('上传失败');
|
||||
|
||||
$.ajax({
|
||||
url:'/admin/agreement/sys_merchant_type',
|
||||
method:'get',
|
||||
success: (data)=>{
|
||||
if (data.code==0){
|
||||
tinyMCE.editors['container_content'].setContent(data.data.sys_merchant_type);
|
||||
}else{
|
||||
console.log(data)
|
||||
}
|
||||
//上传成功
|
||||
$('#upload_box_thumb input').attr('value', res.data.filepath);
|
||||
$('#upload_box_thumb img').attr('src', res.data.filepath);
|
||||
},
|
||||
fail:(e)=>{
|
||||
console.log(e)
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
street();
|
||||
village();
|
||||
form.on('select(area_id)', function (data) {
|
||||
street(data.value)
|
||||
});
|
||||
function street (id) {
|
||||
var demo1 = xmSelect.render({
|
||||
name: 'township',
|
||||
el: '#demo1',
|
||||
initValue: [],
|
||||
prop: {
|
||||
name: 'name',
|
||||
value: 'code',
|
||||
},
|
||||
data: [],
|
||||
radio: true,
|
||||
disabled: group_access == 2 ||group_access == 4? true : false,
|
||||
on: function (data) {
|
||||
var arr = data.arr;
|
||||
if(arr.length > 0){
|
||||
village(arr[0]['code']);
|
||||
}else{
|
||||
village();
|
||||
}
|
||||
},
|
||||
})
|
||||
$.get('/api/geo/street?pcode=' + id, function (result) {
|
||||
demo1.update({
|
||||
data: result.data
|
||||
})
|
||||
});
|
||||
}
|
||||
function village (id) {
|
||||
var demo2 = xmSelect.render({
|
||||
name: 'village',
|
||||
el: '#demo2',
|
||||
initValue: [],
|
||||
prop: {
|
||||
name: 'name',
|
||||
value: 'id',
|
||||
},
|
||||
data: [],
|
||||
radio: true,
|
||||
disabled: group_access == 2 ? true : false,
|
||||
})
|
||||
$.get('/api/geo/village?pcode=' + id, function (result) {
|
||||
demo2.update({
|
||||
data: result.data
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
var editor = layui.tinymce;
|
||||
var edit = editor.render({
|
||||
selector: "#container_content",
|
||||
height: 500
|
||||
});
|
||||
//监听提交
|
||||
form.on('submit(webform)', function (data) {
|
||||
data.field.content = tinyMCE.editors['container_content'].getContent();
|
||||
if (data.field.content == '') {
|
||||
layer.msg('请先完善文章内容');
|
||||
return false;
|
||||
}
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
tool.tabRefresh(71);
|
||||
tool.sideClose(1000);
|
||||
}
|
||||
}
|
||||
tool.post('', data.field, callback);
|
||||
//监听提交
|
||||
form.on('submit(webform)', function (data) {
|
||||
data.field.agree = tinyMCE.editors['container_content'].getContent();
|
||||
if (data.field.content == '') {
|
||||
layer.msg('请先完善文章内容');
|
||||
return false;
|
||||
});
|
||||
}
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
tool.tabRefresh(71);
|
||||
tool.sideClose(1000);
|
||||
}
|
||||
}
|
||||
tool.post('/admin/agreement/sys_merchant_type', data.field, callback);
|
||||
return false;
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
|
453
app/admin/view/merchant/system/merchant/intention/lst.html
Normal file
453
app/admin/view/merchant/system/merchant/intention/lst.html
Normal file
@ -0,0 +1,453 @@
|
||||
{extend name="common/base"/}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<style>
|
||||
.layui-btn-group{
|
||||
display:flex;
|
||||
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="p-3">
|
||||
|
||||
|
||||
<!-- 时间选择 -->
|
||||
<div class="layui-form">
|
||||
|
||||
<form id="filterform" class="layui-form" action="">
|
||||
<div class="layui-form-item">
|
||||
|
||||
<div class="layui-form-item">
|
||||
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">选择时间</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-btn-group">
|
||||
<input id="chonse_start_date" type="hidden" name="start_date" value="" readonly placeholder="选择时间">
|
||||
<input id="chonse_end_date" type="hidden" name="end_date" value="" readonly placeholder="选择时间">
|
||||
<button id="both" name="both" lay-submit="" lay-filter="chonse_date" type="button" class="layui-btn layui-btn-normal">全部</button>
|
||||
<button name="today" lay-submit="" lay-filter="chonse_date" type="button" class="layui-btn layui-btn-normal layui-btn-primary">今天</button>
|
||||
<button name="yeserday" lay-submit="" lay-filter="chonse_date" type="button" class="layui-btn layui-btn-normal layui-btn-primary">昨天</button>
|
||||
<button name="week" lay-submit="" lay-filter="chonse_date" type="button" class="layui-btn layui-btn-normal layui-btn-primary">最近7天</button>
|
||||
<button name="30day" lay-submit="" lay-filter="chonse_date" type="button" class="layui-btn layui-btn-normal layui-btn-primary">最近30天</button>
|
||||
<button name="month" lay-submit="" lay-filter="chonse_date" type="button" class="layui-btn layui-btn-normal layui-btn-primary">本月</button>
|
||||
<button name="year" lay-submit="" lay-filter="chonse_date" type="button" class="layui-btn layui-btn-normal layui-btn-primary">本年</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-inline">
|
||||
<!-- <label class="layui-form-label">日期范围</label> -->
|
||||
<div class="layui-inline" id="range_date">
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" autocomplete="off" name="start_date" id="start-date" class="layui-input" placeholder="开始日期">
|
||||
</div>
|
||||
<div class="layui-form-mid">-</div>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" autocomplete="off" name="end_date" id="end-date" class="layui-input" placeholder="结束日期">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-inline" style="width:45%;">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">商户审核</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-btn-group">
|
||||
<input type="hidden" id="status" name="status" value="" readonly placeholder="核审状态值">
|
||||
<button name="both" lay-submit="" lay-filter="statusform" type="button" class="layui-btn layui-btn-normal">全部</button>
|
||||
<button name="wait" lay-submit="" lay-filter="statusform" type="button" class="layui-btn layui-btn-normal layui-btn-primary">待审核</button>
|
||||
<button name="success" lay-submit="" lay-filter="statusform" type="button" class="layui-btn layui-btn-normal layui-btn-primary">审核通过</button>
|
||||
<button name="failed" lay-submit="" lay-filter="statusform" type="button" class="layui-btn layui-btn-normal layui-btn-primary">审核未通过</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-input-inline" style="width:45%;float:none;">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">商户分类</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="category_id" lay-filter="seleform">
|
||||
<option value=""></option>
|
||||
{volist name="category" key="k" id="vo"}
|
||||
<option value="{$vo.merchant_category_id}">{$vo.category_name}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
|
||||
<div class="layui-input-inline" style="width:45%;">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">店铺类型</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="type_id" lay-filter="seleform">
|
||||
<option value=""></option>
|
||||
{volist name="type" key="k" id="vo"}
|
||||
<option value="{$vo.mer_type_id}">{$vo.type_name}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-input-inline" style="width:45%;">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">关键字</label>
|
||||
<div class="layui-input-block" style="display:flex">
|
||||
<input style="width:70%;float:left" type="text" name="keywords" placeholder="请输入关键字"
|
||||
class="layui-input" autocomplete="off" />
|
||||
<button class="layui-btn layui-btn-normal" lay-submit=""
|
||||
lay-filter="searchform">提交搜索</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
<table class="layui-hide" id="intention_list" lay-filter="intention_list">
|
||||
</table>
|
||||
</div>
|
||||
<!-- test end -->
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<!-- 操作 -->
|
||||
<script type="text/html" id="toolbarDemo"></script>
|
||||
<script type="text/html" id="barDemo">
|
||||
<div class="layui-btn-group">
|
||||
{{# if(d.status == 0 ){ }}
|
||||
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="status">审核</a>
|
||||
{{# } }}
|
||||
|
||||
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="mark">备注</a>
|
||||
<a class="layui-btn 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: '#intention_list',
|
||||
title: '商户入驻申请列表',
|
||||
toolbar: '#toolbarDemo',
|
||||
url: '/admin/merchant/intention/lst',
|
||||
parseData: function(res){ //res 即为原始返回的数据
|
||||
return {
|
||||
"code": res.code, //解析接口状态
|
||||
"msg": res.msg, //解析提示文本
|
||||
"count": res.data.count, //解析数据长度
|
||||
"data": res.data.list //解析数据列表
|
||||
};
|
||||
},
|
||||
page: true,
|
||||
limit: 20,
|
||||
cellMinWidth: 300,
|
||||
cols: [
|
||||
[
|
||||
{
|
||||
fixed: 'ID',
|
||||
field: 'mer_intention_id',
|
||||
title: 'ID',
|
||||
align: 'center',
|
||||
width: 80
|
||||
},
|
||||
{
|
||||
field: 'mer_name',
|
||||
title: '商户名称',
|
||||
align: 'center',
|
||||
width: 200,
|
||||
}, {
|
||||
field: 'category_name',
|
||||
title: '商户分类',
|
||||
align: 'center',
|
||||
width: 220,
|
||||
templet: '<div>{{d.merchantCategory.category_name}}</div>'
|
||||
},{
|
||||
field: 'type_name',
|
||||
title: '店铺类型',
|
||||
align: 'center',
|
||||
width: 220,
|
||||
templet: '<div>{{d.merchantType.type_name}}</div>'
|
||||
}, {
|
||||
field: 'name',
|
||||
title: '商户姓名',
|
||||
align: 'center',
|
||||
width: 220,
|
||||
}, {
|
||||
field: 'phone',
|
||||
title: '联系方式',
|
||||
align: 'center',
|
||||
width: 100,
|
||||
}, {
|
||||
field: 'create_time',
|
||||
title: '申请时间',
|
||||
align: 'center',
|
||||
width: 220,
|
||||
},{
|
||||
field: 'images',
|
||||
title: '资质图片',
|
||||
align: 'center',
|
||||
width: 220,
|
||||
},{
|
||||
field: 'status',
|
||||
title: '状态',
|
||||
align: 'center',
|
||||
width: 150,
|
||||
templet: function(d){
|
||||
if (d.status==0){
|
||||
return '<span style="color:yellow">待审核</span>'
|
||||
}else if(d.status==1){
|
||||
return '<span style="color:green">已审核</span>'
|
||||
}else if(d.status==2){
|
||||
return '<span style="color:red">审核未通过</span>'
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'mark',
|
||||
title: '备注',
|
||||
align: 'center',
|
||||
width: 150
|
||||
},
|
||||
{
|
||||
fixed: 'right',
|
||||
field: 'right',
|
||||
title: '操作',
|
||||
toolbar: '#barDemo',
|
||||
width: 190,
|
||||
align: 'center'
|
||||
}
|
||||
]
|
||||
]
|
||||
|
||||
});
|
||||
|
||||
|
||||
//监听表头工具栏事件
|
||||
// table.on('toolbar(store_product)', function (obj) {
|
||||
// if (obj.event === 'add') {
|
||||
// tool.side("/admin/merchant/type/form");
|
||||
// return false;
|
||||
// }
|
||||
// });
|
||||
|
||||
//监听表格行工具事件
|
||||
table.on('tool(intention_list)', function (obj) {
|
||||
var data = obj.data;
|
||||
if (obj.event === 'mark') { //备注
|
||||
tool.side('/admin/merchant/intention/markform?id=' + obj.data.mer_intention_id);
|
||||
} else if (obj.event === 'status') { //审核
|
||||
tool.side('/admin/merchant/intention/statusform?id=' + obj.data.mer_intention_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/merchant/intention/del", { id: data.mer_intention_id }, callback);
|
||||
layer.close(index);
|
||||
});
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
|
||||
// 日期范围
|
||||
layui.use(['laydate','table','element', 'jquery'], function () {
|
||||
var laydate = layui.laydate;
|
||||
//日期范围
|
||||
laydate.render({
|
||||
elem: '#range_date'
|
||||
//设置开始日期、日期日期的 input 选择器
|
||||
//数组格式为 2.6.6 开始新增,之前版本直接配置 true 或任意分割字符即可
|
||||
, range: ['#start-date', '#end-date']
|
||||
,done: function(value, date, endDate){
|
||||
switchDateForm(true);
|
||||
|
||||
$('#both').removeClass('layui-btn-primary')
|
||||
$('#both').siblings().addClass('layui-btn-primary')
|
||||
active['reload'] ? active['reload'].call(this) : '';
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//
|
||||
var $ = layui.$, active = {
|
||||
reload: function(){
|
||||
let dataRload = getformdata();
|
||||
//console.log(dataRload)
|
||||
//执行重载
|
||||
table.reload('intention_list', {
|
||||
page: {
|
||||
curr: 1 //重新从第 1 页开始
|
||||
}
|
||||
,where: {
|
||||
...dataRload
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//监听button提交
|
||||
form.on('submit(searchform)', function(data) {
|
||||
layui.pageTable.reload({
|
||||
where: {
|
||||
...data.field
|
||||
},
|
||||
page: {
|
||||
curr: 1
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
//选择时间
|
||||
form.on('submit(chonse_date)', function(data){
|
||||
|
||||
let start_date = '';
|
||||
let end_date = getDaysAgo();
|
||||
|
||||
let name = data.elem.name;
|
||||
if (name =='today') {
|
||||
start_date=end_date;
|
||||
end_date = getDaysAgo(-1);
|
||||
}else if(name == 'yeserday'){
|
||||
start_date = getDaysAgo(1);
|
||||
}else if(name == 'week'){
|
||||
start_date = getDaysAgo(7);
|
||||
}else if(name == '30day'){
|
||||
start_date = getDaysAgo(30);
|
||||
}else if(name == 'month'){
|
||||
let days = (new Date).getDate()-1
|
||||
start_date = getDaysAgo(days);
|
||||
}else if(name == 'year'){
|
||||
var year = (new Date()).getFullYear();//获取当前年份
|
||||
start_date = year+'-01-01'
|
||||
}else{
|
||||
end_date = '';
|
||||
}
|
||||
|
||||
switchClass(this)
|
||||
|
||||
switchDateForm(false);
|
||||
$('#chonse_start_date').val(start_date);
|
||||
$('#chonse_end_date').val(end_date);
|
||||
|
||||
active['reload'] ? active['reload'].call(this) : '';
|
||||
|
||||
return false;
|
||||
})
|
||||
|
||||
|
||||
|
||||
// 商户审核
|
||||
form.on('submit(statusform)', function(data) {
|
||||
let name = data.elem.name
|
||||
let status = 0;
|
||||
|
||||
if (name=='wait') {
|
||||
status = 0;
|
||||
}else if(name=='success'){
|
||||
status = 1;
|
||||
}else if(name=='failed'){
|
||||
status = 2;
|
||||
}
|
||||
if (name=='both'){
|
||||
$('#status').attr('disabled', true);
|
||||
}else{
|
||||
$('#status').attr('disabled', false);
|
||||
}
|
||||
switchClass(this)
|
||||
$('#status').val(status);
|
||||
active['reload'] ? active['reload'].call(this) : '';
|
||||
return false;
|
||||
});
|
||||
|
||||
//监听select提交
|
||||
form.on('select(seleform)', function(data) {
|
||||
active['reload'] ? active['reload'].call(this) : '';
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
// 切换button选中样式
|
||||
function switchClass(e)
|
||||
{
|
||||
$(e).removeClass('layui-btn-primary')
|
||||
$(e).siblings().addClass('layui-btn-primary')
|
||||
}
|
||||
|
||||
// 两个时间表单是互斥的,只能提交一个
|
||||
function switchDateForm(chonse=false)
|
||||
{
|
||||
let range = chonse?false:true;
|
||||
$('#start-date').attr("disabled",range);
|
||||
$('#end-date').attr("disabled",range);
|
||||
|
||||
$('#chonse_start_date').attr("disabled",chonse);
|
||||
$('#chonse_end_date').attr("disabled",chonse);
|
||||
if (chonse) {
|
||||
$('#chonse_start_date').val("");
|
||||
$('#chonse_end_date').val("");
|
||||
}else{
|
||||
$('#start-date').val("");
|
||||
$('#end-date').val("");
|
||||
}
|
||||
}
|
||||
|
||||
//获取n天以前日期
|
||||
function getDaysAgo(n=0) {
|
||||
let myDate = new Date();
|
||||
let lw = new Date(myDate - 1000 * 60 * 60 * 24 * n); //最后一个数字30可改,n天前的意思
|
||||
let lastY = lw.getFullYear();
|
||||
let lastM = lw.getMonth() + 1;
|
||||
let lastD = lw.getDate();
|
||||
lastM = lastM < 10 ? "0" + lastM : lastM;
|
||||
lastD = lastD < 10 ? "0" + lastD : lastD;
|
||||
let startData = lastY+"-"+lastM+"-" +lastD; //n天之前日期
|
||||
|
||||
return startData;
|
||||
}
|
||||
|
||||
// 获取表单所有参数
|
||||
function getformdata() {
|
||||
var form = $('#filterform').serializeArray();
|
||||
var data = new Array();
|
||||
for(let i=0;i<form.length; i++){
|
||||
data[form[i].name] = form[i].value;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
57
app/admin/view/merchant/system/merchant/intention/mark.html
Normal file
57
app/admin/view/merchant/system/merchant/intention/mark.html
Normal file
@ -0,0 +1,57 @@
|
||||
{extend name="common/base"/}
|
||||
{block name="style"}
|
||||
|
||||
{/block}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<form class="layui-form p-4">
|
||||
<h3 class="pb-3">备注</h3>
|
||||
<table class="layui-table layui-table-form">
|
||||
<tr>
|
||||
<td colspan="6">
|
||||
<textarea class="layui-textarea" name="mark"></textarea>
|
||||
<input type="hidden" name="id" value="{$id}">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="pt-3">
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform" type="button">立即提交</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||
</div>
|
||||
</form>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script src="/static/assets/js/xm-select.js"></script>
|
||||
<script>
|
||||
var moduleInit = ['tool', 'tagpicker', 'tinymce'];
|
||||
var group_access = "{:session('gougu_admin')['group_access']}"
|
||||
|
||||
|
||||
function gouguInit() {
|
||||
var form = layui.form, tool = layui.tool, tagspicker = layui.tagpicker;
|
||||
|
||||
//监听提交
|
||||
form.on('submit(webform)', function (data) {
|
||||
console.log(data);
|
||||
if (data.field == '') {
|
||||
layer.msg('请先完善商品详情');
|
||||
return false;
|
||||
}
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
tool.tabRefresh(71);
|
||||
tool.sideClose(1000);
|
||||
}
|
||||
}
|
||||
tool.post('/admin/merchant/intention/mark', data.field, callback);
|
||||
return false;
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
@ -0,0 +1,66 @@
|
||||
{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>
|
||||
<select name="status" lay-verify="required" lay-reqText="审核状态">
|
||||
<option selected="selected" value="1">同意</option>
|
||||
<option value="2">不同意</option>
|
||||
</select>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="layui-td-gray-2">创建商户<font>*</font>
|
||||
</td>
|
||||
<td>
|
||||
<input type="radio" checked="checked" name="create_mer" value="1" title="是">
|
||||
<input type="radio" name="create_mer" value="0" title="不是">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</table>
|
||||
|
||||
<div style="padding: 10px 0">
|
||||
<input type="hidden" name="id" value="{$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>
|
||||
const moduleInit = ['tool'];
|
||||
function gouguInit() {
|
||||
var form = layui.form,tool=layui.tool;
|
||||
//监听提交
|
||||
form.on('submit(webform)', function (data) {
|
||||
console.log(data.field)
|
||||
if (!data.field.status || data.field.id == '' || data.field.create_mer == '') {
|
||||
layer.msg('请选择审核表单');
|
||||
return false;
|
||||
}
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
setTimeout(function () {
|
||||
parent.location.reload();
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
tool.post('/admin/merchant/intention/status', data.field, callback);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
116
app/admin/view/merchant/system/merchant/margin/edit.html
Normal file
116
app/admin/view/merchant/system/merchant/margin/edit.html
Normal file
@ -0,0 +1,116 @@
|
||||
{extend name="common/base"/}
|
||||
{block name="style"}
|
||||
<style type="text/css">
|
||||
.editormd-code-toolbar select {
|
||||
display: inline-block
|
||||
}
|
||||
|
||||
.editormd li {
|
||||
list-style: inherit;
|
||||
}
|
||||
</style>
|
||||
{/block}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<form class="layui-form p-4">
|
||||
<h3 class="pb-3">保证金扣费</h3>
|
||||
<table class="layui-table layui-table-form">
|
||||
|
||||
<tr>
|
||||
<td colspan="2" class="layui-td-gray">商户名称<font>*</font></td>
|
||||
<td colspan="6">
|
||||
<input type="text" name="mer_name" lay-verify="required"
|
||||
lay-reqText="商户名称" disabled autocomplete="off" placeholder="商户名称" class="layui-input" value="{$data.mer_name}">
|
||||
<!-- <input type="text" name="type" lay-verify="required"
|
||||
lay-reqText="明细类型" hidden= autocomplete="off" placeholder="明细类型" class="layui-input" value="{$data.type}"> -->
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2" class="layui-td-gray">商户ID</td>
|
||||
<td colspan="6">
|
||||
<input type="number" name="mer_id" lay-verify="required" lay-reqText="0" autocomplete="off" disabled placeholder="0" class="layui-input" value="{$data.mer_id}">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2" class="layui-td-gray">商户剩余保证金</td>
|
||||
<td >
|
||||
<input type="number" name="margin" lay-verify="required" lay-reqText="0" autocomplete="off" disabled placeholder="0" class="layui-input" value="{$data.margin}">
|
||||
|
||||
</td>
|
||||
<td >单位:元</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2" class="layui-td-gray">保证金扣除金额<font>*</font></td>
|
||||
<td >
|
||||
<input type="number" name="number" lay-verify="required" lay-reqText="0" autocomplete="off" placeholder="0" class="layui-input" value="">
|
||||
</td>
|
||||
<td >单位:元</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td colspan="2" class="layui-td-gray">保证金扣除原因<font>*</font></td>
|
||||
<td colspan="6">
|
||||
<textarea class="layui-textarea" name="mark"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="pt-3">
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform" type='button'>扣除保证金</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||
</div>
|
||||
</form>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script src="/static/assets/js/xm-select.js"></script>
|
||||
|
||||
<script>
|
||||
var moduleInit = ['tool','treeGrid', 'tagpicker', 'tinymce', 'admin'];
|
||||
var group_access = "{:session('gougu_admin')['group_access']}"
|
||||
|
||||
function gouguInit() {
|
||||
var treeGrid = layui.treeGrid,table = layui.table
|
||||
|
||||
var tool = layui.tool;
|
||||
var form = layui.form, tool = layui.tool, tagspicker = layui.tagpicker;
|
||||
|
||||
var editor = layui.tinymce;
|
||||
var edit = editor.render({
|
||||
selector: "#container_content",
|
||||
height: 500,
|
||||
});
|
||||
|
||||
//监听提交
|
||||
form.on('submit(webform)', function (data) {
|
||||
// console.log(data.field);
|
||||
// data.field.content = tinyMCE.editors['container_content'].getContent();
|
||||
if (data.field == '') {
|
||||
layer.msg('请先完善表单输入');
|
||||
return false;
|
||||
}
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
tool.tabRefresh(71);
|
||||
tool.sideClose(1000);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
tool.post('/admin/margin/reduct', data.field, callback);
|
||||
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
523
app/admin/view/merchant/system/merchant/margin/list.html
Normal file
523
app/admin/view/merchant/system/merchant/margin/list.html
Normal file
@ -0,0 +1,523 @@
|
||||
{extend name="common/base"/}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
|
||||
|
||||
<div class="p-3">
|
||||
|
||||
|
||||
<!-- 时间选择 -->
|
||||
<div class="layui-form">
|
||||
|
||||
<form id="filterform" class="layui-form" action="">
|
||||
<div class="layui-form-item">
|
||||
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">选择时间</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-btn-group" id="witch_date">
|
||||
<button name="both" lay-submit="" lay-filter="searchform" type="button" class="layui-btn layui-btn-normal">全部</button>
|
||||
<button name="today" lay-submit="" lay-filter="searchform" type="button" class="layui-btn layui-btn-normal layui-btn-primary">今天</button>
|
||||
<button name="yeserday" lay-submit="" lay-filter="searchform" type="button" class="layui-btn layui-btn-normal layui-btn-primary">昨天</button>
|
||||
<button lay-submit="" lay-filter="searchform" type="button" class="layui-btn layui-btn-normal layui-btn-primary">最近7天</button>
|
||||
<button lay-submit="" lay-filter="searchform" type="button" class="layui-btn layui-btn-normal layui-btn-primary">最近30天</button>
|
||||
<button lay-submit="" lay-filter="searchform" type="button" class="layui-btn layui-btn-normal layui-btn-primary">本月</button>
|
||||
<button lay-submit="" lay-filter="searchform" type="button" class="layui-btn layui-btn-normal layui-btn-primary">本年</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-inline">
|
||||
<!-- <label class="layui-form-label">日期范围</label> -->
|
||||
<div class="layui-inline" id="test6">
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" autocomplete="off" name="start_date" id="test-startDate-1" class="layui-input"
|
||||
placeholder="开始日期">
|
||||
</div>
|
||||
<div class="layui-form-mid">-</div>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" autocomplete="off" name="end_date" id="test-endDate-1" class="layui-input"
|
||||
placeholder="结束日期">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
|
||||
<div class="layui-inline" style="width:46%">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">关键字</label>
|
||||
<div class="layui-input-block">
|
||||
<input style="width:80%;float:left" type="text" name="keywords" placeholder="请输入关键字"
|
||||
class="layui-input" autocomplete="off" />
|
||||
<button class="layui-btn layui-btn-normal" style="width:20%" lay-submit=""
|
||||
lay-filter="searchform" type="button">提交搜索</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-input-inline" style="width:35%;float:none;">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">商户类别</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="dddd" lay-filter="searchform">
|
||||
<option value=""></option>
|
||||
<option value="10">自营</option>
|
||||
<option value="11">非自营</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
|
||||
<div class="layui-input-inline" style="width:46%;">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">商户分类</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="category" lay-filter="searchform">
|
||||
<option value=""></option>
|
||||
<option value="0">写作</option>
|
||||
<option value="1">阅读</option>
|
||||
<option value="2">游戏</option>
|
||||
<option value="3">音乐</option>
|
||||
<option value="4">旅行</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-input-inline" style="width:35%;">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">店铺类型</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="type" lay-filter="type">
|
||||
<option value=""></option>
|
||||
<option value="0">写作</option>
|
||||
<option value="1">阅读</option>
|
||||
<option value="2">游戏</option>
|
||||
<option value="3">音乐</option>
|
||||
<option value="4">旅行</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- change tab -->
|
||||
<div class="layui-form-item" id="set_margin" style="display:block;">
|
||||
<div class="layui-input-inline" style="width:46%;">
|
||||
<div class="layui-form-item">
|
||||
|
||||
<label class="layui-form-label">保证金状态</label>
|
||||
<div class="layui-input-block">
|
||||
<select class="test_state" name="status" lay-filter="status">
|
||||
<option value=""></option>
|
||||
<option value="0">写作</option>
|
||||
<option value="1">阅读</option>
|
||||
<option value="2">游戏</option>
|
||||
<option value="3">音乐</option>
|
||||
<option value="4">旅行</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- change tab end -->
|
||||
|
||||
<!-- change tab -->
|
||||
<div class="layui-form-item" id="refund_margin" style="display:none;">
|
||||
|
||||
<div class="layui-input-inline" style="width:46%;">
|
||||
<div class="layui-form-item">
|
||||
|
||||
<label class="layui-form-label">审核</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-btn-group">
|
||||
<button type="button" class="layui-btn layui-btn-normal">全部</button>
|
||||
<button type="button" class="layui-btn layui-btn-normal layui-btn-primary">待审核</button>
|
||||
<button type="button" class="layui-btn layui-btn-normal layui-btn-primary">已审核</button>
|
||||
<button type="button" class="layui-btn layui-btn-normal layui-btn-primary">审核失败</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-input-inline" style="width:35%;">
|
||||
<div class="layui-form-item">
|
||||
|
||||
<label class="layui-form-label">退回状态</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="refund" lay-filter="refund">
|
||||
<option value=""></option>
|
||||
<option value="0">写作</option>
|
||||
<option value="1">阅读</option>
|
||||
<option value="2">游戏</option>
|
||||
<option value="3">音乐</option>
|
||||
<option value="4">旅行</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<!-- test end -->
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
|
||||
<ul class="layui-tab-title">
|
||||
<li lay-id="11" class="layui-this site-demo-active" data-type="tabChange">缴存保证金</li>
|
||||
<li lay-id="22" class="site-demo-active" data-type="tabChange">退回保证金</li>
|
||||
</ul>
|
||||
<div class="layui-tab-content" style="height: 100px;">
|
||||
|
||||
<!-- 缴存列表 -->
|
||||
<div class="layui-tab-item layui-show">
|
||||
<table class="layui-hide" id="reduct_list" lay-filter="reduct_list">
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 退回保证金列表 -->
|
||||
<div class="layui-tab-item">
|
||||
<div class="layui-tab-item layui-show">
|
||||
<table class="layui-hide" id="refund_list" lay-filter="refund_list">
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<!-- 缴存操作 -->
|
||||
<script type="text/html" id="toolbarDemo"></script>
|
||||
<script type="text/html" id="barDemo">
|
||||
<div class="layui-btn-group">
|
||||
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="reduct">保证金扣费</a>
|
||||
<a class="layui-btn layui-btn-xs" lay-event="record">扣费记录</a>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<!-- 退回操作 -->
|
||||
<script type="text/html" id="refundToolbar"></script>
|
||||
<script type="text/html" id="refundBar">
|
||||
<div class="layui-btn-group">
|
||||
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="status">审核</a>
|
||||
<a class="layui-btn layui-btn-xs" lay-event="mark">备注</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: '#reduct_list',
|
||||
title: '保证金列表',
|
||||
toolbar: '#toolbarDemo',
|
||||
url: '/admin/margin/lst',
|
||||
page: true,
|
||||
limit: 20,
|
||||
cellMinWidth: 300,
|
||||
cols: [
|
||||
[
|
||||
{
|
||||
fixed: 'ID',
|
||||
field: 'mer_id',
|
||||
title: 'ID',
|
||||
align: 'center',
|
||||
width: 80
|
||||
},
|
||||
{
|
||||
field: 'mer_name',
|
||||
title: '商户名称',
|
||||
align: 'center',
|
||||
width: 200,
|
||||
templet: '<div>{{d.merchant.mer_name}}</div>'
|
||||
}, {
|
||||
field: 'type_id',
|
||||
title: '店铺类型',
|
||||
align: 'center',
|
||||
width: 220,
|
||||
templet: '<div>{{d.merchant.type_id}}</div>'
|
||||
}, {
|
||||
field: 'real_name',
|
||||
title: '商户姓名',
|
||||
align: 'center',
|
||||
width: 220,
|
||||
templet: '<div>{{d.merchant.real_name}}</div>'
|
||||
}, {
|
||||
field: 'margin',
|
||||
title: '保证金额度',
|
||||
align: 'center',
|
||||
width: 100,
|
||||
templet: '<div>{{d.merchant.margin}}</div>'
|
||||
}, {
|
||||
field: 'status',
|
||||
title: '状态',
|
||||
align: 'center',
|
||||
width: 150
|
||||
}, {
|
||||
field: 'pay_time',
|
||||
title: '支付时间',
|
||||
align: 'center',
|
||||
width: 150
|
||||
},
|
||||
{
|
||||
fixed: 'right',
|
||||
field: 'right',
|
||||
title: '操作',
|
||||
toolbar: '#barDemo',
|
||||
width: 190,
|
||||
align: 'center'
|
||||
}
|
||||
]
|
||||
]
|
||||
|
||||
});
|
||||
|
||||
|
||||
layui.pageTable = table.render({
|
||||
elem: '#refund_list',
|
||||
title: '退回保证金列表',
|
||||
toolbar: '#refundToolbar',
|
||||
url: '/admin/margin/refund/lst',
|
||||
page: true,
|
||||
limit: 20,
|
||||
cellMinWidth: 300,
|
||||
cols: [
|
||||
[
|
||||
{
|
||||
fixed: 'ID',
|
||||
field: 'mer_id',
|
||||
title: 'ID',
|
||||
align: 'center',
|
||||
width: 80
|
||||
},
|
||||
{
|
||||
field: 'mer_name',
|
||||
title: '商户名称1',
|
||||
align: 'center',
|
||||
width: 200,
|
||||
templet: '<div>{{d.merchant.mer_name}}</div>'
|
||||
}, {
|
||||
field: 'type_id',
|
||||
title: '店铺类型',
|
||||
align: 'center',
|
||||
width: 220,
|
||||
templet: '<div>{{d.merchant.type_id}}</div>'
|
||||
}, {
|
||||
field: 'real_name',
|
||||
title: '商户姓名',
|
||||
align: 'center',
|
||||
width: 220,
|
||||
templet: '<div>{{d.merchant.real_name}}</div>'
|
||||
}, {
|
||||
field: 'margin',
|
||||
title: '保证金额度',
|
||||
align: 'center',
|
||||
width: 100,
|
||||
templet: '<div>{{d.merchant.margin}}</div>'
|
||||
}, {
|
||||
field: 'status',
|
||||
title: '状态',
|
||||
align: 'center',
|
||||
width: 150
|
||||
}, {
|
||||
field: 'pay_time',
|
||||
title: '支付时间',
|
||||
align: 'center',
|
||||
width: 150
|
||||
},
|
||||
{
|
||||
fixed: 'right',
|
||||
field: 'right',
|
||||
title: '操作',
|
||||
toolbar: '#refundBar',
|
||||
width: 190,
|
||||
align: 'center'
|
||||
}
|
||||
]
|
||||
]
|
||||
|
||||
});
|
||||
|
||||
// 获取表单所有参数
|
||||
function getformdata() {
|
||||
var form = $('#filterform').serializeArray();
|
||||
var data = new Array();
|
||||
for(let i=0;i<form.length; i++){
|
||||
data[form[i].name] = form[i].value;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var $ = layui.$, active = {
|
||||
reload: function(){
|
||||
let dataRload = getformdata();;
|
||||
|
||||
//执行重载
|
||||
table.reload('testReload', {
|
||||
page: {
|
||||
curr: 1 //重新从第 1 页开始
|
||||
}
|
||||
,where: {
|
||||
...dataRload
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
//监听表头工具栏事件
|
||||
// table.on('toolbar(store_product)', function (obj) {
|
||||
// if (obj.event === 'add') {
|
||||
// tool.side("/admin/merchant/type/form");
|
||||
// return false;
|
||||
// }
|
||||
// });
|
||||
|
||||
//监听表格行工具事件
|
||||
table.on('tool(reduct_list)', function (obj) {
|
||||
var data = obj.data;
|
||||
// console.log(data);
|
||||
if (obj.event === 'reduct') {
|
||||
tool.side('/admin/margin/form?id=' + obj.data.mer_id);
|
||||
} else if (obj.event === 'record') {
|
||||
tool.side('/admin/margin/read?id=' + obj.data.mer_id);
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
//监听表格行工具事件
|
||||
table.on('tool(refund_list)', function (obj) {
|
||||
var data = obj.data;
|
||||
if (obj.event === 'status') {
|
||||
alert("审核");
|
||||
tool.post('/admin/margin/status?id=' + obj.data.mer_id, obj.data);
|
||||
|
||||
} else if (obj.event === 'mark') {
|
||||
tool.side('/admin/margin/form?id=' + obj.data.mer_id);
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
//监听搜索提交
|
||||
form.on('submit(searchform)', function(data) {
|
||||
console.log(data.elem.name, data.field)
|
||||
layui.pageTable.reload({
|
||||
where: {
|
||||
date:data.elem.name,
|
||||
...data.field
|
||||
},
|
||||
page: {
|
||||
curr: 1
|
||||
}
|
||||
});
|
||||
// layui.form.render();
|
||||
return false;
|
||||
});
|
||||
|
||||
form.on('select(searchform)', function(e) {
|
||||
let data = getformdata();
|
||||
layui.pageTable.reload({
|
||||
where: {
|
||||
...data
|
||||
},
|
||||
page: {
|
||||
curr: 1
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
//监听
|
||||
$('.test_state .layui-btn').on('click', function(){
|
||||
var type = $(this).data('type');
|
||||
active[type] ? active[type].call(this) : '';
|
||||
});
|
||||
|
||||
// 日期范围
|
||||
layui.use(['laydate','element', 'jquery'],
|
||||
function () {
|
||||
var laydate = layui.laydate;
|
||||
var $ = layui.jquery,element = layui.element;
|
||||
//日期范围
|
||||
laydate.render({
|
||||
elem: '#test6'
|
||||
//设置开始日期、日期日期的 input 选择器
|
||||
//数组格式为 2.6.6 开始新增,之前版本直接配置 true 或任意分割字符即可
|
||||
, range: ['#test-startDate-1', '#test-endDate-1']
|
||||
,done: function(value, date, endDate){
|
||||
let data = getformdata()
|
||||
data.date = ''
|
||||
layui.pageTable.reload({
|
||||
where: {
|
||||
...data
|
||||
},
|
||||
page: {
|
||||
curr: 1
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//触发事件
|
||||
var active = {
|
||||
tabChange: function(){
|
||||
//切换到指定Tab项
|
||||
// element.tabChange('demo', this.getAttribute('lay-id')); //切换tab
|
||||
var marign = document.getElementById('set_margin');
|
||||
var refund = document.getElementById('refund_margin');
|
||||
if ('11'==this.getAttribute('lay-id')) {
|
||||
marign.style.display = "block";
|
||||
refund.style.display = "none";
|
||||
// refund.childNodes().value='';
|
||||
}else{
|
||||
refund.style.display = "block";
|
||||
marign.style.display = "none";
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$('.site-demo-active').on('click', function(){
|
||||
var othis = $(this), type = othis.data('type');
|
||||
active[type] ? active[type].call(this, othis) : '';
|
||||
});
|
||||
|
||||
//Hash地址的定位
|
||||
// var layid = location.hash.replace(/^#test=/, '');
|
||||
// element.tabChange('test', layid);
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
102
app/admin/view/merchant/system/merchant/margin/read.html
Normal file
102
app/admin/view/merchant/system/merchant/margin/read.html
Normal file
@ -0,0 +1,102 @@
|
||||
{extend name="common/base"/}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
|
||||
<div class="p-3">
|
||||
|
||||
<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
|
||||
<ul class="layui-tab-title">
|
||||
<li class="layui-this">扣费记录</li>
|
||||
</ul>
|
||||
<div class="layui-tab-content" style="height: 100px;">
|
||||
|
||||
<!-- 缴存列表 -->
|
||||
<div class="layui-tab-item layui-show">
|
||||
<table class="layui-hide" id="reduct_list" lay-filter="reduct_list">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script>
|
||||
function GetQueryString(name) {
|
||||
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
||||
var r = window.location.search.substr(1).match(reg); //获取url中"?"符后的字符串并正则匹配
|
||||
var context = "";
|
||||
if (r != null)
|
||||
context = decodeURIComponent(r[2]);
|
||||
reg = null;
|
||||
r = null;
|
||||
return context == null || context == "" || context == "undefined" ? "" : context;
|
||||
}
|
||||
// alert(GetQueryString("id"));
|
||||
|
||||
const moduleInit = ['tool'];
|
||||
function gouguInit() {
|
||||
var table = layui.table, tool = layui.tool, form = layui.form;
|
||||
layui.pageTable = table.render({
|
||||
elem: '#reduct_list',
|
||||
title: '扣费记录',
|
||||
toolbar: '#toolbarDemo',
|
||||
url: '/admin/margin/reductlst?id='+GetQueryString("id"),
|
||||
parseData: function(res){ //res 即为原始返回的数据
|
||||
return {
|
||||
"code": res.code, //解析接口状态
|
||||
"msg": res.msg, //解析提示文本
|
||||
"count": res.data.count, //解析数据长度
|
||||
"data": res.data.list //解析数据列表
|
||||
};
|
||||
},
|
||||
page: true,
|
||||
limit: 20,
|
||||
cellMinWidth: 300,
|
||||
cols: [
|
||||
[
|
||||
{
|
||||
fixed: 'ID',
|
||||
field: 'bill_id',
|
||||
title: 'ID',
|
||||
align: 'center',
|
||||
width: 80
|
||||
},
|
||||
{
|
||||
field: 'mark',
|
||||
title: '扣费原因',
|
||||
align: 'center',
|
||||
width: 500,
|
||||
},{
|
||||
field: 'number',
|
||||
title: '扣费金额',
|
||||
align: 'center',
|
||||
width: 200,
|
||||
},{
|
||||
field: 'create_time',
|
||||
title: '操作时间',
|
||||
align: 'center',
|
||||
width: 200
|
||||
}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
// 日期范围
|
||||
// layui.use('laydate', function () {
|
||||
// var laydate = layui.laydate;
|
||||
// //日期范围
|
||||
// laydate.render({
|
||||
// elem: '#test6'
|
||||
// //设置开始日期、日期日期的 input 选择器
|
||||
// //数组格式为 2.6.6 开始新增,之前版本直接配置 true 或任意分割字符即可
|
||||
// , range: ['#test-startDate-1', '#test-endDate-1']
|
||||
// });
|
||||
// });
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
@ -0,0 +1,63 @@
|
||||
{extend name="common/base"/}
|
||||
{block name="style"}
|
||||
<style>
|
||||
.content-article img{max-width:88%!important; height:auto!important; margin:6px 0!important; border-radius:4px;}
|
||||
</style>
|
||||
{/block}
|
||||
<!-- 主体 -->
|
||||
{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">店铺类型名称</td>
|
||||
<td colspan="7"><input type="text" name="store_name" lay-verify="required" lay-reqText="请输入商品名称"
|
||||
autocomplete="off" placeholder="请输入商品名称" class="layui-input" value="{$detail.type_name}" readonly></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="layui-td-gray">店铺类型要求</td>
|
||||
<td colspan="7">
|
||||
<input type="text" name="store_name" lay-verify="required" lay-reqText="请输入商品名称"
|
||||
autocomplete="off" placeholder="请输入商品名称" class="layui-input" value="{$detail.type_info}" readonly>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="layui-td-gray">店铺保证金</td>
|
||||
<td colspan="7"><input type="text" name="price" lay-verify="required" lay-reqText="请输入商品关键字"
|
||||
autocomplete="off" placeholder="请输入商品关键字" class="layui-input" value="{$detail.margin}" readonly></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="layui-td-gray">店铺权限</td>
|
||||
<td colspan="3">
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="layui-td-gray" style="text-align:left">其它说明</td>
|
||||
<td colspan="6">
|
||||
<textarea class="layui-textarea" name="store_info" readonly>{$detail.store_info}</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="layui-td-gray" style="text-align:left">创建时间</td>
|
||||
<td colspan="6">
|
||||
{$detail.create_time}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="layui-td-gray" style="text-align:left">修改时间</td>
|
||||
<td colspan="6">
|
||||
{$detail.update_time}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
@ -20,14 +20,14 @@
|
||||
<td colspan="2" class="layui-td-gray">店铺类型名称<font>*</font></td>
|
||||
<td colspan="6">
|
||||
<input type="text" name="type_name" lay-verify="required" lay-reqText="请输入商品名称"
|
||||
autocomplete="off" placeholder="请输入商品名称" class="layui-input" value="123131{$detail.type_name}">
|
||||
autocomplete="off" placeholder="请输入商品名称" class="layui-input" value="">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2" class="layui-td-gray">店铺类型要求</td>
|
||||
<td colspan="6">
|
||||
<textarea class="layui-textarea" name="type_info">{$detail.type_name}</textarea>
|
||||
<textarea class="layui-textarea" name="type_info"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@ -38,15 +38,15 @@
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" name="is_margin" value="1" title="有" checked="{$detail.is_margin}">
|
||||
<input type="radio" name="is_margin" value="0" title="无" checked="{$detail.is_margin}">
|
||||
<input type="radio" name="is_margin" value="1" title="有" checked="">
|
||||
<input type="radio" name="is_margin" value="0" title="无" checked="">
|
||||
</div>
|
||||
</td>
|
||||
<td colspan="5"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<input type="text" name="margin" lay-verify="required" lay-reqText="0" autocomplete="off" placeholder="0" class="layui-input" value="{$detail.margin}">
|
||||
<input type="text" name="margin" lay-verify="required" lay-reqText="0" autocomplete="off" placeholder="0" class="layui-input" value="">
|
||||
</td>
|
||||
<td colspan="5">单位:元</td>
|
||||
</tr>
|
||||
@ -64,7 +64,7 @@
|
||||
<tr>
|
||||
<td colspan="2" class="layui-td-gray">其它说明</td>
|
||||
<td colspan="6">
|
||||
<textarea class="layui-textarea" name="description">{$detail.description}</textarea>
|
||||
<textarea class="layui-textarea" name="description"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -105,14 +105,6 @@
|
||||
,util = layui.util
|
||||
//模拟数据
|
||||
,data = getData();
|
||||
// [{
|
||||
// title: '一级1'
|
||||
// ,id: 1
|
||||
// ,field: 'name1'
|
||||
// ,checked: true
|
||||
// ,spread: true
|
||||
// ,children: [{}]
|
||||
// }]
|
||||
|
||||
//开启复选框
|
||||
tree.render({
|
||||
@ -124,7 +116,6 @@
|
||||
|
||||
//监听提交
|
||||
form.on('submit(webform)', function (data) {
|
||||
console.log(data.field);
|
||||
// data.field.content = tinyMCE.editors['container_content'].getContent();
|
||||
if (data.field == '') {
|
||||
layer.msg('请先完善店铺类型');
|
||||
@ -140,10 +131,18 @@
|
||||
|
||||
//获得选中的节点
|
||||
var checkData = tree.getChecked('id');
|
||||
var list = new Array();
|
||||
list = getChecked_list(checkData);
|
||||
data.field.auth = list
|
||||
tool.post('/admin/merchant/type/add', data.field, callback);
|
||||
var list = getChecked_list(checkData);
|
||||
|
||||
var params = new Object();
|
||||
params.id = data.field.id
|
||||
params.type_name = data.field.type_name
|
||||
params.type_info = data.field.type_info
|
||||
params.is_margin = data.field.is_margin
|
||||
params.margin = data.field.margin
|
||||
params.description = data.field.description
|
||||
params.auth = list
|
||||
|
||||
tool.post('/admin/merchant/type/add', params, callback);
|
||||
|
||||
return true;
|
||||
});
|
||||
@ -170,31 +169,29 @@
|
||||
|
||||
}
|
||||
|
||||
//获取店铺权限的数据
|
||||
//获取店铺权限的数据[数据来自模板变量]
|
||||
function getData(){
|
||||
|
||||
/* 初始化页面渲染时传过来的js变量 */
|
||||
let dataContainerElem = document.querySelector('.data-box'),
|
||||
|
||||
data = dataContainerElem ? dataContainerElem.dataset : {},
|
||||
dataBox = {}; //模板变量容器,`.data-box`类选择器所在的所有`data`属性值集合
|
||||
let dataContainerElem = document.querySelector('.data-box'), data = dataContainerElem ? dataContainerElem.dataset : {}, dataBox = {}; //模板变量容器,`.data-box`类选择器所在的所有`data`属性值集合
|
||||
Object.keys(data).forEach(function (key) {
|
||||
dataBox[key] = data[key];
|
||||
if (isJsonString(data[key])) dataBox[key] = JSON.parse(data[key]); //是json格式的字串才转对象
|
||||
});
|
||||
if (isJsonString(data[key]))
|
||||
dataBox[key] = JSON.parse(data[key]); //是json格式的字串才转对象
|
||||
});
|
||||
|
||||
/**
|
||||
* 判断字串是否属于json字串
|
||||
*/
|
||||
function isJsonString(str) {
|
||||
function isJsonString(str) {
|
||||
let flag = false;
|
||||
|
||||
if (typeof str != 'string') return flag;
|
||||
|
||||
try {
|
||||
JSON.parse(str);
|
||||
flag = true;
|
||||
} catch (e) {}
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
|
||||
return flag;
|
||||
}
|
||||
|
210
app/admin/view/merchant/system/merchant/type/edit.html
Normal file
210
app/admin/view/merchant/system/merchant/type/edit.html
Normal file
@ -0,0 +1,210 @@
|
||||
{extend name="common/base"/}
|
||||
{block name="style"}
|
||||
<style type="text/css">
|
||||
.editormd-code-toolbar select {
|
||||
display: inline-block
|
||||
}
|
||||
|
||||
.editormd li {
|
||||
list-style: inherit;
|
||||
}
|
||||
</style>
|
||||
{/block}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<form class="layui-form p-4">
|
||||
<h3 class="pb-3">编辑店铺类型</h3>
|
||||
<table class="layui-table layui-table-form">
|
||||
<tr>
|
||||
<td colspan="2" class="layui-td-gray">店铺类型名称<font>*</font></td>
|
||||
<td colspan="6">
|
||||
<input type="text" name="type_name" lay-verify="required" lay-reqText="请输入商品名称"
|
||||
autocomplete="off" placeholder="请输入商品名称" class="layui-input" value="{$detail.type_name}">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2" class="layui-td-gray">店铺类型要求</td>
|
||||
<td colspan="6">
|
||||
<textarea class="layui-textarea" name="type_info">{$detail.type_name}</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2" class="layui-td-gray">店铺保证金</td>
|
||||
<td colspan="6">
|
||||
<table class="layui-table layui-table-form">
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" name="is_margin" value="1" title="有" checked="{$detail.is_margin}">
|
||||
<input type="radio" name="is_margin" value="0" title="无" checked="{$detail.is_margin}">
|
||||
</div>
|
||||
</td>
|
||||
<td colspan="5"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<input type="text" name="margin" lay-verify="required" lay-reqText="0" autocomplete="off" placeholder="0" class="layui-input" value="{$detail.margin}">
|
||||
</td>
|
||||
<td colspan="5">单位:元</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" style="height: 360px;" class="layui-td-gray">店铺权限<font>*</font></td>
|
||||
<td colspan="6" >
|
||||
<div class="data-box" data-admin='{:json_encode($dataTree)}'></div>
|
||||
<div id="test7" class="demo-tree-more"></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2" class="layui-td-gray">其它说明</td>
|
||||
<td colspan="6">
|
||||
<textarea class="layui-textarea" name="description">{$detail.description}</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="pt-3">
|
||||
<input type="hidden" name="id" value="{$id}">
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform" type='button'>立即提交</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||
</div>
|
||||
</form>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script src="/static/assets/js/xm-select.js"></script>
|
||||
|
||||
<script>
|
||||
var moduleInit = ['tool','treeGrid', 'tagpicker', 'tinymce', 'admin'];
|
||||
var group_access = "{:session('gougu_admin')['group_access']}"
|
||||
|
||||
function gouguInit() {
|
||||
var treeGrid = layui.treeGrid,table = layui.table
|
||||
|
||||
var tool = layui.tool;
|
||||
var form = layui.form, tool = layui.tool, tagspicker = layui.tagpicker;
|
||||
|
||||
var editor = layui.tinymce;
|
||||
var edit = editor.render({
|
||||
selector: "#container_content",
|
||||
height: 500,
|
||||
});
|
||||
|
||||
|
||||
// 店铺权限
|
||||
layui.use(['tree', 'util'], function(){
|
||||
var tree = layui.tree
|
||||
,layer = layui.layer
|
||||
,util = layui.util
|
||||
,data = getData();
|
||||
|
||||
//开启复选框
|
||||
tree.render({
|
||||
elem: '#test7'
|
||||
,data: data
|
||||
,showCheckbox: true
|
||||
,id:'id'//菜单id
|
||||
// ,click: function(obj){
|
||||
// var data = obj.data; //获取当前点击的节点数据
|
||||
// }
|
||||
});
|
||||
|
||||
|
||||
//监听提交
|
||||
form.on('submit(webform)', function (data) {
|
||||
// data.field.content = tinyMCE.editors['container_content'].getContent();
|
||||
if (data.field == '') {
|
||||
layer.msg('请先完善店铺类型');
|
||||
return false;
|
||||
}
|
||||
let callback = function (e) {
|
||||
layer.msg(e.msg);
|
||||
if (e.code == 0) {
|
||||
tool.tabRefresh(71);
|
||||
tool.sideClose(1000);
|
||||
}
|
||||
}
|
||||
|
||||
//获得选中的节点
|
||||
var checkData = tree.getChecked('id');
|
||||
var list = getChecked_list(checkData);
|
||||
|
||||
var params = new Object();
|
||||
params.id = data.field.id
|
||||
params.type_name = data.field.type_name
|
||||
params.type_info = data.field.type_info
|
||||
params.is_margin = data.field.is_margin
|
||||
params.margin = data.field.margin
|
||||
params.description = data.field.description
|
||||
params.auth = list
|
||||
|
||||
tool.put('/admin/merchant/type/edit', params, callback);
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
// 获取选中节点的id
|
||||
function getChecked_list(data) {
|
||||
var id = "";
|
||||
$.each(data, function (index, item) {
|
||||
if (id != "") {
|
||||
id = id + "," + item.id;
|
||||
}
|
||||
else {
|
||||
id = item.id;
|
||||
}
|
||||
var i = getChecked_list(item.children);
|
||||
if (i != "") {
|
||||
id = id + "," + i;
|
||||
}
|
||||
});
|
||||
return id;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//获取店铺权限的数据[数据来自模板变量]
|
||||
function getData(){
|
||||
|
||||
/* 初始化页面渲染时传过来的js变量 */
|
||||
let dataContainerElem = document.querySelector('.data-box'), data = dataContainerElem ? dataContainerElem.dataset : {}, dataBox = {}; //模板变量容器,`.data-box`类选择器所在的所有`data`属性值集合
|
||||
Object.keys(data).forEach(function (key) {
|
||||
dataBox[key] = data[key];
|
||||
if (isJsonString(data[key]))
|
||||
dataBox[key] = JSON.parse(data[key]); //是json格式的字串才转对象
|
||||
});
|
||||
|
||||
/**
|
||||
* 判断字串是否属于json字串
|
||||
*/
|
||||
function isJsonString(str) {
|
||||
let flag = false;
|
||||
if (typeof str != 'string') return flag;
|
||||
try {
|
||||
JSON.parse(str);
|
||||
flag = true;
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
|
||||
return flag;
|
||||
}
|
||||
|
||||
//所有保存到数据节点的变量都成为`dataBox`对象的属性
|
||||
// console.log(dataBox.admin)
|
||||
return dataBox.admin;
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
@ -1,7 +1,6 @@
|
||||
{extend name="common/base"/}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
|
||||
<div class="p-3">
|
||||
<table class="layui-hide" id="store_product" lay-filter="store_product"></table>
|
||||
</div>
|
||||
@ -33,9 +32,20 @@
|
||||
title: '商品表列表',
|
||||
toolbar: '#toolbarDemo',
|
||||
url: '/admin/merchant/type/lst',
|
||||
parseData: function(res){ //res 即为原始返回的数据
|
||||
return {
|
||||
"code": res.code, //解析接口状态
|
||||
"msg": res.msg, //解析提示文本
|
||||
"count": res.data.count, //解析数据长度
|
||||
"data": res.data.list //解析数据列表
|
||||
};
|
||||
},
|
||||
done: function (res, curr, count){
|
||||
$('table').width('100%');
|
||||
},
|
||||
page: true,
|
||||
limit: 20,
|
||||
cellMinWidth: 300,
|
||||
cellMinWidth: 100,
|
||||
cols: [
|
||||
[
|
||||
{
|
||||
@ -49,12 +59,12 @@
|
||||
field: 'type_name',
|
||||
title: '店铺类型名称',
|
||||
align: 'center',
|
||||
width: 200
|
||||
width: 180
|
||||
},{
|
||||
field: 'margin',
|
||||
title: '店铺保证金',
|
||||
align: 'center',
|
||||
width: 100
|
||||
width: 150
|
||||
},{
|
||||
field: 'type_info',
|
||||
title: '店铺类型要求',
|
||||
@ -64,19 +74,19 @@
|
||||
field: 'create_time',
|
||||
title: '创建时间',
|
||||
align: 'center',
|
||||
width: 150
|
||||
width: 200
|
||||
},{
|
||||
field: 'update_time',
|
||||
title: '最近修改时问',
|
||||
align: 'center',
|
||||
width: 150
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
fixed: 'right',
|
||||
field: 'right',
|
||||
title: '操作',
|
||||
toolbar: '#barDemo',
|
||||
width: 190,
|
||||
width: 180,
|
||||
align: 'center'
|
||||
}
|
||||
]
|
||||
@ -94,7 +104,6 @@
|
||||
|
||||
//监听表格行工具事件
|
||||
table.on('tool(store_product)', function(obj) {
|
||||
console.log(obj.data);
|
||||
var data = obj.data;
|
||||
if (obj.event === 'read') {
|
||||
tool.side('/admin/merchant/type/read?id='+obj.data.id);
|
||||
|
@ -7,7 +7,7 @@
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<div class="layui-form p-4">
|
||||
<h3 class="pb-3">文章详情</h3>
|
||||
<h3 class="pb-3">查看店铺类型</h3>
|
||||
<table class="layui-table layui-table-form">
|
||||
<tr>
|
||||
<td class="layui-td-gray">店铺类型名称</td>
|
||||
@ -32,15 +32,15 @@
|
||||
<tr>
|
||||
<td class="layui-td-gray">店铺权限</td>
|
||||
<td colspan="3">
|
||||
|
||||
|
||||
<div class="data-box" data-admin='{:json_encode($dataTree)}'></div>
|
||||
<div id="test7" class="demo-tree-more"></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="layui-td-gray" style="text-align:left">其它说明</td>
|
||||
<td colspan="6">
|
||||
<textarea class="layui-textarea" name="store_info" readonly>{$detail.store_info}</textarea>
|
||||
<textarea class="layui-textarea" name="store_info" readonly>{$detail.type_info}</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@ -60,4 +60,68 @@
|
||||
</table>
|
||||
</div>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
||||
<!-- /主体 -->
|
||||
{block name="script"}
|
||||
|
||||
<script>
|
||||
var moduleInit = ['tool','treeGrid', 'tagpicker', 'tinymce', 'admin'];
|
||||
var group_access = "{:session('gougu_admin')['group_access']}"
|
||||
|
||||
function gouguInit() {
|
||||
|
||||
// 店铺权限
|
||||
layui.use(['tree', 'util'], function(){
|
||||
var tree = layui.tree
|
||||
,layer = layui.layer
|
||||
,util = layui.util
|
||||
,data = getData();
|
||||
|
||||
//开启复选框
|
||||
tree.render({
|
||||
elem: '#test7'
|
||||
,data: data
|
||||
,showLine:false
|
||||
,id:'id'//菜单id
|
||||
// ,click: function(obj){
|
||||
// var data = obj.data; //获取当前点击的节点数据
|
||||
// }
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//获取店铺权限的数据[数据来自模板变量]
|
||||
function getData(){
|
||||
|
||||
/* 初始化页面渲染时传过来的js变量 */
|
||||
let dataContainerElem = document.querySelector('.data-box'), data = dataContainerElem ? dataContainerElem.dataset : {}, dataBox = {}; //模板变量容器,`.data-box`类选择器所在的所有`data`属性值集合
|
||||
Object.keys(data).forEach(function (key) {
|
||||
dataBox[key] = data[key];
|
||||
if (isJsonString(data[key]))
|
||||
dataBox[key] = JSON.parse(data[key]); //是json格式的字串才转对象
|
||||
});
|
||||
|
||||
/**
|
||||
* 判断字串是否属于json字串
|
||||
*/
|
||||
function isJsonString(str) {
|
||||
let flag = false;
|
||||
if (typeof str != 'string') return flag;
|
||||
try {
|
||||
JSON.parse(str);
|
||||
flag = true;
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
|
||||
return flag;
|
||||
}
|
||||
|
||||
//所有保存到数据节点的变量都成为`dataBox`对象的属性
|
||||
// console.log(dataBox.admin)
|
||||
return dataBox.admin;
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
{/block}
|
@ -24,49 +24,60 @@
|
||||
<h3 class="pb-3">添加</h3>
|
||||
<table class="layui-table layui-table-form">
|
||||
|
||||
<tr>
|
||||
<td class="layui-td-gray">上级分类<font>*</font>
|
||||
</td>
|
||||
<td>
|
||||
<select name="" lay-filter="storeBrandCategory" lay-search>
|
||||
<option value="">选择分类</option>
|
||||
{volist name='storeBrandCategory' id='vo'}
|
||||
<option value="{$vo.store_brand_category_id}" >{$vo.cate_name}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<div class="layui-col-md4">
|
||||
<label class="layui-form-label">子分类</label>
|
||||
<div class="layui-input-block">
|
||||
<div id="demo1"></div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="layui-td-gray">品牌名称<font>*</font></td>
|
||||
<td class="layui-td-gray">参数模板名称<font>*</font></td>
|
||||
<td colspan="4">
|
||||
<input type="text" name="brand_name" lay-verify="required" lay-reqText="请输入品牌名称"
|
||||
autocomplete="off" placeholder="请输入品牌名称" class="layui-input">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">是否显示</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="checkbox" name="is_show" lay-skin="switch">
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class="layui-td-gray">排序</td>
|
||||
<td>
|
||||
<input type="text" name="sort" value="0" placeholder="请输入数字,越小越靠前" autocomplete="off"
|
||||
class="layui-input">
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<table class="layui-table layui-table-form">
|
||||
|
||||
<tr>
|
||||
<th>参数名称</th>
|
||||
<th>参数值</th>
|
||||
<th>排序</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td >
|
||||
<input type="text" name="brand_name" lay-verify="required" lay-reqText="请输入参数名称"
|
||||
autocomplete="off" placeholder="请输入参数名称" class="layui-input">
|
||||
</td>
|
||||
<td >
|
||||
<input type="text" name="brand_name" lay-verify="required" lay-reqText="请输入参数值"
|
||||
autocomplete="off" placeholder="请输入参数值" class="layui-input">
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" name="sort" lay-verify="required"
|
||||
autocomplete="off" class="layui-input">
|
||||
</td>
|
||||
<td>
|
||||
删除
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="add_paramter">添加参数</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
<div class="pt-3">
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
|
@ -3,11 +3,33 @@
|
||||
{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" />
|
||||
<form class="layui-form gg-form-bar border-t border-x" style="display:flex;justify-content: 'space-around';">
|
||||
<div>
|
||||
<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>
|
||||
|
||||
</div>
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="searchform">搜索</button>
|
||||
|
||||
<div>
|
||||
<table class="layui-table layui-table-form">
|
||||
<tr>
|
||||
<td style="padding-right:10px;">
|
||||
<b>平台分类 </b>
|
||||
</td>
|
||||
<td>
|
||||
<select name="pid" lay-filter="seleCate" lay-verify="required" lay-reqText="请选择">
|
||||
<option value="0">请选择</option>
|
||||
{volist name="$cate_list" id="v"}
|
||||
<option value="{$v.id}" >{$v.title}{$v.cate_name} </option>
|
||||
{/volist}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<table class="layui-hide" id="article" lay-filter="article"></table>
|
||||
</div>
|
||||
@ -24,7 +46,7 @@
|
||||
<script type="text/html" id="toolbarDemo">
|
||||
<div class="layui-btn-container">
|
||||
{if {:auth_cache(session('gougu_admin')['id'],$url[1])}==true}
|
||||
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加品牌">+ 添加品牌</span>
|
||||
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加参数模板">+ 添加参数模板</span>
|
||||
{/if}
|
||||
</div>
|
||||
</script>
|
||||
@ -57,43 +79,47 @@
|
||||
title: '列表',
|
||||
toolbar: '#toolbarDemo',
|
||||
url: '{$url[0]}',
|
||||
parseData: function(res){ //res 即为原始返回的数据
|
||||
return {
|
||||
"code": res.code, //解析接口状态
|
||||
"msg": res.msg, //解析提示文本
|
||||
"count": res.data.count, //解析数据长度
|
||||
"data": res.data.list //解析数据列表
|
||||
};
|
||||
},
|
||||
page: true,
|
||||
limit: 20,
|
||||
cols: [
|
||||
[
|
||||
{
|
||||
fixed: 'left',
|
||||
field: 'brand_id',
|
||||
field: 'template_id',
|
||||
title: '编号',
|
||||
align: 'center',
|
||||
width:80,
|
||||
},{
|
||||
field: 'brand_name',
|
||||
title: '品牌名称',
|
||||
align: 'center',
|
||||
},{
|
||||
field: 'sort',
|
||||
title: '排序',
|
||||
align: 'center',
|
||||
},{
|
||||
field: 'status',
|
||||
title: '是否显示',
|
||||
align: 'center',
|
||||
templet: function (d)
|
||||
{
|
||||
return d.is_show ? '显示' : '隐藏';
|
||||
},
|
||||
},{
|
||||
field: 'create_time',
|
||||
title: '创建时间',
|
||||
align: 'center',
|
||||
},{
|
||||
fixed: 'right',
|
||||
field: 'right',
|
||||
title: '操作',
|
||||
toolbar: '#barDemo',
|
||||
align: 'center'
|
||||
}
|
||||
field: 'template_name',
|
||||
title: '模板名称',
|
||||
align: 'center',
|
||||
},{
|
||||
field: 'cateid',
|
||||
title: '关联分类',
|
||||
align: 'center',
|
||||
},{
|
||||
field: 'sort',
|
||||
title: '排序',
|
||||
align: 'center',
|
||||
},{
|
||||
field: 'create_time',
|
||||
title: '创建时间',
|
||||
align: 'center',
|
||||
},{
|
||||
fixed: 'right',
|
||||
field: 'right',
|
||||
title: '操作',
|
||||
toolbar: '#barDemo',
|
||||
align: 'center'
|
||||
}
|
||||
]
|
||||
]
|
||||
});
|
||||
@ -146,6 +172,23 @@
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
//监听分类提交
|
||||
form.on('select(seleCate)', function(data) {
|
||||
console.log(data);
|
||||
layui.pageTable.reload({
|
||||
where: {
|
||||
keywords: data.field.keywords,
|
||||
cate_id: data.field.cate_id
|
||||
},
|
||||
page: {
|
||||
curr: 1
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
{/block}
|
437
app/admin/view/product/product/index.back.html
Normal file
437
app/admin/view/product/product/index.back.html
Normal file
@ -0,0 +1,437 @@
|
||||
{extend name="common/base"/}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<style>
|
||||
.layui-input-inline{
|
||||
width:35% !important;
|
||||
}
|
||||
.layui-input-inline .layui-form-item{
|
||||
display:flex;
|
||||
}
|
||||
.layui-input-inline .layui-form-item .layui-form-label{
|
||||
width:30%;
|
||||
}
|
||||
.layui-input-block{
|
||||
margin-left:unset !important;
|
||||
width:75%;
|
||||
}
|
||||
#seleform{
|
||||
border-color: #eee;
|
||||
background-color: #fff;
|
||||
color:#a39f9f;
|
||||
width:100%;
|
||||
}
|
||||
</style>
|
||||
<div class="p-3">
|
||||
<div class="layui-form">
|
||||
<form id="filterform" class="layui-form gg-form-bar border-t border-x" >
|
||||
|
||||
<div class="layui-form-item">
|
||||
|
||||
<div class="layui-input-inline">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">平台商品分类</label>
|
||||
<div class="layui-input-block">
|
||||
<select id="plate_cate" name="plate_cate" lay-filter="seleform">
|
||||
<option value="">请选择商品分类</option>
|
||||
{volist name="$cate_list" id="v"}
|
||||
<option value="{$v.id}" >{$v.title}{$v.cate_name} </option>
|
||||
{/volist}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-input-inline">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">商户商品分类</label>
|
||||
<div class="layui-input-block">
|
||||
<input id="store_cate" type="hidden" readonly="readonly" name="store_cate">
|
||||
<button id="seleform" lay-filter="seleform" class="layui-btn">请选择</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
|
||||
<div class="layui-input-inline">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">是否为礼包</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="is_gift" lay-filter="seleform">
|
||||
<option value=""></option>
|
||||
<option value="0">是</option>
|
||||
<option value="1">否</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-input-inline">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">商品状态</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="state" lay-filter="seleform">
|
||||
<option value=""></option>
|
||||
<option value="1">上架</option>
|
||||
<option value="0">下架</option>
|
||||
<option value="2">平台关闭</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
|
||||
<div class="layui-input-inline">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">标签</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="tag" lay-filter="seleform" data-type="reload">
|
||||
<option value=""></option>
|
||||
<option value="0">写作</option>
|
||||
<option value="1">阅读</option>
|
||||
<option value="2">游戏</option>
|
||||
<option value="3">音乐</option>
|
||||
<option value="4">旅行</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-input-inline">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">运费模板</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="shipping_tem" lay-filter="seleform">
|
||||
<option value=""></option>
|
||||
<option value="0">写作</option>
|
||||
<option value="1">阅读</option>
|
||||
<option value="2">游戏</option>
|
||||
<option value="3">音乐</option>
|
||||
<option value="4">旅行</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-inline" style="display:flex;">
|
||||
<label class="layui-form-label">关键字搜索</label>
|
||||
|
||||
<div class="layui-input-block" style="display:flex">
|
||||
<div class="layui-input-inline" style="width: 78% !important">
|
||||
<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>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<table class="layui-hide" id="article" lay-filter="article"></table>
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="status">
|
||||
<i class="layui-icon {{# if(d.status == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
|
||||
</script>
|
||||
<script type="text/html" id="is_home">
|
||||
<i class="layui-icon {{# if(d.is_home == 1){ }}layui-icon-ok{{# } else { }}layui-icon-close{{# } }}"></i>
|
||||
</script>
|
||||
<script type="text/html" id="thumb">
|
||||
|
||||
</script>
|
||||
<!-- <script type="text/html" id="toolbarDemo">
|
||||
<div class="layui-btn-container">
|
||||
{if {:auth_cache(session('gougu_admin')['id'],$url[1])}==true}
|
||||
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加虚拟评论">+ 添加虚拟评论</span>
|
||||
{/if}
|
||||
</div>
|
||||
</script> -->
|
||||
|
||||
<script type="text/html" id="barDemo">
|
||||
<div class="layui-btn-group">
|
||||
{if {:auth_cache(session('gougu_admin')['id'],$url[2])}==true}
|
||||
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a>
|
||||
{/if}
|
||||
{if {:auth_cache(session('gougu_admin')['id'],$url[2])}==true}
|
||||
<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
|
||||
{/if}
|
||||
{if {:auth_cache(session('gougu_admin')['id'],$url[3])}==true}
|
||||
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
|
||||
{/if}
|
||||
</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: '#article',
|
||||
title: '列表',
|
||||
toolbar: '#toolbarDemo',
|
||||
url: '{$url[0]}',
|
||||
page: true,
|
||||
limit: 20,
|
||||
cols: [
|
||||
[
|
||||
{
|
||||
fixed: 'left',
|
||||
field: 'product_id',
|
||||
title: '编号',
|
||||
align: 'center',
|
||||
width:80,
|
||||
},{
|
||||
field: 'image',
|
||||
title: '商品图',
|
||||
align: 'center',
|
||||
width:120,
|
||||
templet: function (d)
|
||||
{
|
||||
var html = `<div data-v-d854fb86="" class="el-image" style="width: 36px; height: 36px;">
|
||||
<img style="width:100%;" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQQAAACUCAYAAAB1GVf9AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAABBKADAAQAAAABAAAAlAAAAAD7OG/zAAAH8ElEQVR4Ae3dWXPUOBQGUGcYoKCAByi2///f2LewE5bAzVSXIBPfdu8y9/gFpdVedKT+4pbtcHRycnI6WAgQIPBL4B8KBAgQWAgIhIWEfwkQcIZgDBAg0AScITQLJQLlBQRC+SEAgEATEAjNQolAeQGBUH4IACDQBARCs1AiUF5AIJQfAgAINAGB0CyUCJQXEAjlhwAAAk1AIDQLJQLlBQRC+SEAgEATEAjNQolAeQGBUH4IACDQBARCs1AiUF5AIJQfAgAINAGB0CyUCJQXEAjlhwAAAk1AIDQLJQLlBQRC+SEAgEATEAjNQolAeQGBUH4IACDQBARCs1AiUF5AIJQfAgAINAGB0CyUCJQXEAjlhwAAAk1AIDQLJQLlBQRC+SEAgEATEAjNQolAeQGBUH4IACDQBARCs1AiUF5AIJQfAgAINAGB0CyUCJQXEAjlhwAAAk1AIDQLJQLlBQRC+SEAgEATEAjNQolAeQGBUH4IACDQBARCs1AiUF5AIJQfAgAINAGB0CyUCJQXEAjlhwAAAk1AIDQLJQLlBQRC+SEAgEATEAjNQolAeQGBUH4IACDQBARCs1AiUF5AIJQfAgAINAGB0CyUCJQXEAjlhwAAAk1AIDQLJQLlBQRC+SEAgEATEAjNQolAeQGBUH4IACDQBP5tRaW5CLx//374+PHjcHJyMnz//n24dOnScOXKleH69evDjRs35tIMx9mhwNGvQXXa4XE5pAsEvn79Orx8+XL48uXLBbX/vXT16tXhzp07w+XLl0ffo4LAmIBAGJPp7PUIgadPnw6np8vz++joaLh///4Q4WAhsIqAOYRVtA703giB58+fTwqDOMRV379Jsz5//jwcHx9vsgnrdiQgEDrqjLFDefv27dlcwVj9Ra/H3EKst8vl27dvZ0H15s2bs/mMXe7LtvcjIBD247zRXj59+rTW+uuuN2VncRby4sWL4cePH2dvj7kNy/wFBMIM+jCuJqyzrLvelH29evXqj8nN2FecKVjmLSAQ5t1/Bzn6d+/eDXHp8/wScwm7DKHz+/Pz9gUEwvZNt77FuMdgnWXd9bJ9xdWOODsYW3x1GJOZx+sCYQb9dO3atbWOct31xnYWE5VxtSNb4gzh9evX2VvUdSwgEDrunMWh3bp16+xuxMXPU/6NuxdjvalLXD5ctjx79mzS1Y64uuGrwzLNPusFQp/98sdRxY1Gd+/eHeLfKcuq74/T/Ljp6cOHD6Obj/es8iGPKxBTbqIa3aGKgwgIhIOwr77TuOvw4cOHS+8+nPq+xRHElYHFBGF8iOMZifNL1C/ec75u7Oe4zdpVhzGdfl9363K/fTN6ZPHh3MbDTbGdiyYB7927NyzmH2IS8cmTJ6PHsqziwYMHS0Ns2TbU709AIOzPuqs9RaBkE4TxLEQ8IPX48eNJ8wZjjYttxJnN1K87Y9vx+n4EBMJ+nLvay5QHpeIDHB/mVeYNxhp58+bN4fbt22PVXu9IwBxCR52xj0OJD3hcLVg24Rf12wiDaFPcyBQhZOlfQCD030dbO8J4GCnCYPH8wdY2PGFDrjpMQOrgLQKhg07YxyFECEy9j2AXxxNhlN3huIt92ubqAgJhdbPZrRGn/3GfQVwKPOQSVzWm3AB1yGOsvm+BUGAExNWEbc0HbMoVlzmXzV9sug/rry8gENa3m8Wa8QHc5d9FWBUhvjp41mFVtf29XyDsz3pre4r5gHjQaNkSH7xV7zBcts1t1MdVh55Cahtt+lu2IRBm1pPxQXr06NHZ3YPZnEB86Hb9J9Q2oYszl0Nc7djkmCusKxBm0svxvTtm6RdXCuLUO24pvuj6fjyk1PuMfpzh+OrQ3+ATCP31yf+OKCYE48Mfv/V/X+I3bFw9+P2BpJjFj2v+c1h6/DozB7ddHqP/uWmXulvYdoRA9ts+zhziKkL85yzxF5LiDMJCYF0BgbCu3I7Xi1PqVa4QxHvj+QOX9HbcMX/55gVChx0cXwHWmXQTBh125swOSSB01mERBL5bd9YphQ7HpGJnnS0MOuuQYocjEIp1uOYSyAQEQqajjkAxAYFQrMM1l0AmIBAyHXUEigkIhGIdrrkEMgGBkOmoI1BMwF9dLtbhmksgE3CGkOmoI1BMQCAU63DNJZAJCIRMRx2BYgICoViHay6BTEAgZDrqCBQTEAjFOlxzCWQCAiHTUUegmIBAKNbhmksgExAImY46AsUEBEKxDtdcApmAQMh01BEoJiAQinW45hLIBARCpqOOQDEBgVCswzWXQCYgEDIddQSKCQiEYh2uuQQyAYGQ6agjUExAIBTrcM0lkAkIhExHHYFiAgKhWIdrLoFMQCBkOuoIFBMQCMU6XHMJZAICIdNRR6CYgEAo1uGaSyATEAiZjjoCxQQEQrEO11wCmYBAyHTUESgmIBCKdbjmEsgEBEKmo45AMQGBUKzDNZdAJiAQMh11BIoJCIRiHa65BDIBgZDpqCNQTEAgFOtwzSWQCQiETEcdgWICAqFYh2sugUxAIGQ66ggUExAIxTpccwlkAgIh01FHoJiAQCjW4ZpLIBMQCJmOOgLFBARCsQ7XXAKZgEDIdNQRKCYgEIp1uOYSyAQEQqajjkAxAYFQrMM1l0AmIBAyHXUEigkIhGIdrrkEMgGBkOmoI1BMQCAU63DNJZAJCIRMRx2BYgICoViHay6BTEAgZDrqCBQTEAjFOlxzCWQCPwEYef7DpS5s4AAAAABJRU5ErkJggg==">
|
||||
</div>`;
|
||||
if(d.image)
|
||||
{
|
||||
html = `<div data-v-d854fb86="" class="el-image" style="width: 36px; height: 36px;">
|
||||
<img style="width:100%;" src="` + d.image + `" />
|
||||
</div>`;
|
||||
}
|
||||
return html;
|
||||
},
|
||||
},{
|
||||
field: 'store_name',
|
||||
title: '商品名称',
|
||||
align: 'center',
|
||||
width:120
|
||||
},{
|
||||
field: 'product_score',
|
||||
title: '商户类别',
|
||||
align: 'center',
|
||||
width:150,
|
||||
templet: function (d)
|
||||
{
|
||||
return d.storeCategory ? d.storeCategory.cate_name : '待定';
|
||||
}
|
||||
},{
|
||||
field: 'price',
|
||||
title: '商品售价',
|
||||
align: 'center',
|
||||
width:150,
|
||||
},{
|
||||
field: 'sales',
|
||||
title: '销量',
|
||||
align: 'center',
|
||||
width:150,
|
||||
},{
|
||||
field: 'stock',
|
||||
title: '库存',
|
||||
align: 'center',
|
||||
width:150,
|
||||
},{
|
||||
field: 'is_good',
|
||||
title: '推荐级别',
|
||||
align: 'center',
|
||||
width:120,
|
||||
},{
|
||||
field: 'sort',
|
||||
title: '排序',
|
||||
align: 'center',
|
||||
width:120,
|
||||
},{
|
||||
field: 'is_used',
|
||||
title: '是否显示',
|
||||
align: 'center',
|
||||
width:150,
|
||||
templet: function (d)
|
||||
{
|
||||
var html = d.is_used ? '显示' : '隐藏';
|
||||
return html;
|
||||
},
|
||||
},{
|
||||
field: 'is_show',
|
||||
title: '商品状态',
|
||||
align: 'center',
|
||||
width:150,
|
||||
templet: function (d)
|
||||
{
|
||||
var html = d.is_show ? '上架显示' : '平台关闭';
|
||||
return html;
|
||||
},
|
||||
},{
|
||||
field: 'keyword',
|
||||
title: '标签',
|
||||
align: 'center',
|
||||
width:150,
|
||||
},{
|
||||
fixed: 'right',
|
||||
field: 'right',
|
||||
title: '操作',
|
||||
toolbar: '#barDemo',
|
||||
align: 'center',
|
||||
width:180,
|
||||
}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
//监听表头工具栏事件
|
||||
table.on('toolbar(article)', function(obj){
|
||||
if (obj.event === 'add') {
|
||||
tool.side('{$url[1]}');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
//监听表格行工具事件
|
||||
table.on('tool(article)', function(obj) {
|
||||
var data = obj.data;
|
||||
if (obj.event === 'read') {
|
||||
tool.side('{$url[2]}?id='+obj.data.reply_id);
|
||||
}
|
||||
else if (obj.event === 'edit') {
|
||||
tool.side('{$url[2]}?id='+obj.data.reply_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('{$url[3]}', { id: data.reply_id }, callback);
|
||||
layer.close(index);
|
||||
});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
|
||||
layui.use(['rate','dropdown', 'util', 'layer', 'table'], function(){
|
||||
var dropdown = layui.dropdown
|
||||
,util = layui.util
|
||||
,layer = layui.layer
|
||||
,rate = layui.rate
|
||||
// ,table = layui.table
|
||||
,$ = layui.jquery;
|
||||
|
||||
var $ = layui.$, active = {
|
||||
reload: function(){
|
||||
let dataRload = getformdata();;
|
||||
console.log(dataRload)
|
||||
//执行重载
|
||||
table.reload('article', {
|
||||
page: {
|
||||
curr: 1 //重新从第 1 页开始
|
||||
}
|
||||
,where: {
|
||||
...dataRload
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
//商户商品分类菜单
|
||||
$.ajax({
|
||||
url: '/admin/store/category/select',
|
||||
method: "get",
|
||||
data: {},
|
||||
success: function(res) {
|
||||
if (res.code!==0)return ;
|
||||
|
||||
//高级演示 - 各种组合
|
||||
dropdown.render({
|
||||
elem: '#seleform'
|
||||
,isAllowSpread: false //禁止菜单组展开收缩
|
||||
,style: 'width: 200px' //定义宽度,默认自适应
|
||||
,id: 'test777' //定义唯一索引
|
||||
,title: 'title1'
|
||||
,data: res.data
|
||||
,click: function(item){
|
||||
$('#seleform').text(item.title);
|
||||
$('#seleform').css({color:'rgba(0,0,0,.85)'});
|
||||
$('#store_cate').val(item.id);
|
||||
|
||||
active['reload'] ? active['reload'].call(this) : '';
|
||||
}
|
||||
});
|
||||
},
|
||||
fail:function(){}
|
||||
});
|
||||
|
||||
|
||||
|
||||
//基础效果
|
||||
rate.render({
|
||||
elem: '#is_good'
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
//监听搜索提交
|
||||
form.on('submit(searchform)', function(data) {
|
||||
layui.pageTable.reload({
|
||||
where: {
|
||||
...data.field
|
||||
},
|
||||
page: {
|
||||
curr: 1
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
//监听select提交
|
||||
form.on('select(seleform)', function(data) {
|
||||
active['reload'] ? active['reload'].call(this) : '';
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
// 获取表单所有参数
|
||||
function getformdata() {
|
||||
var form = $('#filterform').serializeArray();
|
||||
|
||||
var data = new Array();
|
||||
for(let i=0;i<form.length; i++){
|
||||
data[form[i].name] = form[i].value;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
@ -1,14 +1,155 @@
|
||||
{extend name="common/base"/}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
|
||||
<style>
|
||||
.layui-input-inline{
|
||||
width:35% !important;
|
||||
}
|
||||
.layui-input-inline .layui-form-item{
|
||||
display:flex;
|
||||
}
|
||||
.layui-input-inline .layui-form-item .layui-form-label{
|
||||
width:30%;
|
||||
}
|
||||
.layui-input-block{
|
||||
margin-left:unset !important;
|
||||
width:75%;
|
||||
}
|
||||
#seleform{
|
||||
border-color: #eee;
|
||||
background-color: #fff;
|
||||
color:#a39f9f;
|
||||
width:100%;
|
||||
}
|
||||
</style>
|
||||
<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>
|
||||
<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
|
||||
<ul class="layui-tab-title">
|
||||
<li class="layui-this site-demo-active" type="1" data-type="reload">出售中的商品</li>
|
||||
<li class="site-demo-active" type="2" data-type="reload">仓库中的商品</li>
|
||||
<li class="site-demo-active" type="3" data-type="reload">已售罄的商品</li>
|
||||
<li class="site-demo-active" type="4" data-type="reload">警戒库存</li>
|
||||
<li class="site-demo-active" type="6" data-type="reload">待审核商品</li>
|
||||
<li class="site-demo-active" type="7" data-type="reload">审核未通过商品</li>
|
||||
<li class="site-demo-active" type="5" data-type="reload">回收站商品</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="layui-form">
|
||||
<form id="filterform" class="layui-form gg-form-bar border-t border-x" >
|
||||
<input id="protype" type="hidden" name="type" value="">
|
||||
<div class="layui-form-item">
|
||||
|
||||
<div class="layui-input-inline">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">平台商品分类</label>
|
||||
<div class="layui-input-block">
|
||||
<select id="plate_cate" name="plate_cate" lay-filter="seleform">
|
||||
<option value="">请选择商品分类</option>
|
||||
{volist name="$cate_list" id="v"}
|
||||
<option value="{$v.id}" >{$v.title}{$v.cate_name} </option>
|
||||
{/volist}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-input-inline">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">商户商品分类</label>
|
||||
<div class="layui-input-block">
|
||||
<input id="store_cate" type="hidden" readonly="readonly" name="store_cate">
|
||||
<button id="seleform" lay-filter="seleform" class="layui-btn">请选择</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
|
||||
<div class="layui-input-inline">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">是否为礼包</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="is_gift" lay-filter="seleform">
|
||||
<option value=""></option>
|
||||
<option value="0">是</option>
|
||||
<option value="1">否</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-input-inline">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">商品状态</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="state" lay-filter="seleform">
|
||||
<option value=""></option>
|
||||
<option value="1">上架</option>
|
||||
<option value="0">下架</option>
|
||||
<option value="2">平台关闭</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
|
||||
<div class="layui-input-inline">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">标签</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="tag" lay-filter="seleform" data-type="reload">
|
||||
<option value=""></option>
|
||||
<option value="0">写作</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-input-inline">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">运费模板</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="shipping_tem" lay-filter="seleform">
|
||||
<option value=""></option>
|
||||
<option value="0">写作</option>
|
||||
<option value="1">阅读</option>
|
||||
<option value="2">游戏</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-inline" style="display:flex;">
|
||||
<label class="layui-form-label">关键字搜索</label>
|
||||
|
||||
<div class="layui-input-block" style="display:flex">
|
||||
<div class="layui-input-inline" style="width: 78% !important">
|
||||
<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>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<table class="layui-hide" id="article" lay-filter="article"></table>
|
||||
</div>
|
||||
|
||||
@ -52,6 +193,7 @@
|
||||
const moduleInit = ['tool'];
|
||||
function gouguInit() {
|
||||
var table = layui.table,tool = layui.tool, form = layui.form;
|
||||
|
||||
layui.pageTable = table.render({
|
||||
elem: '#article',
|
||||
title: '列表',
|
||||
@ -90,16 +232,6 @@
|
||||
title: '商品名称',
|
||||
align: 'center',
|
||||
width:120
|
||||
},{
|
||||
field: 'type_name',
|
||||
title: '商户类型',
|
||||
align: 'center',
|
||||
width:150,
|
||||
templet: function (d)
|
||||
{
|
||||
return d.merchant.merchantType ? d.merchant.merchantType.type_name : '待定';
|
||||
}
|
||||
|
||||
},{
|
||||
field: 'product_score',
|
||||
title: '商户类别',
|
||||
@ -107,7 +239,7 @@
|
||||
width:150,
|
||||
templet: function (d)
|
||||
{
|
||||
return d.merchant.category ? d.merchant.category.category_name : '待定';
|
||||
return d.storeCategory ? d.storeCategory.cate_name : '待定';
|
||||
}
|
||||
},{
|
||||
field: 'price',
|
||||
@ -145,13 +277,13 @@
|
||||
return html;
|
||||
},
|
||||
},{
|
||||
field: 'is_used',
|
||||
field: 'is_show',
|
||||
title: '商品状态',
|
||||
align: 'center',
|
||||
width:150,
|
||||
templet: function (d)
|
||||
{
|
||||
var html = d.is_used ? '上架显示' : '平台关闭';
|
||||
var html = d.is_show ? '上架显示' : '平台关闭';
|
||||
return html;
|
||||
},
|
||||
},{
|
||||
@ -206,29 +338,110 @@
|
||||
return false;
|
||||
});
|
||||
|
||||
//监听搜索提交
|
||||
form.on('submit(searchform)', function(data) {
|
||||
layui.pageTable.reload({
|
||||
where: {
|
||||
keywords: data.field.keywords,
|
||||
cate_id: data.field.cate_id
|
||||
},
|
||||
page: {
|
||||
curr: 1
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
layui.use('rate', function(){
|
||||
var rate = layui.rate;
|
||||
layui.use(['rate','dropdown', 'util', 'layer', 'table'], function(){
|
||||
var dropdown = layui.dropdown
|
||||
,util = layui.util
|
||||
,layer = layui.layer
|
||||
,rate = layui.rate
|
||||
// ,table = layui.table
|
||||
,$ = layui.jquery;
|
||||
|
||||
var $ = layui.$, active = {
|
||||
reload: function(){
|
||||
let dataRload = getformdata();;
|
||||
//执行重载
|
||||
table.reload('article', {
|
||||
page: {
|
||||
curr: 1 //重新从第 1 页开始
|
||||
}
|
||||
,where: {
|
||||
...dataRload
|
||||
}
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
//商户商品分类菜单
|
||||
$.ajax({
|
||||
url: '/admin/store/category/select',
|
||||
method: "get",
|
||||
data: {},
|
||||
success: function(res) {
|
||||
if (res.code!==0)return ;
|
||||
|
||||
//高级演示 - 各种组合
|
||||
dropdown.render({
|
||||
elem: '#seleform'
|
||||
,isAllowSpread: false //禁止菜单组展开收缩
|
||||
,style: 'width: 200px' //定义宽度,默认自适应
|
||||
,id: 'test777' //定义唯一索引
|
||||
,title: 'title1'
|
||||
,data: res.data
|
||||
,click: function(item){
|
||||
$('#seleform').text(item.title);
|
||||
$('#seleform').css({color:'rgba(0,0,0,.85)'});
|
||||
$('#store_cate').val(item.id);
|
||||
|
||||
active['reload'] ? active['reload'].call(this) : '';
|
||||
}
|
||||
});
|
||||
},
|
||||
fail:function(){}
|
||||
});
|
||||
|
||||
|
||||
|
||||
//基础效果
|
||||
rate.render({
|
||||
elem: '#is_good'
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
//监听搜索提交
|
||||
form.on('submit(searchform)', function(data) {
|
||||
layui.pageTable.reload({
|
||||
where: {
|
||||
...data.field
|
||||
},
|
||||
page: {
|
||||
curr: 1
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
//监听select提交
|
||||
form.on('select(seleform)', function(data) {
|
||||
active['reload'] ? active['reload'].call(this) : '';
|
||||
return false;
|
||||
});
|
||||
|
||||
// tab 状态列表切换
|
||||
$('.site-demo-active').on('click', function(){
|
||||
var othis = $(this), type = othis.data('type');
|
||||
$('#protype').val(this.getAttribute('type'));
|
||||
active[type] ? active[type].call(this, othis) : '';
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
// 获取表单所有参数
|
||||
function getformdata() {
|
||||
var form = $('#filterform').serializeArray();
|
||||
|
||||
var data = new Array();
|
||||
for(let i=0;i<form.length; i++){
|
||||
data[form[i].name] = form[i].value;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
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-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}
|
||||
<!-- /主体 -->
|
122
app/admin/view/supply_team/add.html
Normal file
122
app/admin/view/supply_team/add.html
Normal file
@ -0,0 +1,122 @@
|
||||
{extend name="common/base"/}
|
||||
{block name="style"}
|
||||
<style type="text/css">
|
||||
|
||||
.addrhelper-ok-btn{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.layui-form-select dl {
|
||||
z-index: 99999;
|
||||
}
|
||||
</style>
|
||||
{/block}
|
||||
<!-- 主体 -->
|
||||
{block name="body"}
|
||||
<form class="layui-form p-4">
|
||||
<h3 class="pb-3">新建供应链分组</h3>
|
||||
<table class="layui-table layui-table-form">
|
||||
<tr>
|
||||
<td >后台供应链团队分组名称<font>*</font></td>
|
||||
<td colspan="6"><input type="text" name="name" 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>
|
||||
<tr>
|
||||
<td class="layui-td-gray">坐标</td>
|
||||
<td colspan="6">
|
||||
<div id="map"></div>
|
||||
</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 src="/static/assets/js/jquery.min.js"></script>
|
||||
<script src="/static/assets/js/addrHelper.js"></script>
|
||||
<script>
|
||||
var moduleInit = ['tool'];
|
||||
|
||||
function gouguInit() {
|
||||
var form = layui.form, tool = layui.tool;
|
||||
|
||||
|
||||
// 打开坐标拾取器
|
||||
addrHelper.render({
|
||||
key: "QNXBZ-GUKEX-I5Q4Q-THKU6-233DK-7ZBG7", //必传,腾讯地图api key 申请方法见:https://lbs.qq.com/webApi/javascriptGL/glGuide/glBasic
|
||||
el: '#map', //必选项,渲染容器
|
||||
lat: 28.913318, //可选项,初始化纬度
|
||||
lng: 105.437753, //可选项,初始化经度28.913318,105.437753
|
||||
zoom: 13, //可选项,地图缩放级别 默认值13
|
||||
width: "80vw", //可选项,弹窗的宽度 默认80vw
|
||||
height: "50vh", //可选项,弹窗的高度 默认80vh
|
||||
toolbar: false, //可选项,显示工具栏 默认true
|
||||
created: function () { //可选项,地图被创建后回调
|
||||
},
|
||||
});
|
||||
//监听提交
|
||||
form.on('submit(webform)', function (data) {
|
||||
data.field.lng = $('.lng').text();
|
||||
data.field.lat = $('.lat').text();
|
||||
if (data.field.lng == '') {
|
||||
layer.msg('请选择经纬度');
|
||||
return false;
|
||||
}
|
||||
if (data.field.lat == '') {
|
||||
layer.msg('请选择经纬度');
|
||||
return false;
|
||||
}
|
||||
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}
|
||||
<!-- /脚本 -->
|
119
app/admin/view/supply_team/edit.html
Normal file
119
app/admin/view/supply_team/edit.html
Normal file
@ -0,0 +1,119 @@
|
||||
{extend name="common/base"/}
|
||||
{block name="style"}
|
||||
<style type="text/css">
|
||||
|
||||
.addrhelper-ok-btn{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.layui-form-select dl {
|
||||
z-index: 99999;
|
||||
}
|
||||
</style>
|
||||
{/block}
|
||||
<!-- 主体 -->
|
||||
{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 colspan="6"><input type="text" name="name" lay-verify="required" lay-reqText="请完善后台供应链团队分组名称" value="{$detail.name}" 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>
|
||||
<tr>
|
||||
<td class="layui-td-gray">坐标</td>
|
||||
<td colspan="6">
|
||||
<div id="map"></div>
|
||||
</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 src="/static/assets/js/jquery.min.js"></script>
|
||||
<script src="/static/assets/js/addrHelper.js"></script>
|
||||
<script>
|
||||
var moduleInit = ['tool'];
|
||||
|
||||
function gouguInit() {
|
||||
var form = layui.form, tool = layui.tool;
|
||||
var lat = "{$detail.lat}";
|
||||
var lng = "{$detail.lng}";
|
||||
// 打开坐标拾取器
|
||||
addrHelper.render({
|
||||
key: "QNXBZ-GUKEX-I5Q4Q-THKU6-233DK-7ZBG7", //必传,腾讯地图api key 申请方法见:https://lbs.qq.com/webApi/javascriptGL/glGuide/glBasic
|
||||
el: '#map', //必选项,渲染容器
|
||||
lat: 28.913318, //可选项,初始化纬度
|
||||
lng: 105.437753, //可选项,初始化经度28.913318,105.437753
|
||||
zoom: 13, //可选项,地图缩放级别 默认值13
|
||||
width: "80vw", //可选项,弹窗的宽度 默认80vw
|
||||
height: "50vh", //可选项,弹窗的高度 默认80vh
|
||||
toolbar: false, //可选项,显示工具栏 默认true
|
||||
created: function () { //可选项,地图被创建后回调
|
||||
},
|
||||
});
|
||||
$('.lng').text(lng);
|
||||
$('.lat').text(lat);
|
||||
//监听提交
|
||||
form.on('submit(webform)', function (data) {
|
||||
data.field.lng = $('.lng').text();
|
||||
data.field.lat = $('.lat').text();
|
||||
if (data.field.lng == '') {
|
||||
layer.msg('请选择经纬度');
|
||||
return false;
|
||||
}
|
||||
if (data.field.lat == '') {
|
||||
layer.msg('请选择经纬度');
|
||||
return false;
|
||||
}
|
||||
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}
|
||||
<!-- /主体 -->
|
@ -21,13 +21,13 @@
|
||||
<script type="text/html" id="thumb">
|
||||
|
||||
</script>
|
||||
<script type="text/html" id="toolbarDemo">
|
||||
<div class="layui-btn-container">
|
||||
{if {:auth_cache(session('gougu_admin')['id'],$url[1])}==true}
|
||||
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加">+ 添加</span>
|
||||
{/if}
|
||||
</div>
|
||||
</script>
|
||||
<!--<script type="text/html" id="toolbarDemo">-->
|
||||
<!-- <div class="layui-btn-container">-->
|
||||
<!-- {if {:auth_cache(session('gougu_admin')['id'],$url[1])}==true}-->
|
||||
<!-- <span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加">+ 添加</span>-->
|
||||
<!-- {/if}-->
|
||||
<!-- </div>-->
|
||||
<!--</script>-->
|
||||
|
||||
<script type="text/html" id="barDemo">
|
||||
<div class="layui-btn-group">
|
||||
|
@ -21,13 +21,13 @@
|
||||
<script type="text/html" id="thumb">
|
||||
|
||||
</script>
|
||||
<script type="text/html" id="toolbarDemo">
|
||||
<div class="layui-btn-container">
|
||||
{if {:auth_cache(session('gougu_admin')['id'],$url[1])}==true}
|
||||
<span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加">+ 添加</span>
|
||||
{/if}
|
||||
</div>
|
||||
</script>
|
||||
<!--<script type="text/html" id="toolbarDemo">-->
|
||||
<!-- <div class="layui-btn-container">-->
|
||||
<!-- {if {:auth_cache(session('gougu_admin')['id'],$url[1])}==true}-->
|
||||
<!-- <span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加">+ 添加</span>-->
|
||||
<!-- {/if}-->
|
||||
<!-- </div>-->
|
||||
<!--</script>-->
|
||||
|
||||
<script type="text/html" id="barDemo">
|
||||
<div class="layui-btn-group">
|
||||
|
45
app/admin/view/user_extract/add.html
Normal file
45
app/admin/view/user_extract/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">ID<font>*</font></td>
|
||||
<td><input type="text" name="extract_id" lay-verify="required" lay-reqText="请完善ID" value="" autocomplete="off" placeholder="请输入ID" class="layui-input"></td><td colspan='4'></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="pt-3">
|
||||
<input type="hidden" name="extract_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/user_extract/add", data.field, callback);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
218
app/admin/view/user_extract/datalist.html
Normal file
218
app/admin/view/user_extract/datalist.html
Normal file
@ -0,0 +1,218 @@
|
||||
{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="user_extract" lay-filter="user_extract"></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-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: '#user_extract',
|
||||
title: '用户提现表列表',
|
||||
toolbar: '#toolbarDemo',
|
||||
url: '/admin/user_extract/datalist',
|
||||
page: true,
|
||||
limit: 20,
|
||||
cellMinWidth: 300,
|
||||
cols: [
|
||||
[
|
||||
{
|
||||
fixed: 'left',
|
||||
field: 'extract_id',
|
||||
title: '编号',
|
||||
align: 'center',
|
||||
width: 80
|
||||
},{
|
||||
field: 'uid',
|
||||
title: '用户 id',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'extract_sn',
|
||||
title: '单号',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'real_name',
|
||||
title: '姓名',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'extract_type',
|
||||
title: '提现方式',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'bank_code',
|
||||
title: '银行卡',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'bank_address',
|
||||
title: '开户地址',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},
|
||||
// {
|
||||
// field: 'alipay_code',
|
||||
// title: '支付宝账号',
|
||||
// align: 'center',
|
||||
// width: 100
|
||||
// },{
|
||||
// field: 'wechat',
|
||||
// title: '微信号',
|
||||
// align: 'center',
|
||||
// width: 100
|
||||
// },{
|
||||
// field: 'extract_pic',
|
||||
// title: '收款码',
|
||||
// align: 'center',
|
||||
// width: 100
|
||||
// },
|
||||
{
|
||||
field: 'extract_price',
|
||||
title: '提现金额',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'balance',
|
||||
title: '余额',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'mark',
|
||||
title: '管理员备注',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'admin_id',
|
||||
title: '审核管理员',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'fail_msg',
|
||||
title: '无效原因',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'status_time',
|
||||
title: '无效时间',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'create_time',
|
||||
title: '添加时间',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},{
|
||||
field: 'status',
|
||||
title: '状态',
|
||||
align: 'center',
|
||||
width: 100,
|
||||
templet: function (d)
|
||||
{
|
||||
if (d.status == '-1') {
|
||||
html = '<span style="color:#FB3205">未通过</span>';
|
||||
}
|
||||
if (d.status =='0') {
|
||||
html = '<span style="color:#12bb37">审核中</span>';
|
||||
}
|
||||
if (d.status == '1') {
|
||||
html = '<span style="color:#1159F3">已提现</span>';
|
||||
}
|
||||
return html;
|
||||
},
|
||||
},{
|
||||
field: 'bank_name',
|
||||
title: '银行名称',
|
||||
align: 'center',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
fixed: 'right',
|
||||
field: 'right',
|
||||
title: '操作',
|
||||
toolbar: '#barDemo',
|
||||
width: 136,
|
||||
align: 'center'
|
||||
}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
//监听表头工具栏事件
|
||||
table.on('toolbar(user_extract)', function(obj){
|
||||
if (obj.event === 'add') {
|
||||
tool.side("/admin/user_extract/add");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
//监听表格行工具事件
|
||||
table.on('tool(user_extract)', function(obj) {
|
||||
var data = obj.data;
|
||||
if (obj.event === 'read') {
|
||||
tool.side('/admin/user_extract/read?extract_id='+obj.data.extract_id);
|
||||
}
|
||||
else if (obj.event === 'edit') {
|
||||
tool.side('/admin/user_extract/edit?extract_id='+obj.data.extract_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/user_extract/del", { extract_id: data.extract_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/user_extract/edit.html
Normal file
45
app/admin/view/user_extract/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">ID<font>*</font></td>
|
||||
<td><input type="text" name="extract_id" lay-verify="required" lay-reqText="请完善ID" value="{$detail.extract_id}" autocomplete="off" placeholder="请输入ID" class="layui-input"></td><td colspan='4'></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="py-3">
|
||||
<input type="hidden" name="extract_id" value="{$detail.extract_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/user_extract/edit", data.field, callback);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
<!-- /脚本 -->
|
13
app/admin/view/user_extract/read.html
Normal file
13
app/admin/view/user_extract/read.html
Normal file
@ -0,0 +1,13 @@
|
||||
{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">ID</td>
|
||||
<td>{$detail.extract_id}</td><td colspan='4'></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
{/block}
|
||||
<!-- /主体 -->
|
@ -133,6 +133,49 @@ abstract class BaseController
|
||||
return json(['code'=>404,'msg'=>'token不能为空']);
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
// return $decoded->jti[0];
|
||||
// exit;
|
||||
// //var_dump($config);exit;
|
||||
// try {
|
||||
// JWT::$leeway = 60;//当前时间减去60,把时间留点余地
|
||||
// $decoded = JWT::decode($token, new Key('ae47e94a7dcd1fdfacb499b60e361a8d', 'HS256')); //HS256方式,这里要和签发的时候对应
|
||||
|
||||
// //return (array)$decoded;
|
||||
// // $decoded_array = json_decode(json_encode($decoded),TRUE);
|
||||
// // $jwt_data = $decoded_array['data'];
|
||||
|
||||
// $user=Db::connect('shop')->name('nk_user')->where('user_id',$decoded->jti[0])->find();
|
||||
// if (!$user){
|
||||
// return json(['code'=>403,'msg'=>'签名错误']);
|
||||
// return false;
|
||||
// }
|
||||
// $user = Db::table('fa_user')->where('id',$user['n_user_id'])->find();
|
||||
// //$request->uid = $jwt_data['userid'];
|
||||
// define('$this->request->uid', $user['id']);
|
||||
// // $response = $next($request);
|
||||
// // return $response;
|
||||
// //return $next($request);
|
||||
// } catch(\Firebase\JWT\SignatureInvalidException $e) { //签名不正确
|
||||
// return json(['code'=>403,'msg'=>'签名错误']);
|
||||
// }catch(\Firebase\JWT\BeforeValidException $e) { // 签名在某个时间点之后才能用
|
||||
// return json(['code'=>401,'msg'=>'token失效']);
|
||||
// }catch(\Firebase\JWT\ExpiredException $e) { // token过期
|
||||
// return json(['code'=>401,'msg'=>'token已过期']);
|
||||
// }catch(Exception $e) { //其他错误
|
||||
// return json(['code'=>404,'msg'=>'非法请求']);
|
||||
// }catch(\UnexpectedValueException $e) { //其他错误
|
||||
// return json(['code'=>404,'msg'=>'非法请求']);
|
||||
// } catch(\DomainException $e) { //其他错误
|
||||
// return json(['code'=>404,'msg'=>'非法请求']);
|
||||
// }
|
||||
// }else{
|
||||
// define('$this->request->uid', '');
|
||||
// }
|
||||
|
||||
// 暂时去除 -----------------------------------------------------
|
||||
>>>>>>> master
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -134,7 +134,7 @@ class ArticleComment extends BaseController{
|
||||
$this->apiError('已结束议事不能投票');
|
||||
}
|
||||
if ($input['type']!=0){
|
||||
$find=Db::table('fa_article_comment')->where('vote_id', $input['vote_id'])->where('user_id', JWT_UID)->find();
|
||||
$find=Db::table('fa_article_comment')->where('vote_id', $input['vote_id'])->where('user_id', $this->request->uid)->find();
|
||||
if ($find){
|
||||
return $this->apiError('只能投票一次');
|
||||
}
|
||||
@ -142,7 +142,7 @@ class ArticleComment extends BaseController{
|
||||
if(empty($input['content'])){
|
||||
$this->apiError('请输入投票内容');
|
||||
}
|
||||
$useraddress = Db::table('fa_szxc_information_useraddress')->where('user_id', JWT_UID)->where('status', 1)->find();
|
||||
$useraddress = Db::table('fa_szxc_information_useraddress')->where('user_id', $this->request->uid)->where('status', 1)->find();
|
||||
|
||||
if ($useraddress) {
|
||||
$input['county'] = $useraddress['area_id'];
|
||||
@ -150,7 +150,7 @@ class ArticleComment extends BaseController{
|
||||
$input['village'] = $useraddress['village_id'];
|
||||
}
|
||||
|
||||
$input['user_id']=JWT_UID;
|
||||
$input['user_id']=$this->request->uid;
|
||||
$input['add_time']=date('Y-m-d H:i:s');
|
||||
$res=Db::table('fa_article_comment')->save($input);
|
||||
if ($res){
|
||||
@ -185,7 +185,7 @@ class ArticleComment extends BaseController{
|
||||
// if (!$res){
|
||||
// return $this->apiError($this->validate->getError());
|
||||
// }
|
||||
$input['user_id'] = JWT_UID;
|
||||
$input['user_id'] = $this->request->uid;
|
||||
$res=Db::table('fa_article_comment')->where('id',$id)->update($input);
|
||||
if ($res){
|
||||
return $this->apiSuccess('修改成功');
|
||||
|
@ -18,8 +18,8 @@ class Census extends BaseController
|
||||
$post = get_params();
|
||||
|
||||
// //根据个人村id进行查询
|
||||
// if (JWT_UID) {
|
||||
// $find = Db::table('fa_szxc_information_useraddress')->where('user_id', JWT_UID)->find();
|
||||
// if ($this->request->uid) {
|
||||
// $find = Db::table('fa_szxc_information_useraddress')->where('user_id', $this->request->uid)->find();
|
||||
// if ($find) {
|
||||
// if ($find['auth_range']==1){
|
||||
// $mmm[] = $where[] = ['b.village_id', '=', $find['village_id']];
|
||||
|
@ -211,7 +211,7 @@ class Ceshi extends BaseController
|
||||
$utils = $app->getUtils();
|
||||
$response = $utils->codeToSession($code);
|
||||
if ($response['openid']) {
|
||||
$where['user_id'] = JWT_UID;
|
||||
$where['user_id'] = $this->request->uid;
|
||||
$user = Db::table('fa_user_openid')->where($where)->find();
|
||||
if ($user) {
|
||||
if (!empty($user['openid']) && $user['openid'] == $response['openid']) {
|
||||
@ -224,7 +224,7 @@ class Ceshi extends BaseController
|
||||
$time = time();
|
||||
$data = [
|
||||
'openid' => $response['openid'],
|
||||
'user_id' => JWT_UID,
|
||||
'user_id' => $this->request->uid,
|
||||
'createtime' => $time,
|
||||
];
|
||||
$res = Db::table('fa_user_openid')->insert($data);
|
||||
@ -277,7 +277,7 @@ class Ceshi extends BaseController
|
||||
$utils = $app->getUtils();
|
||||
$response = $utils->codeToSession($code);
|
||||
if ($response['openid']) {
|
||||
$where['user_id'] = JWT_UID;
|
||||
$where['user_id'] = $this->request->uid;
|
||||
$user = Db::table('fa_user_openid')->where($where)->find();
|
||||
if ($user) {
|
||||
if (!empty($user['official_account_openid']) && $user['official_account_openid'] == $response['openid']) {
|
||||
@ -290,7 +290,7 @@ class Ceshi extends BaseController
|
||||
$time = time();
|
||||
$data = [
|
||||
'official_account_openid' => $response['openid'],
|
||||
'user_id' => JWT_UID,
|
||||
'user_id' => $this->request->uid,
|
||||
'createtime' => $time,
|
||||
];
|
||||
$res = Db::table('fa_user_openid')->insert($data);
|
||||
|
@ -150,7 +150,7 @@ class Common extends BaseController
|
||||
//// $urls= Env::get('APP.URL_MY')? Env::get('APP.URL_MY'):'https://ceshi.excellentkk.cn';
|
||||
// $params = [
|
||||
// 'admin_id' => 0,
|
||||
// 'user_id' => (int) JWT_UID,
|
||||
// 'user_id' => (int) $this->request->uid,
|
||||
// 'category' => $category,
|
||||
// 'filename' => mb_substr(htmlspecialchars(strip_tags($fileInfo['name'])), 0, 100),
|
||||
// 'filesize' => $fileInfo['size'],
|
||||
@ -259,7 +259,7 @@ class Common extends BaseController
|
||||
$data['action'] = app('request')->action();
|
||||
$data['uploadip'] = app('request')->ip();
|
||||
$data['create_time'] = time();
|
||||
$data['user_id'] = JWT_UID ? JWT_UID : 0;
|
||||
$data['user_id'] = $this->request->uid ? $this->request->uid : 0;
|
||||
if ($data['module'] = 'admin') {
|
||||
//通过后台上传的文件直接审核通过
|
||||
$data['status'] = 1;
|
||||
|
@ -75,8 +75,8 @@ class Cultural extends BaseController
|
||||
unset($where[1]);
|
||||
}
|
||||
//根据个人村id进行查询
|
||||
if (JWT_UID) {
|
||||
$find = Db::table('fa_szxc_information_useraddress')->where('user_id', JWT_UID)->find();
|
||||
if ($this->request->uid) {
|
||||
$find = Db::table('fa_szxc_information_useraddress')->where('user_id', $this->request->uid)->find();
|
||||
if ($find) {
|
||||
if ($find['auth_range']==1){
|
||||
$where[] = ['village', '=', $find['village_id']];
|
||||
@ -88,7 +88,7 @@ class Cultural extends BaseController
|
||||
}
|
||||
// 登录返回村名和村地址
|
||||
$cun_arr['cun_name'] = Db::table('fa_geo_village')->where('village_id', $find['village_id'])->value('village_name');
|
||||
$cun_arr['cun_address'] = Db::table('fa_szxc_information_usermsg')->where('user_id', JWT_UID)->value('address_name');
|
||||
$cun_arr['cun_address'] = Db::table('fa_szxc_information_usermsg')->where('user_id', $this->request->uid)->value('address_name');
|
||||
}else{
|
||||
$cun_arr = [];
|
||||
}
|
||||
@ -217,8 +217,8 @@ class Cultural extends BaseController
|
||||
unset($where[1]);
|
||||
}
|
||||
// 如果登录
|
||||
if (JWT_UID) {
|
||||
$find = Db::table('fa_szxc_information_useraddress')->where('user_id', JWT_UID)->find();
|
||||
if ($this->request->uid) {
|
||||
$find = Db::table('fa_szxc_information_useraddress')->where('user_id', $this->request->uid)->find();
|
||||
if ($find) {
|
||||
if ($find['auth_range']==1){
|
||||
$where[] = ['village', '=', $find['village_id']];
|
||||
@ -346,8 +346,8 @@ class Cultural extends BaseController
|
||||
['status', '=', 1],
|
||||
];
|
||||
//根据个人村id进行查询
|
||||
if (JWT_UID) {
|
||||
$find = Db::table('fa_szxc_information_useraddress')->where('user_id', JWT_UID)->find();
|
||||
if ($this->request->uid) {
|
||||
$find = Db::table('fa_szxc_information_useraddress')->where('user_id', $this->request->uid)->find();
|
||||
if ($find) {
|
||||
if ($find['auth_range']==1){
|
||||
$where[] = ['village', '=', $find['village_id']];
|
||||
|
@ -173,7 +173,7 @@ class Index extends BaseController
|
||||
*/
|
||||
public function demo()
|
||||
{
|
||||
$uid = JWT_UID;
|
||||
$uid = $this->request->uid;
|
||||
$userInfo = Db::table('fa_user')->where(['id' => $uid])->find();
|
||||
$this->apiSuccess('请求成功', ['user' => $userInfo]);
|
||||
}
|
||||
@ -186,7 +186,7 @@ class Index extends BaseController
|
||||
$id = $param['id']; //文章id
|
||||
$content = $param['content']; //投诉内容
|
||||
$type = $param['type']??1; //标识(1文章/2朋友圈)
|
||||
$user_id = JWT_UID;//用户的id
|
||||
$user_id = $this->request->uid;//用户的id
|
||||
$where['article_id'] = $id;
|
||||
$where['user_id'] = $user_id;
|
||||
$where['type'] = $type;
|
||||
@ -195,7 +195,7 @@ class Index extends BaseController
|
||||
$this->apiError('您已投诉!');
|
||||
}else{
|
||||
|
||||
$useraddress = Db::table('fa_szxc_information_useraddress')->where('user_id', JWT_UID)->where('status', 1)->find();
|
||||
$useraddress = Db::table('fa_szxc_information_useraddress')->where('user_id', $this->request->uid)->where('status', 1)->find();
|
||||
$data = [];
|
||||
if ($useraddress) {
|
||||
$data['county'] = $useraddress['area_id'];
|
||||
|
@ -62,14 +62,14 @@ class Maintainentry extends BaseController
|
||||
public function pickUpInfo()
|
||||
{
|
||||
//村id
|
||||
$village_id = Db::table('fa_szxc_information_useraddress')->where('user_id',JWT_UID)->value('village_id');
|
||||
$village_id = Db::table('fa_szxc_information_useraddress')->where('user_id',$this->request->uid)->value('village_id');
|
||||
//获取当前村总人数
|
||||
$map['village_id'] = $village_id;
|
||||
$total = Db::table('fa_szxc_information_useraddress')->where($map)->count();
|
||||
//获取已录入人数
|
||||
$www[] = ['village_id','=',$village_id];
|
||||
$www[] = ['status','=','1'];
|
||||
// $www[] = ['enter_id','=',JWT_UID];
|
||||
// $www[] = ['enter_id','=',$this->request->uid];
|
||||
$have = Db::table('fa_szxc_information_usermsg')->where($www)->count();
|
||||
$man_num = Db::table('fa_szxc_information_usermsg')->where($www)->where('gender',1)->count();
|
||||
$woman_num = Db::table('fa_szxc_information_usermsg')->where($www)->where('gender',2)->count();
|
||||
@ -1225,7 +1225,7 @@ class Maintainentry extends BaseController
|
||||
if ($post) {
|
||||
Db::startTrans();
|
||||
// 获取录入人地址
|
||||
$add = Db::table('fa_szxc_information_useraddress')->where('user_id',JWT_UID)->find();
|
||||
$add = Db::table('fa_szxc_information_useraddress')->where('user_id',$this->request->uid)->find();
|
||||
if(empty($add)){
|
||||
$this->apiError('录入出错,请联系系统管理员');
|
||||
}
|
||||
@ -1304,7 +1304,7 @@ class Maintainentry extends BaseController
|
||||
//写入用户信息表
|
||||
$post['user_id'] = $userid;
|
||||
$post['createtime'] = $time;
|
||||
$post['enter_id'] = JWT_UID;
|
||||
$post['enter_id'] = $this->request->uid;
|
||||
$post['gender']= $post['gender_id'];
|
||||
$post['nation']=$post['nation_id'];
|
||||
$post['political_outlook']=$post['zzmm_id'];
|
||||
@ -1525,7 +1525,7 @@ class Maintainentry extends BaseController
|
||||
|
||||
Db::startTrans();
|
||||
// 获取录入人地址
|
||||
$add = Db::table('fa_szxc_information_useraddress')->where('user_id',JWT_UID)->find();
|
||||
$add = Db::table('fa_szxc_information_useraddress')->where('user_id',$this->request->uid)->find();
|
||||
if(empty($add)){
|
||||
$this->apiError('录入出错,请联系系统管理员');
|
||||
}
|
||||
@ -1604,7 +1604,7 @@ class Maintainentry extends BaseController
|
||||
//写入用户信息表
|
||||
$post['user_id'] = $userid;
|
||||
$post['createtime'] = $time;
|
||||
$post['enter_id'] = JWT_UID;
|
||||
$post['enter_id'] = $this->request->uid;
|
||||
$post['gender']= $post['gender_id'];
|
||||
$post['nation']=$post['nation_id'];
|
||||
$post['political_outlook']=$post['zzmm_id'];
|
||||
@ -1626,7 +1626,7 @@ class Maintainentry extends BaseController
|
||||
Db::table('fa_szxc_information_useraddress')->strict(false)->insert($address_data);
|
||||
|
||||
// 写入家庭成员表
|
||||
$my_user_id = JWT_UID;
|
||||
$my_user_id = $this->request->uid;
|
||||
$f_where[] = ['user_ids','find in set',$my_user_id];
|
||||
$family_arr = Db::table('fa_szxc_family')->where($f_where)->find();
|
||||
if($family_arr){
|
||||
@ -1658,7 +1658,7 @@ class Maintainentry extends BaseController
|
||||
// 获取我的家庭成员
|
||||
public function getmyFamily(){
|
||||
//用户id
|
||||
$user_id = JWT_UID;
|
||||
$user_id = $this->request->uid;
|
||||
|
||||
// 获取户主id
|
||||
$f_where[] = ['user_ids','find in set',$user_id];
|
||||
|
@ -25,7 +25,7 @@ class MyArticle extends BaseController
|
||||
$where = [
|
||||
['status', '=', 1],
|
||||
['category_id', '=', $category_id],
|
||||
['user_id', '=', JWT_UID]
|
||||
['user_id', '=', $this->request->uid]
|
||||
];
|
||||
if (!$category_id) {
|
||||
unset($where[1]);
|
||||
@ -80,9 +80,9 @@ class MyArticle extends BaseController
|
||||
$select[$key]['is_read'] = Db::table('fa_article_comment')->where('vote_id',$value['id'])->value('is_read');
|
||||
}
|
||||
|
||||
$name['address_name'] = Db::table('fa_szxc_information_usermsg')->where('user_id', JWT_UID)->value('address_name');
|
||||
$name['vartar'] = Db::table('fa_user')->where('id', JWT_UID)->value('avatar');
|
||||
$name['name'] = Db::table('fa_szxc_information_usermsg')->where('user_id', JWT_UID)->value('name');
|
||||
$name['address_name'] = Db::table('fa_szxc_information_usermsg')->where('user_id', $this->request->uid)->value('address_name');
|
||||
$name['vartar'] = Db::table('fa_user')->where('id', $this->request->uid)->value('avatar');
|
||||
$name['name'] = Db::table('fa_szxc_information_usermsg')->where('user_id', $this->request->uid)->value('name');
|
||||
|
||||
return $this->apiSuccess('ok', ['list' => $select, 'count' => ['count' => $count, 'month_count' => $month_count],'actor'=>$name]);
|
||||
}
|
||||
@ -99,7 +99,7 @@ class MyArticle extends BaseController
|
||||
$where = [
|
||||
['status', '=', 1],
|
||||
['id', '=', $id],
|
||||
['user_id', '=', JWT_UID]
|
||||
['user_id', '=', $this->request->uid]
|
||||
|
||||
];
|
||||
$find = Db::table('fa_article')->where($where)->withAttr('user_info', function ($data, $value) {
|
||||
|
@ -25,7 +25,7 @@ class Notice extends BaseController
|
||||
*/
|
||||
public function list($page=1,$limit=10){
|
||||
$where['status'] = 1;
|
||||
$where['user_id'] = JWT_UID;
|
||||
$where['user_id'] = $this->request->uid;
|
||||
$res = Db::table('cms_notice')
|
||||
->where($where)
|
||||
->field('id,user_id,title,content,create_time,is_read,read_time')
|
||||
@ -40,7 +40,7 @@ class Notice extends BaseController
|
||||
public function count(){
|
||||
$where['status'] = 1;
|
||||
$where['is_read'] = 0;
|
||||
$where['user_id'] = JWT_UID;
|
||||
$where['user_id'] = $this->request->uid;
|
||||
$res = Db::table('cms_notice')
|
||||
->where($where)
|
||||
->count();
|
||||
@ -56,7 +56,7 @@ class Notice extends BaseController
|
||||
$this->apiError('缺少参数');
|
||||
}
|
||||
$where['id'] = $id;
|
||||
$where['user_id'] = JWT_UID;
|
||||
$where['user_id'] = $this->request->uid;
|
||||
$res = Db::table('cms_notice')
|
||||
->where($where)
|
||||
->find();
|
||||
|
@ -40,11 +40,11 @@ class Personal extends BaseController
|
||||
*/
|
||||
public function getCommentList()
|
||||
{
|
||||
$user_id = JWT_UID;
|
||||
$user_id = $this->request->uid;
|
||||
|
||||
//根据个人村id进行查询
|
||||
if (JWT_UID) {
|
||||
$find = Db::table('fa_szxc_information_useraddress')->where('user_id', JWT_UID)->find();
|
||||
if ($this->request->uid) {
|
||||
$find = Db::table('fa_szxc_information_useraddress')->where('user_id', $this->request->uid)->find();
|
||||
if ($find) {
|
||||
if ($find['auth_range'] == 1) {
|
||||
$where[] = $map[] = $map2[] = $whe2[] = ['village', '=', $find['village_id']];
|
||||
@ -135,11 +135,11 @@ class Personal extends BaseController
|
||||
*/
|
||||
public function oneCAlickAudit()
|
||||
{
|
||||
$user_id = JWT_UID;
|
||||
$user_id = $this->request->uid;
|
||||
|
||||
//根据个人村id进行查询
|
||||
if (JWT_UID) {
|
||||
$find = Db::table('fa_szxc_information_useraddress')->where('user_id', JWT_UID)->find();
|
||||
if ($this->request->uid) {
|
||||
$find = Db::table('fa_szxc_information_useraddress')->where('user_id', $this->request->uid)->find();
|
||||
if ($find) {
|
||||
if ($find['auth_range'] == 1) {
|
||||
$where[] = ['village', '=', $find['village_id']];
|
||||
@ -235,7 +235,7 @@ class Personal extends BaseController
|
||||
{
|
||||
$post = $this->request->post();
|
||||
$time = time();
|
||||
$useraddress = Db::table('fa_szxc_information_useraddress')->where('user_id', JWT_UID)->where('status', 1)->find();
|
||||
$useraddress = Db::table('fa_szxc_information_useraddress')->where('user_id', $this->request->uid)->where('status', 1)->find();
|
||||
$data = [];
|
||||
|
||||
if ($useraddress) {
|
||||
@ -271,7 +271,7 @@ class Personal extends BaseController
|
||||
}
|
||||
} else {//添加
|
||||
$post['createtime'] = $time;
|
||||
$post['user_id'] = JWT_UID;
|
||||
$post['user_id'] = $this->request->uid;
|
||||
$res = Db::table('fa_szxc_personal_news')->strict(false)->insert($post);
|
||||
if ($res) {
|
||||
$this->apiSuccess('发布成功', $res, 1);
|
||||
@ -314,7 +314,7 @@ class Personal extends BaseController
|
||||
$this->apiError('请输入评论内容');
|
||||
}
|
||||
|
||||
$useraddress = Db::table('fa_szxc_information_useraddress')->where('user_id', JWT_UID)->where('status', 1)->find();
|
||||
$useraddress = Db::table('fa_szxc_information_useraddress')->where('user_id', $this->request->uid)->where('status', 1)->find();
|
||||
$data = [];
|
||||
if ($useraddress) {
|
||||
$post['county'] = $useraddress['area_id'];
|
||||
@ -324,7 +324,7 @@ class Personal extends BaseController
|
||||
|
||||
$time = time();
|
||||
$post['createtime'] = $time;
|
||||
$post['user_id'] = JWT_UID;
|
||||
$post['user_id'] = $this->request->uid;
|
||||
$res = Db::table('fa_szxc_personal_news_comment')->strict(false)->insert($post);
|
||||
if ($res) {
|
||||
$this->apiSuccess('操作成功', $res, 1);
|
||||
@ -401,7 +401,7 @@ class Personal extends BaseController
|
||||
if(empty($category_id)){
|
||||
$this->apiError('缺少参数');
|
||||
}
|
||||
$address = Db::table('fa_szxc_information_useraddress')->where('user_id',JWT_UID)->find();
|
||||
$address = Db::table('fa_szxc_information_useraddress')->where('user_id',$this->request->uid)->find();
|
||||
if($address){
|
||||
$where[] = ['county', '=', $address['area_id']];
|
||||
$where[] = ['township', '=', $address['street_id']];
|
||||
@ -447,7 +447,7 @@ class Personal extends BaseController
|
||||
|
||||
//获取当前区域朋友圈列表
|
||||
public function getlists($page = 1){
|
||||
$address = Db::table('fa_szxc_information_useraddress')->where('user_id',JWT_UID)->find();
|
||||
$address = Db::table('fa_szxc_information_useraddress')->where('user_id',$this->request->uid)->find();
|
||||
if($address){
|
||||
$where[] = ['county', '=', $address['area_id']];
|
||||
$where[] = ['township', '=', $address['street_id']];
|
||||
@ -482,7 +482,7 @@ class Personal extends BaseController
|
||||
|
||||
//获取所有朋友圈列表
|
||||
public function getalllist($page = 1){
|
||||
// $address = Db::table('fa_szxc_information_useraddress')->where('user_id',JWT_UID)->find();
|
||||
// $address = Db::table('fa_szxc_information_useraddress')->where('user_id',$this->request->uid)->find();
|
||||
// if($address){
|
||||
// $where[] = ['county', '=', $address['area_id']];
|
||||
// $where[] = ['township', '=', $address['street_id']];
|
||||
|
@ -247,7 +247,7 @@ class User extends BaseController
|
||||
*/
|
||||
public function profile()
|
||||
{
|
||||
$user = Db::table('fa_user')->where(['id' => JWT_UID])->find();
|
||||
$user = Db::table('fa_user')->where(['id' => $this->request->uid])->find();
|
||||
// $username = $this->request->request('username');
|
||||
$params = get_params();
|
||||
$nickname = $params['nickname'];
|
||||
@ -269,9 +269,9 @@ class User extends BaseController
|
||||
// $user->bio = $bio;
|
||||
// $user->save();
|
||||
if($data){
|
||||
Db::table('fa_user')->where(['id' => JWT_UID])->update($data);
|
||||
Db::table('fa_user')->where(['id' => $this->request->uid])->update($data);
|
||||
}
|
||||
$user = Db::table('fa_user')->where(['id' => JWT_UID])->find();
|
||||
$user = Db::table('fa_user')->where(['id' => $this->request->uid])->find();
|
||||
$new_user['nickname'] = $user['nickname'];
|
||||
$new_user['avatar'] = $user['avatar'];
|
||||
$this->apiSuccess('修改成功',$new_user);
|
||||
@ -433,11 +433,11 @@ class User extends BaseController
|
||||
// 用户实名认证
|
||||
public function realname(){
|
||||
$params = get_params();
|
||||
$uid = JWT_UID;
|
||||
$uid = $this->request->uid;
|
||||
$params['user_id'] = $uid;
|
||||
$is_have = Db::table('cms_szxc_user_authentication')->where('user_id',$uid)->find();
|
||||
|
||||
$adds=Db::table('fa_szxc_information_useraddress')->where('user_id',JWT_UID)->find();
|
||||
$adds=Db::table('fa_szxc_information_useraddress')->where('user_id',$this->request->uid)->find();
|
||||
$params['area_id']=$adds['area_id'];
|
||||
$params['street_id']=$adds['street_id'];
|
||||
$params['village_id']=$adds['village_id'];
|
||||
|
@ -54,7 +54,7 @@ class Village extends BaseController
|
||||
})
|
||||
->withAttr('is_dz', function ($value, $data) {
|
||||
// 判断redis
|
||||
$user_id = JWT_UID;
|
||||
$user_id = $this->request->uid;
|
||||
if($user_id){
|
||||
$name = $user_id . $data['id'];
|
||||
$is_zan = Cache::store('redis')->get($name);
|
||||
@ -99,7 +99,7 @@ class Village extends BaseController
|
||||
})
|
||||
->withAttr('is_dz', function ($value, $data) {
|
||||
// 判断redis
|
||||
$user_id = JWT_UID;
|
||||
$user_id = $this->request->uid;
|
||||
if($user_id){
|
||||
$name = $user_id . $data['id'];
|
||||
$is_zan = Cache::store('redis')->get($name);
|
||||
@ -130,7 +130,7 @@ class Village extends BaseController
|
||||
$news = Db::table('fa_szxc_village')->where($where)->field('id,title,address,people_num,images,views,likes,createtime,introduce,info,area_id,street_id,village_id')->find();
|
||||
if ($news) {
|
||||
// 判断redis
|
||||
$user_id = JWT_UID;
|
||||
$user_id = $this->request->uid;
|
||||
if($user_id){
|
||||
$name = $user_id . $news['id'];
|
||||
$is_zan = Cache::store('redis')->get($name);
|
||||
@ -268,7 +268,7 @@ class Village extends BaseController
|
||||
})
|
||||
->withAttr('is_dz', function ($value, $data) {
|
||||
// 判断redis
|
||||
$user_id = JWT_UID;
|
||||
$user_id = $this->request->uid;
|
||||
if($user_id){
|
||||
$name = $user_id . $data['id'];
|
||||
$is_zan = Cache::store('redis')->get($name);
|
||||
@ -291,7 +291,7 @@ class Village extends BaseController
|
||||
|
||||
// 我的村庄
|
||||
public function get_my_village(){
|
||||
$user_id = JWT_UID;
|
||||
$user_id = $this->request->uid;
|
||||
if (empty($user_id)) {
|
||||
$this->apiError('请先登录');
|
||||
}
|
||||
@ -319,7 +319,7 @@ class Village extends BaseController
|
||||
$news = Db::table('fa_szxc_village')->where($www)->field('id,title,address,people_num,images,views,likes,createtime,introduce,info,area_id,street_id,village_id')->find();
|
||||
if ($news) {
|
||||
// 判断redis
|
||||
$user_id = JWT_UID;
|
||||
$user_id = $this->request->uid;
|
||||
if($user_id){
|
||||
$name = $user_id . $news['id'];
|
||||
$is_zan = Cache::store('redis')->get($name);
|
||||
@ -392,8 +392,8 @@ class Village extends BaseController
|
||||
$this->apiSuccess('获取成功', $news);
|
||||
} else {
|
||||
// 判断redis
|
||||
if(JWT_UID){
|
||||
$name = JWT_UID . $address['village_id'];
|
||||
if($this->request->uid){
|
||||
$name = $this->request->uid . $address['village_id'];
|
||||
$is_zan = Cache::store('redis')->get($name);
|
||||
if($is_zan){
|
||||
$news['is_dz'] = 1;
|
||||
@ -468,7 +468,7 @@ class Village extends BaseController
|
||||
|
||||
// 点赞村庄
|
||||
public function thumbs_up($id=0){
|
||||
$user_id = JWT_UID;
|
||||
$user_id = $this->request->uid;
|
||||
if (empty($user_id)) {
|
||||
$this->apiError('请先登录');
|
||||
}
|
||||
@ -491,7 +491,7 @@ class Village extends BaseController
|
||||
|
||||
// 我的镇
|
||||
public function get_my_town(){
|
||||
$user_id = JWT_UID;
|
||||
$user_id = $this->request->uid;
|
||||
if (empty($user_id)) {
|
||||
$this->apiError('请先登录');
|
||||
}
|
||||
@ -717,7 +717,7 @@ class Village extends BaseController
|
||||
})
|
||||
->withAttr('is_dz', function ($value, $data) {
|
||||
// 判断redis
|
||||
$user_id = JWT_UID;
|
||||
$user_id = $this->request->uid;
|
||||
if($user_id){
|
||||
$name = $user_id . $data['id'];
|
||||
$is_zan = Cache::store('redis')->get($name);
|
||||
|
@ -33,8 +33,8 @@ class Article extends BaseController
|
||||
['category_id','=', $category_id]
|
||||
];
|
||||
//根据个人村id进行查询
|
||||
if (JWT_UID) {
|
||||
$find = Db::table('fa_szxc_information_useraddress')->where('user_id', JWT_UID)->find();
|
||||
if ($this->request->uid) {
|
||||
$find = Db::table('fa_szxc_information_useraddress')->where('user_id', $this->request->uid)->find();
|
||||
if ($find) {
|
||||
if ($find['auth_range']==1){
|
||||
$where[] = ['village', '=', $find['village_id']];
|
||||
@ -79,7 +79,7 @@ class Article extends BaseController
|
||||
// if (!$res){
|
||||
// return $this->apiError($valdate->getError());
|
||||
// }
|
||||
$useraddress = Db::table('fa_szxc_information_useraddress')->where('user_id', JWT_UID)->where('status', 1)->find();
|
||||
$useraddress = Db::table('fa_szxc_information_useraddress')->where('user_id', $this->request->uid)->where('status', 1)->find();
|
||||
if ($useraddress) {
|
||||
$input['county'] = $useraddress['area_id'];
|
||||
$input['township'] = $useraddress['street_id'];
|
||||
@ -87,7 +87,7 @@ class Article extends BaseController
|
||||
}
|
||||
$input['add_time'] = date('Y-m-d H:i:s');
|
||||
$input['view_time'] = date('Y-m-d H:i:s');
|
||||
$input['user_id'] = JWT_UID;
|
||||
$input['user_id'] = $this->request->uid;
|
||||
$res=Db::table('fa_szxc_party_article')->save($input);
|
||||
if ($res){
|
||||
return $this->apiSuccess('添加成功');
|
||||
@ -107,7 +107,7 @@ class Article extends BaseController
|
||||
// if (!$res){
|
||||
// return $this->apiError($valdate->getError());
|
||||
// }
|
||||
$input['user_id'] = JWT_UID;
|
||||
$input['user_id'] = $this->request->uid;
|
||||
$res=Db::table('fa_szxc_party_article')->where('id',$id)->update($input);
|
||||
if ($res){
|
||||
return $this->apiSuccess('修改成功');
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user