update niucloud

This commit is contained in:
全栈小学生 2024-08-06 17:46:36 +08:00
parent 07292e4188
commit c1e13b7b46
197 changed files with 5194 additions and 2640 deletions

View File

@ -57,7 +57,7 @@ class Request extends \think\Request
$filter_rule = [ $filter_rule = [
"/<(\\/?)(script|i?frame|style|html|body|title|link|metaf|alert|font|object|\\?|\\%)([^>]*?)>/isU", "/<(\\/?)(script|i?frame|style|html|body|title|link|metaf|alert|font|object|\\?|\\%)([^>]*?)>/isU",
"/(<[^>]*)on[a-zA-Z]+\s*=([^>]*>)/isU", "/(<[^>]*)on[a-zA-Z]+\s*=([^>]*>)/isU",
"/select|join|where|drop|like|modify|rename|insert|update|table|database|alter|truncate|\'|\/\*|\.\.\/|\.\/|union|into|load_file|outfile/is" "/\\b(select|join|where|drop|like|modify|rename|insert|update|table|database|alter|truncate|\'|\/\*|\.\.\/|\.\/|union|into|load_file|outfile)\\b/is"
]; ];
return preg_replace($filter_rule, '', $param); return preg_replace($filter_rule, '', $param);
} }

View File

@ -13,7 +13,6 @@ namespace app\adminapi\controller\addon;
use app\dict\addon\AddonDict; use app\dict\addon\AddonDict;
use app\service\admin\addon\AddonDevelopService; use app\service\admin\addon\AddonDevelopService;
use app\service\admin\niucloud\AppService;
use core\base\BaseAdminController; use core\base\BaseAdminController;
use think\Response; use think\Response;

View File

@ -32,20 +32,6 @@ class Auth extends BaseAdminController
return success(( new AuthService() )->getAuthMenuList($data[ 'status' ], $data[ 'is_tree' ], $data[ 'is_button' ])); return success(( new AuthService() )->getAuthMenuList($data[ 'status' ], $data[ 'is_tree' ], $data[ 'is_button' ]));
} }
/**
* 获取授权应用
* @return void
*/
public function getAuthAddonList(){
$data = $this->request->params([
['type', ''],
['title', ''],
['support_app','']
]);
return success((new AuthService())->getAuthAddonList($data));
}
/** /**
* 获取登录用户信息 * 获取登录用户信息
* @return Response * @return Response
@ -85,15 +71,4 @@ class Auth extends BaseAdminController
( new AuthService() )->editAuth($data); ( new AuthService() )->editAuth($data);
return success('MODIFY_SUCCESS'); return success('MODIFY_SUCCESS');
} }
/**
* 授权应用加星
*/
public function setStar(){
$data = $this->request->params([
['key', ''],
]);
(new AuthService())->setAddonStat($data['key']);
return success('SUCCESS');
}
} }

View File

@ -13,7 +13,6 @@ namespace app\adminapi\controller\login;
use app\service\admin\auth\ConfigService; use app\service\admin\auth\ConfigService;
use app\service\admin\auth\LoginService; use app\service\admin\auth\LoginService;
use app\service\core\menu\CoreMenuService;
use core\base\BaseAdminController; use core\base\BaseAdminController;
use think\Response; use think\Response;
@ -60,8 +59,4 @@ class Login extends BaseAdminController
{ {
return success(( new ConfigService() )->getConfig()); return success(( new ConfigService() )->getConfig());
} }
public function test() {
}
} }

View File

@ -15,7 +15,6 @@ use app\dict\member\MemberDict;
use app\dict\member\MemberRegisterChannelDict; use app\dict\member\MemberRegisterChannelDict;
use app\dict\member\MemberRegisterTypeDict; use app\dict\member\MemberRegisterTypeDict;
use app\service\admin\member\MemberService; use app\service\admin\member\MemberService;
use app\service\core\sys\CoreExportService;
use core\base\BaseAdminController; use core\base\BaseAdminController;
use think\db\exception\DataNotFoundException; use think\db\exception\DataNotFoundException;
use think\db\exception\DbException; use think\db\exception\DbException;

View File

@ -94,21 +94,6 @@ class Notice extends BaseAdminController
return success(); return success();
} }
/**
* 消息列表
* @return Response
*/
public function getLogList()
{
$data = $this->request->params([
['key', ''],
['receiver', ''],
]);
$res = (new NoticeService())->getLogPage($data);
return success($res);
}
/** /**
* 消息修改 * 消息修改
* @return Response * @return Response

View File

@ -134,46 +134,6 @@ class Config extends BaseAdminController
return success((new ConfigService())->getMap()); return success((new ConfigService())->getMap());
} }
/**
* 获取站点首页列表如果正在使用is_use = 1
*/
public function getSiteIndexList()
{
return success((new ConfigService())->getSiteIndexList());
}
/**
* 首页配置
*/
public function setSiteIndex()
{
$data = $this->request->params([
['view_path', ''],
]);
(new ConfigService())->setSiteIndexConfig($data);
return success();
}
/**
* 获取站点首页列表如果正在使用is_use = 1
*/
public function getAdminIndexList()
{
return success((new ConfigService())->getAdminIndexList());
}
/**
* 首页配置
*/
public function setAdminIndex()
{
$data = $this->request->params([
['view_path', ''],
]);
(new ConfigService())->setAdminIndexConfig($data);
return success();
}
/** /**
* 获取手机端首页列表 * 获取手机端首页列表
*/ */
@ -186,26 +146,6 @@ class Config extends BaseAdminController
return success(( new ConfigService() )->getWapIndexList($data)); return success(( new ConfigService() )->getWapIndexList($data));
} }
/**
* 设置快捷菜单
*/
public function setShortcutMenu()
{
$data = $this->request->params([
['menu', []],
]);
(new ConfigService())->setShortcutMenu($data['menu']);
return success();
}
/**
* 获取站点快捷菜单
*/
public function getShortcutMenu()
{
return success(data: (new ConfigService())->getShortcutMenu());
}
/** /**
* 获取开发者key * 获取开发者key
* @return Response * @return Response

View File

@ -190,7 +190,7 @@ class Poster extends BaseAdminController
] ], // 数据参数 ] ], // 数据参数
[ 'channel', 'h5' ] [ 'channel', 'h5' ]
]); ]);
return success(data: poster($this->request->siteId(), ...$data)); return success(data: poster(...$data));
} }
} }

View File

@ -0,0 +1,279 @@
<?php
// +----------------------------------------------------------------------
// | Niucloud-admin 企业快速开发的多应用管理平台
// +----------------------------------------------------------------------
// | 官方网址https://www.niucloud.com
// +----------------------------------------------------------------------
// | niucloud团队 版权所有 开源版本可自由商用
// +----------------------------------------------------------------------
// | Author: Niucloud Team
// +----------------------------------------------------------------------
namespace app\adminapi\controller\sys;
use app\service\admin\sys\PrinterService;
use app\service\admin\sys\PrinterTemplateService;
use core\base\BaseAdminController;
/**
* 小票打印机控制器
* Class Printer
* @package app\adminapi\controller\sys
*/
class Printer extends BaseAdminController
{
/**
* 获取小票打印机分页列表
* @return \think\Response
*/
public function pages()
{
$data = $this->request->params([
[ "printer_name", "" ],
]);
return success(( new PrinterService() )->getPage($data));
}
/**
* 获取小票打印机列表
* @return \think\Response
*/
public function lists()
{
$data = $this->request->params([
[ "printer_name", "" ],
]);
return success(( new PrinterService() )->getList($data));
}
/**
* 小票打印机详情
* @param int $id
* @return \think\Response
*/
public function info(int $id)
{
return success(( new PrinterService() )->getInfo($id));
}
/**
* 添加小票打印机
* @return \think\Response
*/
public function add()
{
$data = $this->request->params([
[ "brand", "" ],
[ "printer_name", "" ],
[ "printer_code", "" ],
[ "printer_key", "" ],
[ "open_id", "" ],
[ "apikey", "" ],
[ 'template_type', '' ],
[ 'trigger', '' ],
[ "value", "" ],
[ "print_width", "" ],
[ "status", 0 ],
]);
$this->validate($data, 'app\validate\sys\Printer.add');
$id = ( new PrinterService() )->add($data);
return success('ADD_SUCCESS', [ 'id' => $id ]);
}
/**
* 小票打印机编辑
* @param $id 小票打印机id
* @return \think\Response
*/
public function edit(int $id)
{
$data = $this->request->params([
[ "brand", "" ],
[ "printer_name", "" ],
[ "printer_code", "" ],
[ "printer_key", "" ],
[ "open_id", "" ],
[ "apikey", "" ],
[ 'template_type', '' ],
[ 'trigger', '' ],
[ "value", "" ],
[ "print_width", "" ],
[ "status", 0 ],
]);
$this->validate($data, 'app\validate\sys\Printer.edit');
( new PrinterService() )->edit($id, $data);
return success('EDIT_SUCCESS');
}
/**
* 修改小票打印机状态
* @return \think\Response
*/
public function modifyStatus()
{
$data = $this->request->params([
[ "printer_id", 0 ],
[ "status", 0 ],
]);
( new PrinterService() )->modifyStatus($data);
return success('SUCCESS');
}
/**
* 小票打印机删除
* @param $id 小票打印机id
* @return \think\Response
*/
public function del(int $id)
{
( new PrinterService() )->del($id);
return success('DELETE_SUCCESS');
}
/**
* 获取小票打印模板分页列表
* @return \think\Response
*/
public function templatePageLists()
{
$data = $this->request->params([
[ "template_type", "" ],
[ "template_name", "" ],
]);
return success(( new PrinterTemplateService() )->getPage($data));
}
/**
* 获取小票打印模板列表
* @return \think\Response
* @throws \think\db\exception\DbException
*/
public function templateLists()
{
$data = $this->request->params([
[ "template_type", "" ],
[ "template_name", "" ],
]);
return success(( new PrinterTemplateService() )->getList($data));
}
/**
* 小票打印模板详情
* @param int $id
* @return \think\Response
*/
public function templateInfo(int $id)
{
return success(( new PrinterTemplateService() )->getInfo($id));
}
/**
* 添加小票打印模板
* @return \think\Response
*/
public function templateAdd()
{
$data = $this->request->params([
[ "template_type", "" ],
[ "template_name", "" ],
[ "value", "" ],
]);
$this->validate($data, 'app\validate\sys\PrinterTemplate.add');
$id = ( new PrinterTemplateService() )->add($data);
return success('ADD_SUCCESS', [ 'id' => $id ]);
}
/**
* 小票打印模板编辑
* @param $id 小票打印模板id
* @return \think\Response
*/
public function templateEdit(int $id)
{
$data = $this->request->params([
[ "template_type", "" ],
[ "template_name", "" ],
[ "value", "" ],
]);
$this->validate($data, 'app\validate\sys\PrinterTemplate.edit');
( new PrinterTemplateService() )->edit($id, $data);
return success('EDIT_SUCCESS');
}
/**
* 小票打印模板删除
* @param $id 小票打印模板id
* @return \think\Response
*/
public function templateDel(int $id)
{
( new PrinterTemplateService() )->del($id);
return success('DELETE_SUCCESS');
}
/**
* 获取小票打印模板类型
* @return array|\think\Response
*/
public function getType()
{
return success(( new PrinterService() )->getType());
}
/**
* 获取小票打印机设备品牌
* @return array|\think\Response
*/
public function getBrand()
{
$data = $this->request->params([
[ "brand", "" ],
]);
return success(( new PrinterService() )->getBrand($data[ 'brand' ]));
}
/**
* 测试打印
* @param int $id
* @return \think\Response
*/
public function testPrint(int $id)
{
( new PrinterService() )->testPrint($id);
return success('SUCCESS');
}
/**
* 刷新打印机token
* @param int $id
* @return \think\Response
*/
public function refreshToken(int $id)
{
( new PrinterService() )->refreshToken($id);
return success('SUCCESS');
}
/**
* 打印小票内容
* @return \think\Response
*/
public function printTicket()
{
$data = $this->request->params([
[ "type", "" ], // 小票模板类型
[ "trigger", "" ], // 触发时机
[ 'business', [] ] // 业务参数,根据自身业务传值
]);
$res = ( new PrinterService() )->printTicket($data);
if ($res[ 'code' ] == 0) {
return success('SUCCESS');
} else {
return fail($res[ 'message' ]);
}
}
}

View File

@ -50,6 +50,17 @@ class User extends BaseAdminController
return success((new UserService())->getInfo($uid)); return success((new UserService())->getInfo($uid));
} }
public function getUserAll()
{
$data = $this->request->params([
['username', ''],
['realname', ''],
['create_time', []],
]);
$list = (new UserService())->getUserAll($data);
return success($list);
}
/** /**
* 新增用户 * 新增用户
* @return Response * @return Response

View File

@ -13,7 +13,6 @@ namespace app\adminapi\controller\weapp;
use app\service\admin\weapp\WeappDeliveryService; use app\service\admin\weapp\WeappDeliveryService;
use core\base\BaseAdminController; use core\base\BaseAdminController;
use think\Response;
/** /**
* 小程序发货信息管理服务 * 小程序发货信息管理服务

View File

@ -13,7 +13,6 @@ namespace app\adminapi\controller\weapp;
use app\service\admin\weapp\WeappVersionService; use app\service\admin\weapp\WeappVersionService;
use core\base\BaseAdminController; use core\base\BaseAdminController;
use Exception;
use think\Response; use think\Response;
/** /**

View File

@ -24,8 +24,6 @@ Route::group('auth', function () {
/***************************************************** 授权信息 ****************************************************/ /***************************************************** 授权信息 ****************************************************/
//授权用户站点菜单 //授权用户站点菜单
Route::get('authmenu', 'auth.Auth/authMenuList'); Route::get('authmenu', 'auth.Auth/authMenuList');
//授权用户站点应用
Route::get('authaddon', 'auth.Auth/getAuthAddonList');
//授权用户信息 //授权用户信息
Route::get('get', 'auth.Auth/get'); Route::get('get', 'auth.Auth/get');
//授权用户信息 //授权用户信息

View File

@ -16,7 +16,6 @@ use app\adminapi\middleware\AdminCheckToken;
use app\adminapi\middleware\AdminLog; use app\adminapi\middleware\AdminLog;
// USER_CODE_BEGIN -- sys_dict
Route::group('dict', function () { Route::group('dict', function () {
//数据字典列表 //数据字典列表
@ -40,4 +39,3 @@ Route::group('dict', function () {
AdminCheckRole::class, AdminCheckRole::class,
AdminLog::class AdminLog::class
]); ]);
// USER_CODE_END -- sys_dict

View File

@ -54,7 +54,7 @@ Route::group('diy', function() {
Route::get('link', 'diy.Diy/getLink'); Route::get('link', 'diy.Diy/getLink');
// 设为使用 // 设为使用
Route::put('use', 'diy.Diy/setUse'); Route::put('use/:id', 'diy.Diy/setUse');
// 获取页面模板 // 获取页面模板
Route::get('template', 'diy.Diy/getTemplate'); Route::get('template', 'diy.Diy/getTemplate');

View File

@ -32,8 +32,6 @@ Route::group('notice', function () {
Route::get('notice/sms/:sms_type', 'notice.Notice/smsConfig'); Route::get('notice/sms/:sms_type', 'notice.Notice/smsConfig');
//短信配置修改 //短信配置修改
Route::put('notice/sms/:sms_type', 'notice.Notice/editSms'); Route::put('notice/sms/:sms_type', 'notice.Notice/editSms');
//消息发送记录
Route::get('notice/log', 'notice.Notice/getLogList');
//消息修改 //消息修改
Route::post('notice/edit', 'notice.Notice/edit'); Route::post('notice/edit', 'notice.Notice/edit');

View File

@ -26,8 +26,6 @@ Route::group(function () {
Route::get('captcha/create', 'login.Captcha/create'); Route::get('captcha/create', 'login.Captcha/create');
//一次校验验证码 //一次校验验证码
Route::get('captcha/check', 'login.Captcha/check'); Route::get('captcha/check', 'login.Captcha/check');
Route::get('test', 'login.Login/test');
}); });
//加载插件路由 //加载插件路由

View File

@ -1,34 +0,0 @@
<?php
// +----------------------------------------------------------------------
// | Niucloud-admin 企业快速开发的多应用管理平台
// +----------------------------------------------------------------------
// | 官方网址https://www.niucloud.com
// +----------------------------------------------------------------------
// | niucloud团队 版权所有 开源版本可自由商用
// +----------------------------------------------------------------------
// | Author: Niucloud Team
// +----------------------------------------------------------------------
use app\adminapi\middleware\AdminCheckRole;
use app\adminapi\middleware\AdminCheckToken;
use app\adminapi\middleware\AdminLog;
use think\facade\Route;
/**
* 站点相关平台0
*/
Route::group('stat', function () {
/***************************************************** 统计 ****************************************************/
//控制台
Route::get('index', 'stat.Stat/index');
//站点控制台
Route::get('siteindex', 'stat.SiteStat/index');
})->middleware([
AdminCheckToken::class,
AdminCheckRole::class,
AdminLog::class
]);

View File

@ -86,24 +86,6 @@ Route::group('sys', function() {
//地图设置 //地图设置
Route::get('config/map', 'sys.Config/getMap'); Route::get('config/map', 'sys.Config/getMap');
//首页加载设置
Route::put('config/site_index', 'sys.Config/setSiteIndex');
//获取首页加载
Route::get('config/site_index', 'sys.Config/getSiteIndexList');
//平台首页加载设置
Route::put('config/admin_index', 'sys.Config/setAdminIndex');
//获取平台首页加载
Route::get('config/admin_index', 'sys.Config/getAdminIndexList');
// 获取手机端首页加载
Route::get('config/wap_index', 'sys.Config/getWapIndexList');
//快捷菜单设置
Route::put('config/shortcut_menu', 'sys.Config/setShortcutMenu');
//获取快捷菜单
Route::get('config/shortcut_menu', 'sys.Config/getShortcutMenu');
//登录注册设置 //登录注册设置
Route::get('config/login', 'login.Config/getConfig'); Route::get('config/login', 'login.Config/getConfig');
//登录注册设置 //登录注册设置
@ -274,6 +256,63 @@ Route::group('sys', function() {
/***************************************************** 获取布局 ****************************************************/ /***************************************************** 获取布局 ****************************************************/
Route::get('layout', 'sys.System/layout'); Route::get('layout', 'sys.System/layout');
Route::put('layout', 'sys.System/setLayout'); Route::put('layout', 'sys.System/setLayout');
/***************************************************** 小票打印管理 ****************************************************/
// 小票打印机分页列表
Route::get('printer', 'sys.Printer/pages');
// 小票打印机列表
Route::get('printer/list', 'sys.Printer/lists');
// 小票打印机详情
Route::get('printer/:id', 'sys.Printer/info');
// 添加小票打印机
Route::post('printer', 'sys.Printer/add');
// 编辑小票打印机
Route::put('printer/:id', 'sys.Printer/edit');
// 修改小票打印机状态
Route::put('printer/status', 'sys.Printer/modifyStatus');
// 删除小票打印机
Route::delete('printer/:id', 'sys.Printer/del');
// 小票打印模板分页列表
Route::get('printer/template', 'sys.Printer/templatePageLists');
// 小票打印模板列表
Route::get('printer/template/list', 'sys.Printer/templateLists');
// 小票打印模板详情
Route::get('printer/template/:id', 'sys.Printer/templateInfo');
// 添加小票打印模板
Route::post('printer/template', 'sys.Printer/templateAdd');
// 编辑小票打印模板
Route::put('printer/template/:id', 'sys.Printer/templateEdit');
// 删除小票打印模板
Route::delete('printer/template/:id', 'sys.Printer/templateDel');
// 获取小票打印模板类型
Route::get('printer/type', 'sys.Printer/getType');
// 获取小票打印机设备品牌
Route::get('printer/brand', 'sys.Printer/getBrand');
// 刷新易联云打印机token
Route::put('printer/refreshtoken/:id', 'sys.Printer/refreshToken');
// 测试易联云打印
Route::put('printer/testprint/:id', 'sys.Printer/testPrint');
// 打印小票内容
Route::post('printer/printticket', 'sys.Printer/printTicket');
})->middleware([ })->middleware([
AdminCheckToken::class, AdminCheckToken::class,
AdminCheckRole::class, AdminCheckRole::class,

View File

@ -19,6 +19,8 @@ use think\facade\Route;
Route::group('user', function () { Route::group('user', function () {
/***************************************************** 用户 ****************************************************/ /***************************************************** 用户 ****************************************************/
Route::get('', 'user.User/lists'); Route::get('', 'user.User/lists');
//全部用户列表
Route::get('user_all', 'user.User/getUserAll');
//用户详情 //用户详情
Route::get(':uid', 'user.User/info'); Route::get(':uid', 'user.User/info');
//用户新增 //用户新增

View File

@ -11,7 +11,9 @@
namespace app\api\controller\login; namespace app\api\controller\login;
use app\dict\member\MemberLoginTypeDict;
use app\service\api\captcha\CaptchaService; use app\service\api\captcha\CaptchaService;
use app\service\api\login\ConfigService;
use app\service\api\login\LoginService; use app\service\api\login\LoginService;
use core\base\BaseController; use core\base\BaseController;
use Exception; use Exception;
@ -25,11 +27,12 @@ class Login extends BaseController
*/ */
public function login() public function login()
{ {
$data = $this->request->params([ $data = $this->request->params([
[ 'username', '' ], [ 'username', '' ],
[ 'password', '' ], [ 'password', '' ],
]); ]);
//校验登录注册配置
( new ConfigService() )->checkLoginConfig(MemberLoginTypeDict::USERNAME);
//参数验证 //参数验证
//验证码验证 //验证码验证
$result = ( new LoginService() )->account($data[ 'username' ], $data[ 'password' ]); $result = ( new LoginService() )->account($data[ 'username' ], $data[ 'password' ]);
@ -38,7 +41,6 @@ class Login extends BaseController
return fail('ACCOUNT_OR_PASSWORD_ERROR'); return fail('ACCOUNT_OR_PASSWORD_ERROR');
} }
return success($result); return success($result);
} }
/** /**
@ -83,6 +85,8 @@ class Login extends BaseController
$data = $this->request->params([ $data = $this->request->params([
[ 'mobile', '' ], [ 'mobile', '' ],
]); ]);
//校验登录注册配置
( new ConfigService() )->checkLoginConfig(MemberLoginTypeDict::MOBILE);
return success(( new LoginService() )->mobile($data[ 'mobile' ])); return success(( new LoginService() )->mobile($data[ 'mobile' ]));
} }

View File

@ -11,6 +11,8 @@
namespace app\api\controller\login; namespace app\api\controller\login;
use app\dict\member\MemberLoginTypeDict;
use app\service\api\login\ConfigService;
use app\service\api\login\RegisterService; use app\service\api\login\RegisterService;
use core\base\BaseController; use core\base\BaseController;
use think\Response; use think\Response;
@ -30,6 +32,8 @@ class Register extends BaseController
[ 'password', '' ], [ 'password', '' ],
[ 'mobile', '' ], [ 'mobile', '' ],
]); ]);
//校验登录注册配置
( new ConfigService() )->checkLoginConfig(MemberLoginTypeDict::USERNAME);
//参数验证 //参数验证
$this->validate($data, 'app\validate\member\Member.account_register'); $this->validate($data, 'app\validate\member\Member.account_register');
//验证码验证 //验证码验证
@ -46,6 +50,8 @@ class Register extends BaseController
$data = $this->request->params([ $data = $this->request->params([
[ 'mobile', '' ], [ 'mobile', '' ],
]); ]);
//校验登录注册配置
( new ConfigService() )->checkLoginConfig(MemberLoginTypeDict::MOBILE);
//参数验证 //参数验证
$this->validate($data, [ $this->validate($data, [
'mobile' => 'require|mobile' 'mobile' => 'require|mobile'
@ -55,5 +61,4 @@ class Register extends BaseController
return success($result); return success($result);
} }
} }

View File

@ -33,10 +33,12 @@ class Account extends BaseApiController
public function point(): Response public function point(): Response
{ {
$data = $this->request->params([ $data = $this->request->params([
['from_type', ''] ['from_type', ''],
['amount_type', 'all'],//全部all 收入income 支出disburse
['create_time', []],
]); ]);
$data['account_type'] = MemberAccountTypeDict::POINT; $data['account_type'] = MemberAccountTypeDict::POINT;
return success((new MemberAccountService())->getPage($data)); return success((new MemberAccountService())->getPointPage($data));
} }
/** /**
@ -59,9 +61,11 @@ class Account extends BaseApiController
public function balanceList(): Response public function balanceList(): Response
{ {
$data = $this->request->params([ $data = $this->request->params([
['from_type', ''] ['from_type', ''],
['trade_type', ''],
['create_time', []]
]); ]);
return success((new MemberAccountService())->getPages($data)); return success((new MemberAccountService())->getBalancePage($data));
} }
/** /**
@ -98,9 +102,11 @@ class Account extends BaseApiController
public function commission(): Response public function commission(): Response
{ {
$data = $this->request->params([ $data = $this->request->params([
['keyword', ''],
['from_type', ''], ['from_type', ''],
['account_data_gt', ''], ['account_data_gt', ''],
['account_data_lt', ''], ['account_data_lt', ''],
['create_time', []],
]); ]);
$data['account_type'] = MemberAccountTypeDict::COMMISSION; $data['account_type'] = MemberAccountTypeDict::COMMISSION;
return success((new MemberAccountService())->getPage($data)); return success((new MemberAccountService())->getPage($data));

View File

@ -15,9 +15,6 @@ use app\service\api\login\AuthService;
use app\service\api\member\MemberLogService; use app\service\api\member\MemberLogService;
use app\service\api\member\MemberService; use app\service\api\member\MemberService;
use core\base\BaseApiController; use core\base\BaseApiController;
use think\db\exception\DataNotFoundException;
use think\db\exception\DbException;
use think\db\exception\ModelNotFoundException;
use think\Response; use think\Response;
class Member extends BaseApiController class Member extends BaseApiController

View File

@ -11,7 +11,6 @@
namespace app\api\controller\sys; namespace app\api\controller\sys;
use app\service\api\scan\ScanService;
use app\service\api\verify\VerifyService; use app\service\api\verify\VerifyService;
use core\base\BaseApiController; use core\base\BaseApiController;
use think\Response; use think\Response;
@ -64,6 +63,7 @@ class Verify extends BaseApiController
['relate_tag', 0], ['relate_tag', 0],
['type', ''], ['type', ''],
['code', ''], ['code', ''],
['keyword', ''],
['create_time', []] ['create_time', []]
]); ]);
return success(data:(new VerifyService())->getRecordsPageByVerifier($data)); return success(data:(new VerifyService())->getRecordsPageByVerifier($data));

View File

@ -48,7 +48,6 @@ class Weapp extends BaseApiController
return success($weapp_auth_service->register($data[ 'openid' ], $data[ 'mobile' ], $data[ 'mobile_code' ], $data[ 'unionid' ])); return success($weapp_auth_service->register($data[ 'openid' ], $data[ 'mobile' ], $data[ 'mobile_code' ], $data[ 'unionid' ]));
} }
public function subscribeMessage() public function subscribeMessage()
{ {
$data = $this->request->params([ [ 'keys', '' ] ]); $data = $this->request->params([ [ 'keys', '' ] ]);
@ -68,7 +67,6 @@ class Weapp extends BaseApiController
if ($result) { if ($result) {
return success([ 'is_trade_managed' => true ]); return success([ 'is_trade_managed' => true ]);
} }
} catch (\Exception $e) { } catch (\Exception $e) {
} }
return success([ 'is_trade_managed' => false ]); return success([ 'is_trade_managed' => false ]);
@ -86,7 +84,17 @@ class Weapp extends BaseApiController
$wechat_template_service = new WeappDeliveryService(); $wechat_template_service = new WeappDeliveryService();
$result = $wechat_template_service->getMsgJumpPath($data[ 'out_trade_no' ]); $result = $wechat_template_service->getMsgJumpPath($data[ 'out_trade_no' ]);
return success([ 'path' => $result ]); return success([ 'path' => $result ]);
}
/**
* 更新openid
* @return Response
*/
public function updateOpenid()
{
$data = $this->request->params([ [ 'code', '' ] ]);
$weapp_auth_service = new WeappAuthService();
return success($weapp_auth_service->updateOpenid($data[ 'code' ]));
} }
} }

View File

@ -13,7 +13,6 @@ namespace app\api\controller\wechat;
use app\service\api\wechat\WechatAuthService; use app\service\api\wechat\WechatAuthService;
use core\base\BaseController; use core\base\BaseController;
use EasyWeChat\Kernel\Exceptions\InvalidArgumentException;
use think\db\exception\DataNotFoundException; use think\db\exception\DataNotFoundException;
use think\db\exception\DbException; use think\db\exception\DbException;
use think\db\exception\ModelNotFoundException; use think\db\exception\ModelNotFoundException;
@ -27,7 +26,8 @@ class Wechat extends BaseController
* 获取跳转获取code * 获取跳转获取code
* @return Response * @return Response
*/ */
public function getCodeUrl(){ public function getCodeUrl()
{
$data = $this->request->params([ $data = $this->request->params([
[ 'url', '' ], [ 'url', '' ],
[ 'scopes', '' ] [ 'scopes', '' ]
@ -40,7 +40,8 @@ class Wechat extends BaseController
* code获取微信信息 * code获取微信信息
* @return Response * @return Response
*/ */
public function getWechatUser(){ public function getWechatUser()
{
$data = $this->request->params([ $data = $this->request->params([
[ 'code', '' ], [ 'code', '' ],
]); ]);
@ -53,7 +54,8 @@ class Wechat extends BaseController
* 授权信息登录 * 授权信息登录
* @return Response * @return Response
*/ */
public function wechatLogin(){ public function wechatLogin()
{
$data = $this->request->params([ $data = $this->request->params([
[ 'data', '' ], [ 'data', '' ],
]); ]);
@ -69,7 +71,8 @@ class Wechat extends BaseController
* @throws DbException * @throws DbException
* @throws ModelNotFoundException * @throws ModelNotFoundException
*/ */
public function login(){ public function login()
{
$data = $this->request->params([ $data = $this->request->params([
[ 'code', '' ], [ 'code', '' ],
]); ]);
@ -81,7 +84,8 @@ class Wechat extends BaseController
* 注册 * 注册
* @return Response * @return Response
*/ */
public function register(){ public function register()
{
$data = $this->request->params([ $data = $this->request->params([
[ 'openid', '' ], [ 'openid', '' ],
[ 'unionid', '' ], [ 'unionid', '' ],
@ -99,7 +103,8 @@ class Wechat extends BaseController
* 同步 * 同步
* @return Response * @return Response
*/ */
public function sync(){ public function sync()
{
$data = $this->request->params([ $data = $this->request->params([
[ 'code', '' ], [ 'code', '' ],
]); ]);
@ -111,7 +116,8 @@ class Wechat extends BaseController
* 获取jssdk config * 获取jssdk config
* @return Response * @return Response
*/ */
public function jssdkConfig(){ public function jssdkConfig()
{
$data = $this->request->params([ $data = $this->request->params([
[ 'url', '' ], [ 'url', '' ],
]); ]);
@ -123,9 +129,20 @@ class Wechat extends BaseController
* 扫码登录 * 扫码登录
* @return Response * @return Response
*/ */
public function scanLogin(){ public function scanLogin()
{
$wechat_auth_service = new WechatAuthService(); $wechat_auth_service = new WechatAuthService();
return success($wechat_auth_service->scanLogin()); return success($wechat_auth_service->scanLogin());
}
/**
* 更新openid
* @return Response
*/
public function updateOpenid()
{
$data = $this->request->params([ [ 'code', '' ] ]);
$wechat_auth_service = new WechatAuthService();
return success($wechat_auth_service->updateOpenid($data[ 'code' ]));
} }
} }

View File

@ -100,8 +100,6 @@ Route::group(function() {
Route::get('site', 'sys.Config/site'); Route::get('site', 'sys.Config/site');
//场景域名 //场景域名
Route::get('scene_domain', 'sys.Config/getSceneDomain'); Route::get('scene_domain', 'sys.Config/getSceneDomain');
// 获取手机端首页列表
Route::get('wap_index', 'sys.Config/getWapIndexList');
// 获取地图设置 // 获取地图设置
Route::get('map', 'sys.Config/getMap'); Route::get('map', 'sys.Config/getMap');
@ -144,5 +142,15 @@ Route::group(function() {
})->middleware(ApiChannel::class) })->middleware(ApiChannel::class)
->middleware(ApiCheckToken::class) ->middleware(ApiCheckToken::class)
->middleware(ApiLog::class); ->middleware(ApiLog::class);
Route::group(function() {
//公众号更新用户openid
Route::put('wechat/update_openid', 'wechat.Wechat/updateOpenid');
//小程序更新用户openid
Route::put('weapp/update_openid', 'weapp.Weapp/updateOpenid');
})->middleware(ApiChannel::class)
->middleware(ApiCheckToken::class, true)
->middleware(ApiLog::class);
//加载插件路由 //加载插件路由
( new DictLoader("Route") )->load([ 'app_type' => 'api' ]); ( new DictLoader("Route") )->load([ 'app_type' => 'api' ]);

View File

@ -7,7 +7,6 @@ use app\service\admin\install\InstallSystemService;
use app\service\core\menu\CoreMenuService; use app\service\core\menu\CoreMenuService;
use think\console\Command; use think\console\Command;
use think\console\Input; use think\console\Input;
use think\console\input\Argument;
use think\console\input\Option; use think\console\input\Option;
use think\console\Output; use think\console\Output;

View File

@ -18,6 +18,7 @@ use Workerman\Worker;
class Queue extends Command class Queue extends Command
{ {
use WorkerCommand; use WorkerCommand;
public function configure() public function configure()
{ {
// 指令配置 // 指令配置
@ -27,8 +28,6 @@ class Queue extends Command
->setDescription('基于Redis的消息队列支持消息延迟处理。'); ->setDescription('基于Redis的消息队列支持消息延迟处理。');
} }
/** /**
* 执行任务 * 执行任务
* @return void * @return void
@ -43,8 +42,7 @@ class Queue extends Command
// $worker->count = 3; // $worker->count = 3;
$worker->onWorkerStart = function() use ($output) { $worker->onWorkerStart = function() use ($output) {
// 定时每10秒一次 // 定时每10秒一次
Timer::add(30, function()use($output) Timer::add(30, function() use ($output) {
{
( new SysSchedule() )->select(); ( new SysSchedule() )->select();
}); });
$redis_option = [ $redis_option = [
@ -87,7 +85,8 @@ class Queue extends Command
* 捕获所有队列任务 * 捕获所有队列任务
* @return array * @return array
*/ */
public function getAllQueue(){ public function getAllQueue()
{
$class_list = []; $class_list = [];
$system_dir = root_path() . 'app' . DIRECTORY_SEPARATOR . 'job'; $system_dir = root_path() . 'app' . DIRECTORY_SEPARATOR . 'job';
$addon_dir = root_path() . 'addon' . DIRECTORY_SEPARATOR; $addon_dir = root_path() . 'addon' . DIRECTORY_SEPARATOR;

View File

@ -16,6 +16,7 @@ use Workerman\Worker;
class Schedule extends Command class Schedule extends Command
{ {
use WorkerCommand; use WorkerCommand;
public function configure() public function configure()
{ {
// 指令配置 // 指令配置
@ -25,8 +26,6 @@ class Schedule extends Command
->setDescription('定时任务类似linux的crontab。支持秒级别定时。'); ->setDescription('定时任务类似linux的crontab。支持秒级别定时。');
} }
/** /**
* 执行任务 * 执行任务
* @return void * @return void

View File

@ -21,6 +21,7 @@ use Workerman\Worker;
class Workerman extends Command class Workerman extends Command
{ {
use WorkerCommand; use WorkerCommand;
public function configure() public function configure()
{ {
// 指令配置 // 指令配置
@ -30,8 +31,6 @@ class Workerman extends Command
->setDescription('Workerman高性能PHP应用容器'); ->setDescription('Workerman高性能PHP应用容器');
} }
/** /**
* 执行任务 * 执行任务
* @return void * @return void
@ -79,8 +78,7 @@ class Workerman extends Command
$worker->onWorkerStart = function() use ($output) { $worker->onWorkerStart = function() use ($output) {
$output->writeln('[' . date('Y-m-d H:i:s') . ']' . " Queue Starting..."); $output->writeln('[' . date('Y-m-d H:i:s') . ']' . " Queue Starting...");
// 定时每10秒一次 // 定时每10秒一次
Timer::add(30, function()use($output) Timer::add(30, function() use ($output) {
{
( new SysSchedule() )->select(); ( new SysSchedule() )->select();
}); });
$redis_option = [ $redis_option = [
@ -168,7 +166,8 @@ class Workerman extends Command
* 捕获所有队列任务 * 捕获所有队列任务
* @return array * @return array
*/ */
public function getAllQueue(){ public function getAllQueue()
{
$class_list = []; $class_list = [];
$system_dir = root_path() . 'app' . DIRECTORY_SEPARATOR . 'job'; $system_dir = root_path() . 'app' . DIRECTORY_SEPARATOR . 'job';
$addon_dir = root_path() . 'addon' . DIRECTORY_SEPARATOR; $addon_dir = root_path() . 'addon' . DIRECTORY_SEPARATOR;

View File

@ -36,7 +36,7 @@ class AddonDict
// 插件关键字黑名单 // 插件关键字黑名单
const ADDON_KEY_BLACK_LIST = [ const ADDON_KEY_BLACK_LIST = [
'addon', 'aliapp', 'app', 'applet', 'auht', 'channel', 'dict', 'diy', 'generator', 'home', 'member', 'niucloud', 'addon', 'aliapp', 'app', 'applet', 'auth', 'channel', 'dict', 'diy', 'generator', 'home', 'member', 'niucloud',
'notice', 'pay', 'site', 'sys', 'upload', 'home', 'user', 'weapp', 'wechat' 'notice', 'pay', 'site', 'sys', 'upload', 'home', 'user', 'weapp', 'wechat'
]; ];

View File

@ -552,6 +552,8 @@ class ComponentDict
'value' => [ 'value' => [
"imageSize" => 40, "imageSize" => 40,
"aroundRadius" => 0, "aroundRadius" => 0,
'style' => 'style-1',
"styleName" => "风格一",
"bottomPosition" => "lowerRight", // 左上upperLeft右上upperRight左下lowerLeft右下lowerRight "bottomPosition" => "lowerRight", // 左上upperLeft右上upperRight左下lowerLeft右下lowerRight
"list" => [ "list" => [
[ [

View File

@ -114,7 +114,14 @@ class LinkDict
'url' => '/app/pages/verify/index', 'url' => '/app/pages/verify/index',
'is_share' => 1, 'is_share' => 1,
'action' => '' 'action' => ''
] ],
[
'name' => 'MEMBER_CONTACT',
'title' => get_lang('dict_diy.member_contact'),
'url' => '/app/pages/member/contact',
'is_share' => 1,
'action' => ''
],
] ]
], ],
'DIY_PAGE' => [ 'DIY_PAGE' => [

View File

@ -62,7 +62,7 @@ class PagesDict
"margin" => [ "margin" => [
"top" => 10, "top" => 10,
"bottom" => 10, "bottom" => 10,
"both" => 16 "both" => 10
], ],
"ignore" => [], "ignore" => [],
"list" => [] "list" => []
@ -152,10 +152,11 @@ class PagesDict
'topStatusBar' => [ 'topStatusBar' => [
'isShow' => true, 'isShow' => true,
'bgColor' => "#ffffff", 'bgColor' => "#ffffff",
'isTransparent' => false, 'rollBgColor' => "#ffffff",
'style' => 'style-1', 'style' => 'style-1',
'styleName' => '风格1', 'styleName' => '风格1',
'textColor' => "#333333", 'textColor' => "#333333",
'rollTextColor' => "#333333",
'textAlign' => 'center', 'textAlign' => 'center',
'inputPlaceholder' => '请输入搜索关键词', 'inputPlaceholder' => '请输入搜索关键词',
'imgUrl' => '', 'imgUrl' => '',
@ -217,16 +218,17 @@ class PagesDict
"margin" => [ "margin" => [
"top" => 0, "top" => 0,
"bottom" => 0, "bottom" => 0,
"both" => 12 "both" => 10
] ]
], ],
'topStatusBar' => [ "topStatusBar" => [
'isShow' => true, 'isShow' => true,
'bgColor' => "#ffffff", 'bgColor' => "#ffffff",
'isTransparent' => false, 'rollBgColor' => "#ffffff",
'style' => 'style-1', 'style' => 'style-1',
'styleName' => '风格1', 'styleName' => '风格1',
'textColor' => "#333333", 'textColor' => "#333333",
'rollTextColor' => "#333333",
'textAlign' => 'center', 'textAlign' => 'center',
'inputPlaceholder' => '请输入搜索关键词', 'inputPlaceholder' => '请输入搜索关键词',
'imgUrl' => '', 'imgUrl' => '',
@ -269,7 +271,7 @@ class PagesDict
"margin" => [ "margin" => [
"top" => 12, "top" => 12,
"bottom" => 6, "bottom" => 6,
"both" => 16 "both" => 10
], ],
"style" => "style-1", "style" => "style-1",
"styleName" => "风格1", "styleName" => "风格1",
@ -306,7 +308,7 @@ class PagesDict
"margin" => [ "margin" => [
"top" => 6, "top" => 6,
"bottom" => 0, "bottom" => 0,
"both" => 16 "both" => 10
] ]
], ],
[ [
@ -359,7 +361,7 @@ class PagesDict
"margin" => [ "margin" => [
"top" => 0, "top" => 0,
"bottom" => 0, "bottom" => 0,
"both" => 16 "both" => 10
] ]
], ],
[ [
@ -400,7 +402,7 @@ class PagesDict
"margin" => [ "margin" => [
"top" => 0, "top" => 0,
"bottom" => 6, "bottom" => 6,
"both" => 16 "both" => 10
], ],
"ignore" => [], "ignore" => [],
"list" => [ "list" => [
@ -467,7 +469,11 @@ class PagesDict
[ [
"title" => "联系客服", "title" => "联系客服",
"link" => [ "link" => [
"name" => "" "name" => "MEMBER_CONTACT",
"parent" => "MEMBER_LINK",
"title" => "客服",
"url" => "/app/pages/member/contact",
"action" => ""
], ],
"imageUrl" => "static/resource/images/diy/horz_m_service.png", "imageUrl" => "static/resource/images/diy/horz_m_service.png",
"label" => [ "label" => [
@ -570,7 +576,11 @@ class PagesDict
[ [
"title" => "联系客服", "title" => "联系客服",
"link" => [ "link" => [
"name" => "" "name" => "MEMBER_CONTACT",
"parent" => "MEMBER_LINK",
"title" => "客服",
"url" => "/app/pages/member/contact",
"action" => ""
], ],
"imageUrl" => "static/resource/images/diy/vert_m_service.png", "imageUrl" => "static/resource/images/diy/vert_m_service.png",
"label" => [ "label" => [
@ -618,7 +628,7 @@ class PagesDict
"margin" => [ "margin" => [
"top" => 6, "top" => 6,
"bottom" => 12, "bottom" => 12,
"both" => 16 "both" => 10
] ]
] ]
] ]
@ -660,7 +670,7 @@ class PagesDict
"margin" => [ "margin" => [
"top" => 0, "top" => 0,
"bottom" => 0, "bottom" => 0,
"both" => 12 "both" => 10
] ]
], ],
'topStatusBar' => [ 'topStatusBar' => [
@ -749,7 +759,7 @@ class PagesDict
"margin" => [ "margin" => [
"top" => 0, "top" => 0,
"bottom" => 0, "bottom" => 0,
"both" => 16 "both" => 10
] ]
], ],
[ [
@ -802,7 +812,7 @@ class PagesDict
"margin" => [ "margin" => [
"top" => 0, "top" => 0,
"bottom" => 0, "bottom" => 0,
"both" => 16 "both" => 10
] ]
], ],
[ [
@ -843,7 +853,7 @@ class PagesDict
"margin" => [ "margin" => [
"top" => 0, "top" => 0,
"bottom" => 6, "bottom" => 6,
"both" => 16 "both" => 10
], ],
"ignore" => [], "ignore" => [],
"list" => [ "list" => [
@ -910,7 +920,11 @@ class PagesDict
[ [
"title" => "联系客服", "title" => "联系客服",
"link" => [ "link" => [
"name" => "" "name" => "MEMBER_CONTACT",
"parent" => "MEMBER_LINK",
"title" => "客服",
"url" => "/app/pages/member/contact",
"action" => ""
], ],
"imageUrl" => "static/resource/images/diy/horz_m_service.png", "imageUrl" => "static/resource/images/diy/horz_m_service.png",
"label" => [ "label" => [
@ -1013,7 +1027,11 @@ class PagesDict
[ [
"title" => "联系客服", "title" => "联系客服",
"link" => [ "link" => [
"name" => "" "name" => "MEMBER_CONTACT",
"parent" => "MEMBER_LINK",
"title" => "客服",
"url" => "/app/pages/member/contact",
"action" => ""
], ],
"imageUrl" => "static/resource/images/diy/vert_m_service.png", "imageUrl" => "static/resource/images/diy/vert_m_service.png",
"label" => [ "label" => [
@ -1061,7 +1079,7 @@ class PagesDict
"margin" => [ "margin" => [
"top" => 6, "top" => 6,
"bottom" => 12, "bottom" => 12,
"both" => 16 "both" => 10
] ]
] ]

View File

@ -24,49 +24,49 @@ class MemberLevelDict
{ {
return [ return [
// 'level_1' => [
// 'bg_color' => '#414852',
// 'level_color' => '#666666',
// 'progress' => ['#999999','#666666'],
// 'gift'=> '#ECEBEB',
// ],
'level_1' => [ 'level_1' => [
'bg_color' => '#414852',
'level_color' => '#666666',
'progress' => ['#999999','#666666'],
'gift'=> '#ECEBEB',
],
'level_2' => [
'bg_color' => '#354B54', 'bg_color' => '#354B54',
'level_color' => '#116787', 'level_color' => '#116787',
'progress' => ['#4BA5C7','#116787'], 'progress' => ['#4BA5C7','#116787'],
'gift'=> '#F1FDFF', 'gift'=> '#F1FDFF',
], ],
'level_3' => [ 'level_2' => [
'bg_color' => '#203B54', 'bg_color' => '#203B54',
'level_color' => '#286BAA', 'level_color' => '#286BAA',
'progress' => ['#529BDF','#286BAA'], 'progress' => ['#529BDF','#286BAA'],
'gift'=> '#E3F2FF', 'gift'=> '#E3F2FF',
], ],
'level_4' => [ 'level_3' => [
'bg_color' => '#403E32', 'bg_color' => '#403E32',
'level_color' => '#967600', 'level_color' => '#967600',
'progress' => ['#D1A400','#967600'], 'progress' => ['#D1A400','#967600'],
'gift'=> '#FFFAE3', 'gift'=> '#FFFAE3',
], ],
'level_5' => [ 'level_4' => [
'bg_color' => '#36354B', 'bg_color' => '#36354B',
'level_color' => '#4B3EF9', 'level_color' => '#4B3EF9',
'progress' => ['#8F87FF','#4B3EF9'], 'progress' => ['#8F87FF','#4B3EF9'],
'gift'=> '#E7EEFF', 'gift'=> '#E7EEFF',
], ],
'level_6' => [ 'level_5' => [
'bg_color' => '#362F28', 'bg_color' => '#362F28',
'level_color' => '#9F5300', 'level_color' => '#9F5300',
'progress' => ['#EFA244','#9F5300'], 'progress' => ['#EFA244','#9F5300'],
'gift'=> '#FFF5DC', 'gift'=> '#FFF5DC',
], ],
'level_7' => [ 'level_6' => [
'bg_color' => '#322432', 'bg_color' => '#322432',
'level_color' => '#DE43D6', 'level_color' => '#DE43D6',
'progress' => ['#FFA0FA','#DE43D6'], 'progress' => ['#FFA0FA','#DE43D6'],
'gift'=> '#FFEAFF', 'gift'=> '#FFEAFF',
], ],
'level_8' => [ 'level_7' => [
'bg_color' => '#301C1E', 'bg_color' => '#301C1E',
'level_color' => '#DE000B', 'level_color' => '#DE000B',
'progress' => ['#FF8B36','#DE000B'], 'progress' => ['#FF8B36','#DE000B'],

View File

@ -112,6 +112,8 @@ return [
'inc' => 1, 'inc' => 1,
//是否减少 //是否减少
'dec' => 0, 'dec' => 0,
//是否累增
'is_change_get' => 0,
], ],
//会员升级礼包 //会员升级礼包
'level_upgrade' => [ 'level_upgrade' => [
@ -160,6 +162,8 @@ return [
'inc' => 0, 'inc' => 0,
//是否减少 //是否减少
'dec' => 1, 'dec' => 1,
//是否累增
'is_change_get' => 0,
], ],
], ],
//会员佣金 //会员佣金
@ -182,6 +186,8 @@ return [
'inc' => 0, 'inc' => 0,
//是否减少 //是否减少
'dec' => 1, 'dec' => 1,
//是否累增
'is_change_get' => 0,
], ],
] ]
]; ];

View File

@ -2201,7 +2201,7 @@ return [
'router_path' => 'setting/agreement', 'router_path' => 'setting/agreement',
'view_path' => 'setting/agreement', 'view_path' => 'setting/agreement',
'methods' => 'get', 'methods' => 'get',
'sort' => '80', 'sort' => '100',
'status' => '1', 'status' => '1',
'is_show' => '1', 'is_show' => '1',
], ],
@ -2289,7 +2289,7 @@ return [
'router_path' => 'setting/storage', 'router_path' => 'setting/storage',
'view_path' => 'setting/storage', 'view_path' => 'setting/storage',
'methods' => 'get', 'methods' => 'get',
'sort' => '30', 'sort' => '98',
'status' => '1', 'status' => '1',
'is_show' => '1', 'is_show' => '1',
'children' => [ 'children' => [
@ -2333,7 +2333,7 @@ return [
'router_path' => 'setting/export', 'router_path' => 'setting/export',
'view_path' => 'setting/export', 'view_path' => 'setting/export',
'methods' => 'get', 'methods' => 'get',
'sort' => '30', 'sort' => '97',
'status' => '1', 'status' => '1',
'is_show' => '1', 'is_show' => '1',
'children' => [ 'children' => [
@ -2352,9 +2352,125 @@ return [
'is_show' => '1', 'is_show' => '1',
] ]
] ]
],
[
'menu_name' => '小票打印',
'menu_key' => 'printer_management',
'menu_short_name' => '小票打印',
'menu_type' => '1',
'icon' => 'element FolderChecked',
'api_url' => 'printer',
'router_path' => 'printer/list',
'view_path' => 'printer/list',
'methods' => 'get',
'sort' => '97',
'status' => '1',
'is_show' => '1',
'children' => [
[
'menu_name' => '删除打印机',
'menu_key' => 'delete_printer',
'menu_short_name' => '删除打印机',
'menu_type' => '2',
'icon' => '',
'api_url' => 'printer/<id>',
'router_path' => '',
'view_path' => '',
'methods' => 'delete',
'sort' => '100',
'status' => '1',
'is_show' => '1',
] ]
] ]
], ],
[
'menu_name' => '添加打印机',
'menu_key' => 'printer_add',
'menu_short_name' => '添加打印机',
'menu_type' => '1',
'icon' => '',
'api_url' => 'printer',
'router_path' => 'printer/add',
'view_path' => 'printer/edit',
'methods' => 'post',
'sort' => '0',
'status' => '1',
'is_show' => '0',
],
[
'menu_name' => '编辑打印机',
'menu_key' => 'printer_edit',
'menu_short_name' => '添加打印机',
'menu_type' => '1',
'icon' => '',
'api_url' => 'printer/<id>',
'router_path' => 'printer/edit',
'view_path' => 'printer/edit',
'methods' => 'put',
'sort' => '0',
'status' => '1',
'is_show' => '0',
],
[
'menu_name' => '小票打印模板',
'menu_key' => 'printer_template_management',
'menu_short_name' => '小票打印模板',
'menu_type' => '1',
'icon' => 'element FolderChecked',
'api_url' => 'printer/template',
'router_path' => 'printer/template/list',
'view_path' => 'printer/template_list',
'methods' => 'get',
'sort' => '96',
'status' => '1',
'is_show' => '0',
'children' => [
[
'menu_name' => '删除打印模板',
'menu_key' => 'delete_printer_template',
'menu_short_name' => '删除打印模板',
'menu_type' => '2',
'icon' => '',
'api_url' => 'printer/template/<id>',
'router_path' => '',
'view_path' => '',
'methods' => 'delete',
'sort' => '100',
'status' => '1',
'is_show' => '1',
]
]
],
[
'menu_name' => '添加打印模板',
'menu_key' => 'printer_template_add',
'menu_short_name' => '添加打印模板',
'menu_type' => '1',
'icon' => '',
'api_url' => 'printer/template',
'router_path' => 'printer/template/add',
'view_path' => 'printer/template_edit',
'methods' => 'post',
'sort' => '0',
'status' => '1',
'is_show' => '0',
],
[
'menu_name' => '编辑打印模板',
'menu_key' => 'printer_template_edit',
'menu_short_name' => '编辑打印模板',
'menu_type' => '1',
'icon' => '',
'api_url' => 'printer/template/<id>',
'router_path' => 'printer/template/edit',
'view_path' => 'printer/template_edit',
'methods' => 'put',
'sort' => '0',
'status' => '1',
'is_show' => '0',
],
]
],
], ],
], ],

View File

@ -37,6 +37,10 @@ class ComponentDict
'sort' => 10000, 'sort' => 10000,
'relate' => '', // 关联字段,空为不处理// 组件属性 'relate' => '', // 关联字段,空为不处理// 组件属性
'value' => '文本内容', 'value' => '文本内容',
'template' => [
"width" => 165, // 宽度
'height' => 53 // 高度
]
], ],
'Image' => [ 'Image' => [
'title' => "图片", 'title' => "图片",
@ -68,10 +72,11 @@ class ComponentDict
'relate' => 'headimg', // 关联字段,空为不处理 'relate' => 'headimg', // 关联字段,空为不处理
'value' => '', 'value' => '',
'template' => [ 'template' => [
"width" => 50, // 宽度 "width" => 100, // 宽度
'height' => 50, // 高度 'height' => 100, // 高度
'minWidth' => 30, // 最小宽度 'minWidth' => 60, // 最小宽度
'minHeight' => 30, // 最小高度 'minHeight' => 60, // 最小高度
'shape' => 'circle'
], ],
], ],
'NickName' => [ 'NickName' => [
@ -84,10 +89,10 @@ class ComponentDict
'relate' => 'nickname', // 关联字段,空为不处理 'relate' => 'nickname', // 关联字段,空为不处理
'value' => '', 'value' => '',
'template' => [ 'template' => [
"width" => 50, // 宽度 "width" => 164, // 宽度
'height' => 50, // 高度 'height' => 55, // 高度
'minWidth' => 30, // 最小宽度 'minWidth' => 120, // 最小宽度
'minHeight' => 30, // 最小高度 'minHeight' => 50, // 最小高度
], ],
], ],
'Draw' => [ 'Draw' => [
@ -100,10 +105,10 @@ class ComponentDict
'relate' => '', // 关联字段,空为不处理 'relate' => '', // 关联字段,空为不处理
'value' => '', 'value' => '',
'template' => [ 'template' => [
"width" => 100, // 宽度 "width" => 200, // 宽度
'height' => 100, // 高度 'height' => 200, // 高度
'minWidth' => 30, // 最小宽度 'minWidth' => 60, // 最小宽度
'minHeight' => 30, // 最小高度 'minHeight' => 60, // 最小高度
'drawType' => 'Polygon', 'drawType' => 'Polygon',
'bgColor' => '#eeeeee', 'bgColor' => '#eeeeee',
'points' => [], // [x,y]:左上,右上,右下,左下 'points' => [], // [x,y]:左上,右上,右下,左下

View File

@ -12,28 +12,5 @@ return [
'class' => '', 'class' => '',
'function' => '' 'function' => ''
], ],
[
'key' => 'site_expire_close',
'name' => '站点到期自动关闭',
'desc' => '',
'time' => [
'type' => 'day',
'day' => 1,
'hour' => 1,
'min' => 1
],
'class' => 'app\job\schedule\SiteExpireClose',
'function' => ''
],
[
'key' => 'site_stat',
'name' => '站点统计',
'desc' => '',
'time' => [
'type' => 'hour',
'hour' => 1,
],
'class' => 'app\job\schedule\SiteStatJob',
'function' => ''
]
]; ];

View File

@ -1,33 +0,0 @@
<?php
// +----------------------------------------------------------------------
// | Niucloud-admin 企业快速开发的多应用管理平台
// +----------------------------------------------------------------------
// | 官方网址https://www.niucloud.com
// +----------------------------------------------------------------------
// | niucloud团队 版权所有 开源版本可自由商用
// +----------------------------------------------------------------------
// | Author: Niucloud Team
// +----------------------------------------------------------------------
namespace app\dict\site;
class SiteAccountLogDict
{
const PAY = 'pay';//支付
const REFUND = 'refund'; //退款
const TRANSFER = 'transfer'; //转账
/**
* 站点状态
* @return array
*/
public static function getType()
{
return [
self::PAY => get_lang('dict_site.pay'),//支付
self::REFUND => get_lang('dict_site.refund'),//退款
self::TRANSFER => get_lang('dict_site.transfer'),//转账
];
}
}

View File

@ -1,35 +0,0 @@
<?php
// +----------------------------------------------------------------------
// | Niucloud-admin 企业快速开发的多应用管理平台
// +----------------------------------------------------------------------
// | 官方网址https://www.niucloud.com
// +----------------------------------------------------------------------
// | niucloud团队 版权所有 开源版本可自由商用
// +----------------------------------------------------------------------
// | Author: Niucloud Team
// +----------------------------------------------------------------------
namespace app\dict\site;
class SiteDict
{
public const EXPIRE = 2;//过期
public const ON = 1;//正常
public const CLOSE = 3;//停止
/**
* 站点状态
* @return array
*/
public static function getStatus()
{
return [
self::ON => get_lang('dict_site.status_on'),//正常
self::EXPIRE => get_lang('dict_site.status_expire'),//过期
self::CLOSE => get_lang('dict_site.status_close'),//停止
];
}
}

View File

@ -30,8 +30,6 @@ class ConfigKeyDict
public const H5 = 'h5';//h5 public const H5 = 'h5';//h5
public const WXOPLATFORM = 'WXOPLATFORM'; // 微信开放平台
public const WEAPP_AUTHORIZATION_INFO = 'weapp_authorization_info'; public const WEAPP_AUTHORIZATION_INFO = 'weapp_authorization_info';
public const WECHAT_AUTHORIZATION_INFO = 'wechat_authorization_info'; public const WECHAT_AUTHORIZATION_INFO = 'wechat_authorization_info';

View File

@ -30,6 +30,8 @@ class FileDict
public const MID = 'mid';//小程序上传 public const MID = 'mid';//小程序上传
public const SMALL = 'small'; public const SMALL = 'small';
public const EXCEL = 'excel';//excel导入
/** /**
* 附件类型 * 附件类型
* @return array * @return array
@ -68,6 +70,7 @@ class FileDict
self::IMAGE,//图片上传 self::IMAGE,//图片上传
self::VIDEO,//视频上传 self::VIDEO,//视频上传
self::APPLET,//小程序包上传 self::APPLET,//小程序包上传
self::EXCEL,//excel导入
]; ];
} }

View File

@ -0,0 +1,62 @@
<?php
// +----------------------------------------------------------------------
// | Niucloud-admin 企业快速开发的多应用管理平台
// +----------------------------------------------------------------------
// | 官方网址https://www.niucloud.com
// +----------------------------------------------------------------------
// | niucloud团队 版权所有 开源版本可自由商用
// +----------------------------------------------------------------------
// | Author: Niucloud Team
// +----------------------------------------------------------------------
namespace app\dict\sys;
use core\dict\DictLoader;
class PrinterDict
{
public const YI_LIAN_YUN = 'yilianyun'; // 易联云打印机
/**
* 打印机品牌
* @param string $brand
* @return array|mixed|string
*/
public static function getBrandName($brand = '')
{
$list = [
self::YI_LIAN_YUN => get_lang('dict_printer.yilianyun'), // 易联云打印机
];
if ($brand == '') return $list;
return $list[ $brand ] ?? '';
}
/**
* 获取打印机模板类型
* @param string $type
* @return array|null
*/
public static function getType($type = '')
{
$system_type = [];
$type_list = ( new DictLoader("Printer") )->load($system_type);
if ($type == '') {
return $type_list;
} else {
$data = [];
foreach ($type_list as $k => $v) {
if ($v[ 'key' ] == $type) {
$data = $v;
break;
}
}
return $data;
}
}
}

View File

@ -47,18 +47,10 @@ $system_event = [
], ],
//协议类型加载 //协议类型加载
'AgreementType' => [], 'AgreementType' => [],
//站点首页加载
'SiteIndex' => [
'app\listener\system\SiteIndexListener'
],
// 站点端布局 // 站点端布局
'SiteLayout' => [ 'SiteLayout' => [
'app\listener\system\SiteLayout' 'app\listener\system\SiteLayout'
], ],
//平台首页加载
'AdminIndex' => [
'app\listener\system\AdminIndexListener'
],
'BottomNavigation' => [ 'BottomNavigation' => [
'app\listener\system\BottomNavigationListener' 'app\listener\system\BottomNavigationListener'
], ],
@ -88,12 +80,12 @@ $system_event = [
//导出数据类型 //导出数据类型
'ExportDataType' => [ 'ExportDataType' => [
//会员导出 //会员导出
'app\listener\member\MemberExportTypeListener', 'app\listener\member_export\MemberExportTypeListener',
], ],
//导出数据源 //导出数据源
'ExportData' => [ 'ExportData' => [
//会员导出 //会员导出
'app\listener\member\MemberExportDataListener', 'app\listener\member_export\MemberExportDataListener',
], ],
//统计执行 //统计执行
'StatExecute' => [], 'StatExecute' => [],

View File

@ -109,7 +109,8 @@ class Index extends BaseInstall
} }
} }
public function build() { public function build()
{
$install_user = Cache::get('install_user'); $install_user = Cache::get('install_user');
$token = ( new LoginService() )->login($install_user[ 'username' ], $install_user[ 'password' ]); $token = ( new LoginService() )->login($install_user[ 'username' ], $install_user[ 'password' ]);
$this->assign('token', $token[ 'token' ]); $this->assign('token', $token[ 'token' ]);
@ -169,6 +170,7 @@ class Index extends BaseInstall
]; ];
} else { } else {
try {
if (@mysqli_select_db($conn, $dbname)) { if (@mysqli_select_db($conn, $dbname)) {
$result = [ $result = [
"status" => 2, "status" => 2,
@ -180,6 +182,13 @@ class Index extends BaseInstall
"message" => "数据库不存在,系统将自动创建" "message" => "数据库不存在,系统将自动创建"
]; ];
} }
} catch (Exception $e) {
$result = [
"status" => 1,
"message" => "数据库不存在,系统将自动创建"
];
return fail($result);
}
} }
@mysqli_close($conn); @mysqli_close($conn);
} else { } else {
@ -343,7 +352,8 @@ class Index extends BaseInstall
* 安装插件 * 安装插件
* @return true * @return true
*/ */
public function installAddon() { public function installAddon()
{
$root_path = str_replace("\\", DIRECTORY_SEPARATOR, dirname(__FILE__, 4)); $root_path = str_replace("\\", DIRECTORY_SEPARATOR, dirname(__FILE__, 4));
$root_path = str_replace("../", DIRECTORY_SEPARATOR, $root_path); $root_path = str_replace("../", DIRECTORY_SEPARATOR, $root_path);
$addon_path = $root_path . DIRECTORY_SEPARATOR . 'addon'; $addon_path = $root_path . DIRECTORY_SEPARATOR . 'addon';

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,6 @@
<meta name="renderer" content="webkit" /> <meta name="renderer" content="webkit" />
<meta http-equiv="X-UA-COMPATIBLE" content="IE=edge,chrome=1" /> <meta http-equiv="X-UA-COMPATIBLE" content="IE=edge,chrome=1" />
<title>安装程序 - {$install_config['website_name']}</title> <title>安装程序 - {$install_config['website_name']}</title>
<!-- <script src="INSTALL_JS/jquery-2.2.js"></script>-->
<link rel="icon" type="image/x-icon" href="INSTALL_IMG/shop_bitbug_favicon.ico" /> <link rel="icon" type="image/x-icon" href="INSTALL_IMG/shop_bitbug_favicon.ico" />
<link rel="stylesheet" type="text/css" href="INSTALL_CSS/style.css" /> <link rel="stylesheet" type="text/css" href="INSTALL_CSS/style.css" />
<link rel="stylesheet" type="text/css" href="INSTALL_CSS/layui.css" /> <link rel="stylesheet" type="text/css" href="INSTALL_CSS/layui.css" />

View File

@ -165,7 +165,7 @@
{/block} {/block}
{block name='script'} {block name='script'}
<script language="javascript" type="text/javascript"> <script type="text/javascript">
ControlContent(2); ControlContent(2);
var is_existdb = 1;//数据库是否存在 var is_existdb = 1;//数据库是否存在
var message = '数据库账号或密码不能为空'; var message = '数据库账号或密码不能为空';

View File

@ -30,10 +30,12 @@
.pop-link-wrap .link-text:nth-child(2) a{ .pop-link-wrap .link-text:nth-child(2) a{
color: var(--base-color); color: var(--base-color);
} }
.pop-link-wrap .link-btn{
margin-top: 40px;
}
.pop-link-wrap button{ .pop-link-wrap button{
margin-top: 40px; width: 160px;
width: 250px;
height: 40px; height: 40px;
background: var(--base-color); background: var(--base-color);
color: #fff !important; color: #fff !important;
@ -97,6 +99,11 @@
<script> <script>
ControlContent(4); ControlContent(4);
const visitFn = (type)=>{ const visitFn = (type)=>{
let tips = window.localStorage.getItem('pageToLinkTips')
if(tips){
pageToLink(type)
return false
}
layer.open({ layer.open({
type: 1, // page 层类型 type: 1, // page 层类型
area: ['400px', '230px'], area: ['400px', '230px'],
@ -108,20 +115,30 @@
<div class="pop-link-wrap"> <div class="pop-link-wrap">
<p class="link-text">首次运行,请配置伪静态,才能正常使用。</p> <p class="link-text">首次运行,请配置伪静态,才能正常使用。</p>
<p class="link-text">伪静态如何配置请<a href="https://www.kancloud.cn/niushop/niucloud-admin-app/3199831" class="other-links-text" target="_blank">参考手册</a></p> <p class="link-text">伪静态如何配置请<a href="https://www.kancloud.cn/niushop/niucloud-admin-app/3199831" class="other-links-text" target="_blank">参考手册</a></p>
<p class="link-btn">
<button onclick="pageToLink('${type}')" class="layui-btn visit-btn layui-border">确定</button> <button onclick="pageToLink('${type}')" class="layui-btn visit-btn layui-border">确定</button>
<button onclick="pageToLink('${type}', ${true})" class="layui-btn visit-btn layui-border">已配置,不需要在提示</button>
</p>
</div> </div>
` `
}); });
} }
// 页面跳转 // 页面跳转
function pageToLink(type){ function pageToLink(type,flag = false){
if(type == 'admin') if(flag){
window.localStorage.setItem('pageToLinkTips', true)
}
if(type == 'admin'){
layer.closeAll()
window.open('{$root_url}/admin/login') window.open('{$root_url}/admin/login')
else if(type == 'web') }else if(type == 'web'){
layer.closeAll()
window.open('{$root_url}/web/') window.open('{$root_url}/web/')
else if(type == 'wap') }else if(type == 'wap'){
layer.closeAll()
window.open('{$root_url}/wap/') window.open('{$root_url}/wap/')
} }
}
</script> </script>
{/block} {/block}

View File

@ -9,23 +9,19 @@
// | Author: Niucloud Team // | Author: Niucloud Team
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
namespace app\job\sys; namespace app\job\member;
use app\service\core\addon\CoreAddonInstallService; use app\service\core\member\CoreMemberService;
use core\base\BaseJob; use core\base\BaseJob;
/** /**
* 队列异步执行插件安装任务 * 队列设置会员会员码
*/ */
class AddonInstall extends BaseJob class SetMemberNoJob extends BaseJob
{ {
public function doJob($addon, $task) public function doJob($member_id)
{ {
(new CoreAddonInstallService($addon))->executeTask($task); CoreMemberService::setMemberNo($member_id);
} return true;
public function failed($data)
{
} }
} }

View File

@ -28,7 +28,7 @@ return [
'DOWNLOAD_FAIL' => 'download fail', 'DOWNLOAD_FAIL' => 'download fail',
'SET_SUCCESS' => 'set success', 'SET_SUCCESS' => 'set success',
'AGREEMENT_TYPE_NOT_EXIST' => 'agreement type is not exit', 'AGREEMENT_TYPE_NOT_EXIST' => 'agreement type is not exit',
'FIELD_NOT_FOUND' => 'cloumn is not exit', 'FIELD_NOT_FOUND' => 'column is not exit',
'REFRESH_SUCCESS' => 'refresh success', 'REFRESH_SUCCESS' => 'refresh success',
'CAPTCHA_ERROR' => 'captcha fail', 'CAPTCHA_ERROR' => 'captcha fail',

View File

@ -35,14 +35,6 @@ return [
'status_on' => 'on', 'status_on' => 'on',
'status_off' => 'off' 'status_off' => 'off'
], ],
// 站点
'dict_site' => [
//站点类型
'type_cms' => 'cms',
'status_on' => 'on',
'status_experience' => 'experience',
'status_expire' => 'expire'
],
'dict_notice' => [ 'dict_notice' => [
'type_sms' => 'sms', 'type_sms' => 'sms',
'type_wechat' => 'wechat', 'type_wechat' => 'wechat',

View File

@ -91,7 +91,7 @@ return [
'USER_NOT_EXIST' => '用户不存在', 'USER_NOT_EXIST' => '用户不存在',
'NO_SITE_USER_ROLE' => '用户不存在关联权限', 'NO_SITE_USER_ROLE' => '用户不存在关联权限',
'ADMIN_NOT_ALLOW_EDIT_ROLE' => '超级管理员不允许改动权限', 'ADMIN_NOT_ALLOW_EDIT_ROLE' => '超级管理员不允许改动权限',
'USERNAME_REPEAT' => '用户名重复', 'USERNAME_REPEAT' => '账号重复',
'SITE_USER_EXIST' => '该用户已存在', 'SITE_USER_EXIST' => '该用户已存在',
//角色管理 //角色管理
@ -110,7 +110,7 @@ return [
'OSS_FILE_URL_NOT_EXIST' => '远程资源文件地址不能为空', 'OSS_FILE_URL_NOT_EXIST' => '远程资源文件地址不能为空',
'BASE_IMAGE_FILE_NOT_EXIST' => 'base图片资源不能为空', 'BASE_IMAGE_FILE_NOT_EXIST' => 'base图片资源不能为空',
'UPLOAD_TYPE_NOT_SUPPORT' => '不支持的上传类型', 'UPLOAD_TYPE_NOT_SUPPORT' => '不支持的上传类型',
'FILE_ERROE' => '无效的资源', 'FILE_ERROR' => '无效的资源',
'UPLOAD_STORAGE_TYPE_ALL_CLOSE' => '至少要有一个启用的存储方式', 'UPLOAD_STORAGE_TYPE_ALL_CLOSE' => '至少要有一个启用的存储方式',
'STORAGE_NOT_HAS_HTTP_OR_HTTPS' => '空间域名请补全http://或https://', 'STORAGE_NOT_HAS_HTTP_OR_HTTPS' => '空间域名请补全http://或https://',
@ -137,6 +137,7 @@ return [
'ACCOUNT_OR_PASSWORD_ERROR' => '账号或密码错误', 'ACCOUNT_OR_PASSWORD_ERROR' => '账号或密码错误',
'MEMBER_LOCK' => '账号被锁定', 'MEMBER_LOCK' => '账号被锁定',
'MEMBER_NOT_EXIST' => '账号不存在', 'MEMBER_NOT_EXIST' => '账号不存在',
'MEMBER_OPENID_EXIST' => 'openid已存在',
'MEMBER_LOGOUT' => '账号退出', 'MEMBER_LOGOUT' => '账号退出',
'MEMBER_TYPE_NOT_EXIST' => '账户类型不存在', 'MEMBER_TYPE_NOT_EXIST' => '账户类型不存在',
'MEMBER_IS_EXIST' => '账号已存在', 'MEMBER_IS_EXIST' => '账号已存在',
@ -277,7 +278,9 @@ return [
'CONTINUE_SIGN' => '连签', 'CONTINUE_SIGN' => '连签',
'DAYS' => '天!', 'DAYS' => '天!',
'SIGN_SUCCESS' => '签到成功', 'SIGN_SUCCESS' => '签到成功',
'SIGN_AWARD' => '签到奖励',
'GET_AWARD' => '恭喜您获得以下奖励', 'GET_AWARD' => '恭喜您获得以下奖励',
'WILL_GET_AWARD' => '您将获得以下奖励',
//导出相关 //导出相关
'EXPORT_SUCCESS' => '导出成功', 'EXPORT_SUCCESS' => '导出成功',
@ -290,5 +293,7 @@ return [
'WECHAT_OPLATFORM_NOT_EXIST' => '未配置微信开放平台', 'WECHAT_OPLATFORM_NOT_EXIST' => '未配置微信开放平台',
'WEAPP_EXIST' => '该小程序已经授权给其他站点', 'WEAPP_EXIST' => '该小程序已经授权给其他站点',
'WECHAT_EXIST' => '该公众号已经授权给其他站点', 'WECHAT_EXIST' => '该公众号已经授权给其他站点',
'PLEASE_ADD_FIRST_SITE_GROUP' => '请先添加站点套餐' 'PLEASE_ADD_FIRST_SITE_GROUP' => '请先添加站点套餐',
'PRINTER_NOT_EXIST' => '打印机不存在'
]; ];

View File

@ -38,18 +38,6 @@ return [
'status_off' => '停用' 'status_off' => '停用'
], ],
// 站点 // 站点
'dict_site' => [
//站点类型
'type_cms' => 'cms',
'status_on' => '正常',
'status_experience' => '体验期',
'status_expire' => '已到期',
'status_close' => '已停止',
'pay' => '支付',
'refund' => '退款',
'transfer' => '转账',
],
// 站点
'dict_site_index' => [ 'dict_site_index' => [
//站点类型 //站点类型
'system' => '框架首页', 'system' => '框架首页',
@ -232,6 +220,7 @@ return [
'member_my_level' => '会员等级', 'member_my_level' => '会员等级',
'member_my_sign_in' => '我的签到', 'member_my_sign_in' => '我的签到',
'member_verify_index' => '核销台', 'member_verify_index' => '核销台',
'member_contact' => '客服',
'diy_page' => '自定义页面', 'diy_page' => '自定义页面',
'diy_link' => '自定义链接', 'diy_link' => '自定义链接',
@ -379,4 +368,8 @@ return [
'status_not_sign' => '未签到', 'status_not_sign' => '未签到',
'status_signed' => '已签到' 'status_signed' => '已签到'
], ],
// 打印机品牌
'dict_printer' => [
'yilianyun' => '易联云打印机'
]
]; ];

View File

@ -30,11 +30,11 @@ return [
'limit_between' => 'limit必须是正整数并且不能超过120', 'limit_between' => 'limit必须是正整数并且不能超过120',
], ],
'validate_user' => [ 'validate_user' => [
'username_require' => '用户名必须填写', 'username_require' => '账号必须填写',
'username_unique' => '用户名必须是惟一的', 'username_unique' => '账号必须是唯一的',
'username_max' => '用户名最多不能超过15个字符', 'username_max' => '账号最多不能超过15个字符',
'real_name_require' => '实际姓名必须填写', 'real_name_require' => '实际姓名必须填写',
'password_require' => '用户密码必须填写', 'password_require' => '账号密码必须填写',
], ],
//站点 //站点
'validate_site' => [ 'validate_site' => [

View File

@ -9,14 +9,14 @@
// | Author: Niucloud Team // | Author: Niucloud Team
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
namespace app\listener\member; namespace app\listener\member_export;
use app\model\member\Member; use app\model\member\Member;
/** /**
* 会员导出数据源查询 * 会员导出数据源查询
* Class MemberExportTypeListener * Class MemberExportDataListener
* @package app\listener\member * @package app\listener\member_export
*/ */
class MemberExportDataListener class MemberExportDataListener
{ {
@ -26,7 +26,7 @@ class MemberExportDataListener
$data = []; $data = [];
if ($param['type'] == 'member') { if ($param['type'] == 'member') {
$model = new Member(); $model = new Member();
$field = 'member_id, member_no, username, mobile, nickname, birthday, member_level, point, balance, money, growth, commission, register_channel, status, create_time, last_visit_time'; $field = 'member_id, member_no, mobile, nickname, birthday, member_level, point, balance, money, growth, commission, register_channel, status, create_time, last_visit_time';
//查询导出数据 //查询导出数据
$search_model = $model->withSearch(['keyword','register_type', 'create_time', 'is_del', 'member_label', 'register_channel'], $param['where']) $search_model = $model->withSearch(['keyword','register_type', 'create_time', 'is_del', 'member_label', 'register_channel'], $param['where'])
->with(['memberLevelNameBind'])->field($field)->append(['register_channel_name', 'sex_name', 'status_name']); ->with(['memberLevelNameBind'])->field($field)->append(['register_channel_name', 'sex_name', 'status_name']);
@ -36,10 +36,9 @@ class MemberExportDataListener
$data = $search_model->select()->toArray(); $data = $search_model->select()->toArray();
} }
foreach ($data as $key => $value) { foreach ($data as $key => $value) {
$data[$key]['username'] = !empty($value['username']) ? $value['username'] : '-';
$data[$key]['mobile'] = $value['mobile']."\t"; $data[$key]['mobile'] = $value['mobile']."\t";
$data[$key]['create_time'] = !empty($value['create_time']) ? $value['create_time'] : '0000-00-00 00:00:00'; $data[$key]['create_time'] = !empty($value['create_time']) ? $value['create_time'] : '';
$data[$key]['last_visit_time'] = !empty($value['last_visit_time']) ? $value['last_visit_time'] : '0000-00-00 00:00:00'; $data[$key]['last_visit_time'] = !empty($value['last_visit_time']) ? $value['last_visit_time'] : '';
} }
} }
return $data; return $data;

View File

@ -9,7 +9,7 @@
// | Author: Niucloud Team // | Author: Niucloud Team
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
namespace app\listener\member; namespace app\listener\member_export;
/** /**
* 会员导出数据类型查询 * 会员导出数据类型查询

View File

@ -1,30 +0,0 @@
<?php
// +----------------------------------------------------------------------
// | Niucloud-admin 企业快速开发的多应用管理平台
// +----------------------------------------------------------------------
// | 官方网址https://www.niucloud.com
// +----------------------------------------------------------------------
// | niucloud团队 版权所有 开源版本可自由商用
// +----------------------------------------------------------------------
// | Author: Niucloud Team
// +----------------------------------------------------------------------
namespace app\listener\system;
/**
* 平台首页加载事件
* Class AdminIndexListenerIndex
* @package app\listener\system
*/
class AdminIndexListener
{
public function handle()
{
return [
[
"name" => get_lang("dict_admin_index.system"),
"view_path" => "index/index"
]
];
}
}

View File

@ -38,7 +38,7 @@ class Poster
$headimg = $member_info[ 'headimg' ]; $headimg = $member_info[ 'headimg' ];
if (empty($headimg)) { if (empty($headimg)) {
$headimg = 'static/resource/images/default_headimg.jpg'; $headimg = 'static/resource/images/default_headimg.png';
} }
$return_data = [ $return_data = [
'nickname' => $nickname, 'nickname' => $nickname,

View File

@ -77,7 +77,7 @@ class Addon extends BaseModel
*/ */
public function searchTitleAttr($query, $value, $data) public function searchTitleAttr($query, $value, $data)
{ {
if ($value) { if ($value != '') {
$query->whereLike('title', '%' . $value . '%'); $query->whereLike('title', '%' . $value . '%');
} }
} }

View File

@ -12,9 +12,6 @@
namespace app\model\dict; namespace app\model\dict;
use core\base\BaseModel; use core\base\BaseModel;
use think\model\concern\SoftDelete;
use think\model\relation\HasMany;
use think\model\relation\HasOne;
/** /**
* 数据字典模型 * 数据字典模型
@ -24,8 +21,6 @@ use think\model\relation\HasOne;
class Dict extends BaseModel class Dict extends BaseModel
{ {
/** /**
* 数据表主键 * 数据表主键
* @var string * @var string
@ -54,7 +49,7 @@ class Dict extends BaseModel
*/ */
public function searchNameAttr($query, $value, $data) public function searchNameAttr($query, $value, $data)
{ {
if ($value) { if ($value != '') {
$query->where("name", $value); $query->where("name", $value);
} }
} }
@ -66,12 +61,9 @@ class Dict extends BaseModel
*/ */
public function searchKeyAttr($query, $value, $data) public function searchKeyAttr($query, $value, $data)
{ {
if ($value) { if ($value != '') {
$query->where("key", $value); $query->where("key", $value);
} }
} }
} }

View File

@ -174,8 +174,8 @@ class Diy extends BaseModel
*/ */
public function searchTitleAttr($query, $value, $data) public function searchTitleAttr($query, $value, $data)
{ {
if ($value) { if ($value != '') {
$query->where("title|page_title", 'like', '%' . $value . '%'); $query->where("title|page_title", 'like', '%' . $this->handelSpecialCharacter($value) . '%');
} }
} }

View File

@ -55,7 +55,7 @@ class DiyRoute extends BaseModel
*/ */
public function searchTitleAttr($query, $value, $data) public function searchTitleAttr($query, $value, $data)
{ {
if ($value) { if ($value != '') {
$query->where("title", 'like', '%' . $value . '%'); $query->where("title", 'like', '%' . $value . '%');
} }
} }

View File

@ -44,7 +44,7 @@ class GenerateTable extends BaseModel
*/ */
public function searchTableNameAttr($query, $value, $data) public function searchTableNameAttr($query, $value, $data)
{ {
if ($value) { if ($value != '') {
$query->where('table_name', 'like', '%' . $value . '%'); $query->where('table_name', 'like', '%' . $value . '%');
} }
} }
@ -57,7 +57,7 @@ class GenerateTable extends BaseModel
*/ */
public function searchTableContentAttr($query, $value, $data) public function searchTableContentAttr($query, $value, $data)
{ {
if ($value) { if ($value != '') {
$query->where('table_content', 'like', '%' . $value . '%'); $query->where('table_content', 'like', '%' . $value . '%');
} }
} }
@ -70,7 +70,7 @@ class GenerateTable extends BaseModel
*/ */
public function searchAddonNameAttr($query, $value, $data) public function searchAddonNameAttr($query, $value, $data)
{ {
if ($value) { if ($value != '') {
if($value == 2) if($value == 2)
{ {
$query->where('addon_name','=',''); $query->where('addon_name','=','');

View File

@ -161,8 +161,8 @@ class Member extends BaseModel
*/ */
public function searchKeywordAttr($query, $value, $data) public function searchKeywordAttr($query, $value, $data)
{ {
if ($value) { if ($value != '') {
$query->where('member_no|username|nickname|mobile', 'like', '%' . $value . '%'); $query->where('member_no|username|nickname|mobile', 'like', '%' . $this->handelSpecialCharacter($value) . '%');
} }
} }
@ -259,11 +259,13 @@ class Member extends BaseModel
} }
} }
public function memberLevelData() { public function memberLevelData()
{
return $this->hasOne(MemberLevel::class, 'level_id', 'member_level'); return $this->hasOne(MemberLevel::class, 'level_id', 'member_level');
} }
public function memberLevelNameBind() { public function memberLevelNameBind()
{
return $this->hasOne(MemberLevel::class, 'level_id', 'member_level')->bind([ 'member_level_name' => 'level_name' ]); return $this->hasOne(MemberLevel::class, 'level_id', 'member_level')->bind([ 'member_level_name' => 'level_name' ]);
} }
} }

View File

@ -14,6 +14,7 @@ namespace app\model\member;
use app\dict\member\MemberAccountChangeTypeDict; use app\dict\member\MemberAccountChangeTypeDict;
use app\dict\member\MemberAccountTypeDict; use app\dict\member\MemberAccountTypeDict;
use core\base\BaseModel; use core\base\BaseModel;
use think\db\Query;
use think\model\relation\HasOne; use think\model\relation\HasOne;
/** /**
@ -125,6 +126,19 @@ class MemberAccountLog extends BaseModel
} }
} }
/**
* 关键词搜索
* @param $query
* @param $value
* @param $data
*/
public function searchKeywordAttr(Query $query, $value, $data)
{
if ($value != '') {
$query->whereLike('memo', '%'.$value.'%');
}
}
/** /**
* 金额大于 * 金额大于
* @param $query * @param $query

View File

@ -157,7 +157,7 @@ class MemberCashOut extends BaseModel
*/ */
public function searchCashOutNoAttr($query, $value, $data) public function searchCashOutNoAttr($query, $value, $data)
{ {
if ($value) { if ($value != '') {
$query->where('cash_out_no', $value); $query->where('cash_out_no', $value);
} }
} }

View File

@ -62,8 +62,8 @@ class MemberLabel extends BaseModel
*/ */
public function searchLabelNameAttr($query, $value, $data) public function searchLabelNameAttr($query, $value, $data)
{ {
if ($value) { if ($value != '') {
$query->where('label_name', 'like', '%' . $value . '%'); $query->where('label_name', 'like', '%' . $this->handelSpecialCharacter($value) . '%');
} }
} }

View File

@ -11,7 +11,6 @@
namespace app\model\member; namespace app\model\member;
use app\service\core\member\CoreMemberService;
use core\base\BaseModel; use core\base\BaseModel;
/** /**
@ -63,7 +62,7 @@ class MemberLevel extends BaseModel
public function searchLevelNameAttr($query, $value, $data) public function searchLevelNameAttr($query, $value, $data)
{ {
if ($value != '') { if ($value != '') {
$query->where('level_name', 'like', '%'.$value.'%'); $query->where('level_name', 'like', '%' . $this->handelSpecialCharacter($value) . '%');
} }
} }
} }

View File

@ -66,8 +66,8 @@ class Poster extends BaseModel
*/ */
public function searchNameAttr($query, $value, $data) public function searchNameAttr($query, $value, $data)
{ {
if ($value) { if ($value != '') {
$query->where("name", 'like', '%' . $value . '%'); $query->where("name", 'like', '%' . $this->handelSpecialCharacter($value) . '%');
} }
} }

View File

@ -70,7 +70,7 @@ class SysExport extends BaseModel
public function searchExportKeyAttr(Query $query, $value, $data) public function searchExportKeyAttr(Query $query, $value, $data)
{ {
if ($value) { if ($value) {
$query->whereLike('export_key', '%' . $value . '%'); $query->where('export_key', $value);
} }
} }

View File

@ -112,7 +112,7 @@ class SysNoticeLog extends BaseModel
*/ */
public function searchReceiverAttr($query, $value) public function searchReceiverAttr($query, $value)
{ {
if ($value) { if ($value != '') {
$query->where('receiver', $value); $query->where('receiver', $value);
} }
} }

View File

@ -143,7 +143,7 @@ class SysNoticeSmsLog extends BaseModel
*/ */
public function searchMobileAttr($query, $value) public function searchMobileAttr($query, $value)
{ {
if ($value) { if ($value != '') {
$query->where('mobile', $value); $query->where('mobile', $value);
} }
} }

View File

@ -0,0 +1,106 @@
<?php
// +----------------------------------------------------------------------
// | Niucloud-admin 企业快速开发的多应用管理平台
// +----------------------------------------------------------------------
// | 官方网址https://www.niucloud.com
// +----------------------------------------------------------------------
// | niucloud团队 版权所有 开源版本可自由商用
// +----------------------------------------------------------------------
// | Author: Niucloud Team
// +----------------------------------------------------------------------
namespace app\model\sys;
use app\dict\sys\PrinterDict;
use core\base\BaseModel;
/**
* 小票打印机模型
* Class SysPrinter
* @package app\model\sys
*/
class SysPrinter extends BaseModel
{
/**
* 数据表主键
* @var string
*/
protected $pk = 'printer_id';
/**
* 模型名称
* @var string
*/
protected $name = 'sys_printer';
// 设置json类型字段
protected $json = [ 'template_type', 'trigger', 'value' ];
// 设置JSON数据返回数组
protected $jsonAssoc = true;
/**
* 状态字段转化
* @param $value
* @param $data
* @return mixed
*/
public function getBrandNameAttr($value, $data)
{
if (!empty($data[ 'brand' ])) {
return PrinterDict::getBrandName($data[ 'brand' ]) ?? '';
}
return '';
}
/**
* 搜索器:小票打印机
* @param $value
* @param $data
*/
public function searchPrinterIdAttr($query, $value, $data)
{
if ($value) {
$query->where("printer_id", $value);
}
}
/**
* 搜索器:小票打印机设备品牌易联云365飞鹅
* @param $value
* @param $data
*/
public function searchBrandAttr($query, $value, $data)
{
if ($value) {
$query->where("brand", $value);
}
}
/**
* 搜索器:小票打印机打印机名称
* @param $value
* @param $data
*/
public function searchPrinterNameAttr($query, $value, $data)
{
if ($value != '') {
$query->where("printer_name", 'like', '%' . $value . '%');
}
}
/**
* 搜索器:小票打印机状态0关闭1开启
* @param $value
* @param $data
*/
public function searchStatusAttr($query, $value, $data)
{
if ($value !== '') {
$query->where("status", $value);
}
}
}

View File

@ -0,0 +1,94 @@
<?php
// +----------------------------------------------------------------------
// | Niucloud-admin 企业快速开发的多应用管理平台
// +----------------------------------------------------------------------
// | 官方网址https://www.niucloud.com
// +----------------------------------------------------------------------
// | niucloud团队 版权所有 开源版本可自由商用
// +----------------------------------------------------------------------
// | Author: Niucloud Team
// +----------------------------------------------------------------------
namespace app\model\sys;
use app\dict\sys\PrinterDict;
use core\base\BaseModel;
/**
* 小票打印模板模型
* Class SysPrinterTemplate
* @package app\model\sys
*/
class SysPrinterTemplate extends BaseModel
{
/**
* 数据表主键
* @var string
*/
protected $pk = 'template_id';
/**
* 模型名称
* @var string
*/
protected $name = 'sys_printer_template';
// 设置json类型字段
protected $json = [ 'value' ];
// 设置JSON数据返回数组
protected $jsonAssoc = true;
/**
* 状态字段转化
* @param $value
* @param $data
* @return mixed
*/
public function getTemplateTypeNameAttr($value, $data)
{
if (!empty($data[ 'template_type' ])) {
return PrinterDict::getType($data[ 'template_type' ])[ 'title' ] ?? '';
}
return '';
}
/**
* 搜索器:小票打印模板
* @param $value
* @param $data
*/
public function searchTemplateIdAttr($query, $value, $data)
{
if ($value) {
$query->where("template_id", $value);
}
}
/**
* 搜索器:小票打印模板模板类型
* @param $value
* @param $data
*/
public function searchTemplateTypeAttr($query, $value, $data)
{
if ($value) {
$query->where("template_type", $value);
}
}
/**
* 搜索器:小票打印模板模板名称
* @param $value
* @param $data
*/
public function searchTemplateNameAttr($query, $value, $data)
{
if ($value != '') {
$query->where("template_name", 'like', '%' . $value . '%');
}
}
}

View File

@ -38,16 +38,9 @@ class SysRole extends BaseModel
// 设置JSON数据返回数组 // 设置JSON数据返回数组
protected $jsonAssoc = true; protected $jsonAssoc = true;
/**
* 角色状态
* @param $value
* @param $data
* @return string
*/
public function getStatusNameAttr($value, $data) public function getStatusNameAttr($value, $data)
{ {
return RoleStatusDict::getStatus()[ $data[ 'status' ] ] ?? ''; return RoleStatusDict::getStatus()[ $data[ 'status' ] ] ?? '';
} }
} }

View File

@ -14,7 +14,6 @@ namespace app\model\sys;
use app\dict\sys\UserDict; use app\dict\sys\UserDict;
use core\base\BaseModel; use core\base\BaseModel;
use think\model\concern\SoftDelete; use think\model\concern\SoftDelete;
use think\model\relation\HasMany;
/** /**
* 系统用户模型 * 系统用户模型
@ -50,14 +49,13 @@ class SysUser extends BaseModel
protected $json = [ 'role_ids' ]; protected $json = [ 'role_ids' ];
// 设置JSON数据返回数组 // 设置JSON数据返回数组
protected $jsonAssoc = true; protected $jsonAssoc = true;
/** /**
* 定义软删除字段的默认值 * 定义软删除字段的默认值
* @var int * @var int
*/ */
protected $defaultSoftDelete = 0; protected $defaultSoftDelete = 0;
/** /**
* 状态字段转化 * 状态字段转化
* @param $value * @param $value
@ -70,6 +68,7 @@ class SysUser extends BaseModel
return UserDict::getStatus()[ $data[ 'status' ] ] ?? ''; return UserDict::getStatus()[ $data[ 'status' ] ] ?? '';
} }
public function getCreateTimeAttr($value, $data) public function getCreateTimeAttr($value, $data)
{ {
return $data[ 'create_time' ] ? get_date_by_time($data[ 'create_time' ]) : ''; return $data[ 'create_time' ] ? get_date_by_time($data[ 'create_time' ]) : '';
@ -82,8 +81,8 @@ class SysUser extends BaseModel
*/ */
public function searchUsernameAttr($query, $value) public function searchUsernameAttr($query, $value)
{ {
if ($value) { if ($value != '') {
$query->whereLike('username', '%' . $value . '%'); $query->whereLike('username', '%' . $this->handelSpecialCharacter($value) . '%');
} }
} }
@ -95,26 +94,12 @@ class SysUser extends BaseModel
*/ */
public function searchRealnameAttr($query, $value) public function searchRealnameAttr($query, $value)
{ {
if ($value) { if ($value != '') {
$query->whereLike('real_name', '%' . $value . '%'); $query->whereLike('real_name', '%' . $value . '%');
} }
} }
/**
* 角色组筛选
* @param $query
* @param $value
* @return void
*/
public function searchRoleIdsAttr($query, $value)
{
if ($value) {
$query->whereLike('role_ids', '%' . $value . '%');
}
}
/** /**
* 是否删除搜索器 * 是否删除搜索器
* @param $query * @param $query
@ -124,17 +109,6 @@ class SysUser extends BaseModel
$query->where('is_del', 0); $query->where('is_del', 0);
} }
/**
* 状态搜索器
* @param $query
* @param $value
*/
public function searchStatusAttr($query, $value)
{
$query->where('status', $value);
}
/** /**
* 创建时间搜索器 * 创建时间搜索器
* @param $query * @param $query
@ -154,5 +128,22 @@ class SysUser extends BaseModel
} }
} }
/**
* 创建时间搜索器
* @param $query
* @param $value
* @param $data
*/
public function searchLastTimeAttr($query, $value, $data)
{
$start_time = empty($value[ 0 ]) ? 0 : strtotime($value[ 0 ]);
$end_time = empty($value[ 1 ]) ? 0 : strtotime($value[ 1 ]);
if ($start_time > 0 && $end_time > 0) {
$query->whereBetweenTime('sys_user.last_time', $start_time, $end_time);
} else if ($start_time > 0 && $end_time == 0) {
$query->where([ [ 'sys_user.last_time', '>=', $start_time ] ]);
} else if ($start_time == 0 && $end_time > 0) {
$query->where([ [ 'sys_user.last_time', '<=', $end_time ] ]);
}
}
} }

View File

@ -61,7 +61,7 @@ class SysUserLog extends BaseModel
*/ */
public function searchUsernameAttr(Query $query, $value, $data) public function searchUsernameAttr(Query $query, $value, $data)
{ {
if ($value) { if ($value != '') {
$query->whereLike('username', '%' . $value . '%'); $query->whereLike('username', '%' . $value . '%');
} }
} }
@ -87,7 +87,7 @@ class SysUserLog extends BaseModel
*/ */
public function searchUrlAttr(Query $query, $value, $data) public function searchUrlAttr(Query $query, $value, $data)
{ {
if ($value) { if ($value != '') {
$query->whereLike('url', '%' . $value . '%'); $query->whereLike('url', '%' . $value . '%');
} }
} }
@ -100,7 +100,7 @@ class SysUserLog extends BaseModel
*/ */
public function searchIpAttr(Query $query, $value, $data) public function searchIpAttr(Query $query, $value, $data)
{ {
if ($value) { if ($value != '') {
$query->whereLike('ip', '%' . $value . '%'); $query->whereLike('ip', '%' . $value . '%');
} }
} }

View File

@ -11,7 +11,6 @@
namespace app\model\verify; namespace app\model\verify;
use app\dict\verify\VerifyDict;
use app\model\member\Member; use app\model\member\Member;
use core\base\BaseModel; use core\base\BaseModel;

View File

@ -54,8 +54,21 @@ class Verify extends BaseModel
*/ */
public function searchCodeAttr(Query $query, $value, $data) public function searchCodeAttr(Query $query, $value, $data)
{ {
if ($value) { if ($value != '') {
$query->whereLike('code', '%'.$value.'%'); $query->whereLike('code', '%' . $this->handelSpecialCharacter($value) . '%');
}
}
/**
* 关键词搜索
* @param $query
* @param $value
* @param $data
*/
public function searchKeywordAttr(Query $query, $value, $data)
{
if ($value != '') {
$query->whereLike('code|body', '%' . $this->handelSpecialCharacter($value) . '%');
} }
} }

View File

@ -24,7 +24,6 @@ class AppletDownloadService extends BaseAdminService
public function __construct() public function __construct()
{ {
parent::__construct(); parent::__construct();
} }

View File

@ -12,7 +12,6 @@
namespace app\service\admin\auth; namespace app\service\admin\auth;
use app\Request; use app\Request;
use app\service\admin\addon\AddonService;
use app\service\admin\sys\MenuService; use app\service\admin\sys\MenuService;
use app\service\admin\sys\RoleService; use app\service\admin\sys\RoleService;
use app\service\admin\user\UserService; use app\service\admin\user\UserService;
@ -34,7 +33,8 @@ class AuthService extends BaseAdminService
* @return bool * @return bool
* @throws Exception * @throws Exception
*/ */
public function checkRole(Request $request){ public function checkRole(Request $request)
{
$rule = strtolower(trim($request->rule()->getRule())); $rule = strtolower(trim($request->rule()->getRule()));
$method = strtolower(trim($request->method())); $method = strtolower(trim($request->method()));
@ -58,7 +58,8 @@ class AuthService extends BaseAdminService
* 当前授权用户接口权限 * 当前授权用户接口权限
* @return array * @return array
*/ */
public function getAuthApiList(){ public function getAuthApiList()
{
$user_info = ( new UserService() )->getUserCache($this->uid); $user_info = ( new UserService() )->getUserCache($this->uid);
if (empty($user_info)) if (empty($user_info))
return []; return [];
@ -80,7 +81,8 @@ class AuthService extends BaseAdminService
* 当前授权用户菜单权限 * 当前授权用户菜单权限
* @return array * @return array
*/ */
public function getAuthMenuList($status = 'all', int $is_tree = 0, int $is_button = 1){ public function getAuthMenuList($status = 'all', int $is_tree = 0, int $is_button = 1)
{
$user_info = ( new UserService() )->getUserCache($this->uid); $user_info = ( new UserService() )->getUserCache($this->uid);
if (empty($user_info)) if (empty($user_info))
return []; return [];
@ -99,7 +101,8 @@ class AuthService extends BaseAdminService
/** /**
* 获取授权用户信息 * 获取授权用户信息
*/ */
public function getAuthInfo(){ public function getAuthInfo()
{
return ( new UserService() )->getUserCache($this->uid); return ( new UserService() )->getUserCache($this->uid);
} }
@ -108,7 +111,8 @@ class AuthService extends BaseAdminService
* @param array $data * @param array $data
* @return true * @return true
*/ */
public function editAuth(array $data){ public function editAuth(array $data)
{
if (!empty($data[ 'password' ])) { if (!empty($data[ 'password' ])) {
//检测原始密码是否正确 //检测原始密码是否正确
$user = ( new UserService() )->find($this->uid); $user = ( new UserService() )->find($this->uid);
@ -118,41 +122,4 @@ class AuthService extends BaseAdminService
} }
return ( new UserService() )->edit($this->uid, $data); return ( new UserService() )->edit($this->uid, $data);
} }
/**
* 获取当前账号授权的应用列表
* @return array|mixed|string
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getAuthAddonList($data= []){
$user_info = ( new UserService())->getUserCache($this->uid);
if(empty($user_info))
return [];
$is_admin = $user_info['is_admin'];//是否是超级管理员组
if($is_admin){//查询全部启用的权限
if(empty($data['type'])){
return (new AddonService())->getInstallAddonList($data);
}else{
return (new AddonService())->getInstallStarAddonList($data);
}
}else{
$user_role_ids = $user_info['role_ids'];
$role_service = new RoleService();
$addon_keys = $role_service->getAddonKeysByRoleIds($user_role_ids ?? []);
if(empty($data['type'])){
return (new AddonService())->getAddonListByKeys($addon_keys, $data);
}else{
return (new AddonService())->getStatAddonLists($addon_keys, $data);
}
}
}
/**
* 应用插件加星
*/
public function setAddonStat($key){
return (new AddonService())->setAddonStat($key);
}
} }

View File

@ -37,7 +37,7 @@ class DiyConfigService extends BaseAdminService
$apps = ( new CoreAddonService() )->getList([ [ 'type', '=', 'app' ] ]); $apps = ( new CoreAddonService() )->getList([ [ 'type', '=', 'app' ] ]);
// 单应用,排除 系统 底部导航设置 // 单应用,排除 系统 底部导航设置
if (count($apps) == 1) { if (count($list) > 1 && count($apps) == 1) {
foreach ($list as $k => $v) { foreach ($list as $k => $v) {
if ($v[ 'key' ] = 'app') { if ($v[ 'key' ] = 'app') {
unset($list[ $k ]); unset($list[ $k ]);

View File

@ -50,7 +50,7 @@ class DiyRouteService extends BaseAdminService
if (!empty($cv[ 'url' ])) { if (!empty($cv[ 'url' ])) {
$is_add = true; $is_add = true;
if (!empty($where[ 'title' ]) && !str_contains($cv[ 'title' ], $where[ 'title' ])) { if (isset($where[ 'title' ]) && $where[ 'title' ] !='' && !str_contains($cv[ 'title' ], $where[ 'title' ])) {
$is_add = false; $is_add = false;
} }

View File

@ -11,7 +11,6 @@
namespace app\service\admin\generator; namespace app\service\admin\generator;
use app\model\addon\Addon;
use app\model\generator\GenerateColumn; use app\model\generator\GenerateColumn;
use app\model\generator\GenerateTable; use app\model\generator\GenerateTable;
use core\base\BaseAdminService; use core\base\BaseAdminService;
@ -23,7 +22,6 @@ use think\db\exception\ModelNotFoundException;
use think\facade\Db; use think\facade\Db;
use think\helper\Str; use think\helper\Str;
use think\Model; use think\Model;
use think\model\relation\HasOne;
/** /**

View File

@ -11,9 +11,6 @@
namespace app\service\admin\generator\core; namespace app\service\admin\generator\core;
use app\dict\sys\MenuDict;
use app\model\sys\SysMenu;
use think\facade\Cache;
use think\helper\Str; use think\helper\Str;
/** /**

View File

@ -307,6 +307,7 @@ class ValidateGenerator extends BaseGenerator
$dir .= $this->moduleName . '/'; $dir .= $this->moduleName . '/';
return $dir; return $dir;
} }
/** /**
* 生成的文件名 * 生成的文件名
* @return string * @return string
@ -316,5 +317,4 @@ class ValidateGenerator extends BaseGenerator
return $this->getUCaseClassName() . '.php'; return $this->getUCaseClassName() . '.php';
} }
} }

View File

@ -15,7 +15,6 @@ namespace app\service\admin\generator\core;
use app\service\core\menu\CoreMenuService;
use think\helper\Str; use think\helper\Str;
/** /**

View File

@ -38,7 +38,7 @@ class {UCASE_NAME}Service extends BaseAdminService
$field = '{FIELDS}'; $field = '{FIELDS}';
$order = '{ORDER}'; $order = '{ORDER}';
$search_model = {SEARCH_MODEL}; $search_model = {SEARCH_MODEL}
$list = $this->pageQuery($search_model); $list = $this->pageQuery($search_model);
return $list; return $list;
} }
@ -52,7 +52,7 @@ class {UCASE_NAME}Service extends BaseAdminService
{ {
$field = '{FIELDS}'; $field = '{FIELDS}';
$info = {INFO_SEARCH_MODEL}; $info = {INFO_SEARCH_MODEL}
return $info; return $info;
} }

View File

@ -42,8 +42,8 @@ class MemberAccountService extends BaseAdminService
$field = 'member_account_log.id, member_account_log.member_id, member_account_log.account_type, member_account_log.account_data,member_account_log.account_sum, member_account_log.from_type, member_account_log.related_id, member_account_log.create_time, member_account_log.memo'; $field = 'member_account_log.id, member_account_log.member_id, member_account_log.account_type, member_account_log.account_data,member_account_log.account_sum, member_account_log.from_type, member_account_log.related_id, member_account_log.create_time, member_account_log.memo';
$member_where = []; $member_where = [];
if (!empty($where[ 'keywords' ])) { if (isset($where[ 'keywords' ]) && $where[ 'keywords' ] != '') {
$member_where[] = [ "member.member_no|member.nickname|member.mobile", 'like', '%' . $where[ 'keywords' ] . '%' ]; $member_where[] = [ "member.member_no|member.nickname|member.mobile", 'like', '%' . $this->model->handelSpecialCharacter($where[ 'keywords' ]) . '%' ];
} }
$search_model = $this->model->withSearch([ 'join_member_id' => 'member_id', 'account_type', 'from_type', 'join_create_time' => 'create_time' ], $where) $search_model = $this->model->withSearch([ 'join_member_id' => 'member_id', 'account_type', 'from_type', 'join_create_time' => 'create_time' ], $where)
->withJoin( ->withJoin(

View File

@ -16,7 +16,6 @@ use app\dict\member\MemberRegisterTypeDict;
use app\model\member\Member; use app\model\member\Member;
use app\service\admin\sys\ExportService; use app\service\admin\sys\ExportService;
use app\service\core\member\CoreMemberService; use app\service\core\member\CoreMemberService;
use app\service\core\sys\CoreExportService;
use core\base\BaseAdminService; use core\base\BaseAdminService;
use core\dict\DictLoader; use core\dict\DictLoader;
use core\exception\AdminException; use core\exception\AdminException;

View File

@ -36,9 +36,9 @@ class MemberSignService extends BaseAdminService
public function getPage(array $where = []) public function getPage(array $where = [])
{ {
$member_where = []; $member_where = [];
if(!empty($where['keywords'])) if(isset($where['keywords']) && $where['keywords'] != '')
{ {
$member_where = [['member.member_no|member.nickname|member.mobile', 'like', '%'.$where['keywords'].'%']]; $member_where = [['member.member_no|member.nickname|member.mobile', 'like', '%' . $this->model->handelSpecialCharacter($where['keywords']) . '%']];
} }
$field = 'sign_id, member_sign.member_id, days, day_award, continue_award, continue_tag, member_sign.create_time, is_sign'; $field = 'sign_id, member_sign.member_id, days, day_award, continue_award, continue_tag, member_sign.create_time, is_sign';
$search_model = $this->model->withSearch(['create_time'],$where)->where($member_where)->withJoin(["member" => ['member_no', 'mobile', 'nickname', 'headimg']])->field($field)->append(['is_sign_name'])->order('member_sign.create_time desc'); $search_model = $this->model->withSearch(['create_time'],$where)->where($member_where)->withJoin(["member" => ['member_no', 'mobile', 'nickname', 'headimg']])->field($field)->append(['is_sign_name'])->order('member_sign.create_time desc');

View File

@ -115,7 +115,7 @@ class SmsService extends BaseAdminService
{ {
$config['default'] = $sms_type; $config['default'] = $sms_type;
}else{ }else{
$config['default'] = ''; $config['default'] = $config['default'] == $sms_type ? '' : $config['default'];
} }
foreach ($sms_type_list[$sms_type]['params'] as $k_param => $v_param) foreach ($sms_type_list[$sms_type]['params'] as $k_param => $v_param)
{ {

View File

@ -154,6 +154,8 @@ class PayChannelService extends BaseAdminService
'collection_desc' => $data[ 'collection_desc' ] ?? '',// 必填-转账说明 'collection_desc' => $data[ 'collection_desc' ] ?? '',// 必填-转账说明
]; ];
break; break;
default:
$config = $data;
} }
return $config; return $config;
} }

View File

@ -12,10 +12,8 @@
namespace app\service\admin\pay; namespace app\service\admin\pay;
use app\dict\pay\PayDict; use app\dict\pay\PayDict;
use app\model\pay\Pay;
use app\model\pay\Refund; use app\model\pay\Refund;
use app\service\core\pay\CoreRefundService; use app\service\core\pay\CoreRefundService;
use app\service\core\paytype\CoreOfflineService;
use core\base\BaseAdminService; use core\base\BaseAdminService;
/** /**

View File

@ -206,8 +206,7 @@ class AttachmentService extends BaseAdminService
*/ */
public function getCategoryPage(array $data) public function getCategoryPage(array $data)
{ {
$where = array ( $where = array ();
);
if (!empty($data[ 'type' ])) { if (!empty($data[ 'type' ])) {
$where[] = [ 'type', '=', $data[ 'type' ] ]; $where[] = [ 'type', '=', $data[ 'type' ] ];
} }
@ -231,8 +230,8 @@ class AttachmentService extends BaseAdminService
if (!empty($data[ 'type' ])) { if (!empty($data[ 'type' ])) {
$where[] = [ 'type', '=', $data[ 'type' ] ]; $where[] = [ 'type', '=', $data[ 'type' ] ];
} }
if (!empty($data[ 'name' ])) { if (isset($data[ 'name' ]) && $data[ 'name' ] != '') {
$where[] = [ 'name', 'like', '%' . $data[ 'name' ] . '%' ]; $where[] = [ 'name', 'like', '%' . $this->model->handelSpecialCharacter($data[ 'name' ]) . '%' ];
} }
return SysAttachmentCategory::where($where)->field('id,name,type')->order('id desc')->select()->toArray(); return SysAttachmentCategory::where($where)->field('id,name,type')->order('id desc')->select()->toArray();
} }
@ -247,7 +246,7 @@ class AttachmentService extends BaseAdminService
$icon_list = IconDict::getIcon(); $icon_list = IconDict::getIcon();
foreach ($icon_list as $k => $v) { foreach ($icon_list as $k => $v) {
unset($icon_list[ $k ][ 'glyphs' ]); unset($icon_list[ $k ][ 'glyphs' ]);
if (!empty($data[ 'name' ]) && !str_contains($v['name'], $data['name'])) { if (isset($data[ 'name' ]) && $data[ 'name' ] !='' && !str_contains($v['name'], $data['name'])) {
unset($icon_list[ $k ]); unset($icon_list[ $k ]);
} }
} }

View File

@ -102,11 +102,13 @@ class ConfigService extends BaseAdminService
{ {
return $this->core_config_service->setConfig('WEB_SITE_INFO', $data); return $this->core_config_service->setConfig('WEB_SITE_INFO', $data);
} }
/** /**
* 获取前端域名 * 获取前端域名
* @return array|string[] * @return array|string[]
*/ */
public function getSceneDomain(){ public function getSceneDomain()
{
return ( new CoreSysConfigService() )->getSceneDomain(); return ( new CoreSysConfigService() )->getSceneDomain();
} }
@ -117,8 +119,7 @@ class ConfigService extends BaseAdminService
public function getService() public function getService()
{ {
$info = ( new CoreConfigService() )->getConfig('SERVICE_INFO'); $info = ( new CoreConfigService() )->getConfig('SERVICE_INFO');
if(empty($info)) if (empty($info)) {
{
$info = []; $info = [];
$info[ 'value' ] = [ $info[ 'value' ] = [
'wechat_code' => '', 'wechat_code' => '',
@ -181,215 +182,6 @@ class ConfigService extends BaseAdminService
return $info[ 'value' ]; return $info[ 'value' ];
} }
/**
* 获取站点主页配置
* @return mixed|string[]
*/
public function getSiteIndexConfig()
{
$config = (new CoreConfigService())->getConfig("site_index");
if(empty($config))
{
$config['value'] = [
'view_path' => 'index/site_index'
];
}else{
$result = event("SiteIndex");
$index_list = [];
foreach ($result as $v)
{
$index_list = empty($index_list) ? $v: array_merge($index_list, $v);
}
$tag = 0;
$view_path = $config['value']['view_path'];
foreach ($index_list as $v)
{
$v_view_path = $v['view_path'] ?? '';
if($view_path == $v_view_path)
{
$tag = 1;
break;
}
}
if($tag == 0)
{
$config['value'] = [
'view_path' => 'index/site_index'
];
}
}
return $config['value']['view_path'];
}
/**
* 站点主页配置
* @param $data
* @return true
*/
public function setSiteIndexConfig($data)
{
$config = [
'view_path' => $data['view_path'] ,
];
//检测是否路劲一个异常
$index_list = $this->getSiteIndexList();
$check_tag = 0;
foreach($index_list as $v)
{
if($v['view_path'] == $data['view_path'])
{
$check_tag = 1;
}
}
if($check_tag == 0) throw new AdminException('SITE_INDEX_VIEW_PATH_NOT_EXIST');
(new CoreConfigService())->setConfig("site_index", $config);
return true;
}
/**
* 获取站点配置的首页列表
* @return array
*/
public function getSiteIndexList()
{
$result = event("SiteIndex");
$index_list = [];
foreach ($result as $v)
{
$index_list = empty($index_list) ? $v: array_merge($index_list, $v);
}
$view_path = $this->getSiteIndexConfig();
foreach ($index_list as $k => $v)
{
$v_view_path = $v['view_path'] ?? '';
$index_list[$k]['is_use'] = ($v_view_path == $view_path) ? 1: 0;
}
return $index_list;
}
/**
* 设置站点快捷菜单
* @param $data
* @return bool
*/
public function setShortcutMenu($data)
{
(new CoreConfigService())->setConfig('shortcut_menu', $data);
return true;
}
/**
* 获取站点快捷菜单
* @return array|mixed
*/
public function getShortcutMenu()
{
$config = (new CoreConfigService())->getConfig('shortcut_menu');
$menu = $config['value'] ?? [];
if(!empty($menu)){
$menu_service = new MenuService();
foreach($menu as $k => &$v){
$menu_key = $v['menu_key'] ?? '';
if($menu_key != ''){
$item_router_path = $menu_service->getFullRouterPath($menu_key);
if(empty($item_router_path)){
unset($v[$k]);
}else{
$v['router_path'] = $item_router_path;
}
}
}
}
return $menu;
}
/**
* 获取平台主页配置
* @return mixed|string[]
*/
public function getAdminIndexConfig()
{
$config = (new CoreConfigService())->getConfig("admin_index");
if(empty($config))
{
$config['value'] = [
'view_path' => 'index/index'
];
}else{
$result = event("AdminIndex");
$index_list = [];
foreach ($result as $v)
{
$index_list = empty($index_list) ? $v: array_merge($index_list, $v);
}
$tag = 0;
$view_path = $config['value']['view_path'];
foreach ($index_list as $v)
{
$v_view_path = $v['view_path'] ?? '';
if($view_path == $v_view_path)
{
$tag = 1;
break;
}
}
if($tag == 0)
{
$config['value'] = [
'view_path' => 'index/index'
];
}
}
return $config['value']['view_path'];
}
/**
* 站点主页配置
* @param $data
* @return true
*/
public function setAdminIndexConfig($data)
{
$config = [
'view_path' => $data['view_path'] ,
];
//检测是否路劲一个异常
$index_list = $this->getAdminIndexList();
$check_tag = 0;
foreach($index_list as $v)
{
if($v['view_path'] == $data['view_path'])
{
$check_tag = 1;
}
}
if($check_tag == 0) throw new AdminException('ADMIN_INDEX_VIEW_PATH_NOT_EXIST');
(new CoreConfigService())->setConfig("admin_index", $config);
return true;
}
/**
* 获取站点配置的首页列表
* @return array
*/
public function getAdminIndexList()
{
$result = event("AdminIndex");
$index_list = [];
foreach ($result as $v)
{
$index_list = empty($index_list) ? $v: array_merge($index_list, $v);
}
$view_path = $this->getAdminIndexConfig();
foreach ($index_list as $k => $v)
{
$v_view_path = $v['view_path'] ?? '';
$index_list[$k]['is_use'] = ($v_view_path == $view_path) ? 1: 0;
}
return $index_list;
}
/** /**
* 获取手机端首页列表 * 获取手机端首页列表
* @param $data * @param $data
@ -404,7 +196,8 @@ class ConfigService extends BaseAdminService
* 获取开发者key * 获取开发者key
* @return array * @return array
*/ */
public function getDeveloperToken() { public function getDeveloperToken()
{
return ( new CoreConfigService() )->getConfigValue("DEVELOPER_TOKEN"); return ( new CoreConfigService() )->getConfigValue("DEVELOPER_TOKEN");
} }
@ -413,7 +206,8 @@ class ConfigService extends BaseAdminService
* @param array $data * @param array $data
* @return array * @return array
*/ */
public function setDeveloperToken(array $data) { public function setDeveloperToken(array $data)
{
return ( new CoreConfigService() )->setConfig("DEVELOPER_TOKEN", $data); return ( new CoreConfigService() )->setConfig("DEVELOPER_TOKEN", $data);
} }
} }

Some files were not shown because too many files have changed in this diff Show More