mirror of
https://gitee.com/niucloud-team/niucloud.git
synced 2025-12-10 17:22:47 +00:00
fix
This commit is contained in:
parent
12369907f6
commit
efb93e0e80
@ -1 +1 @@
|
||||
APP_DEBUG = true
[APP]
DEFAULT_TIMEZONE = Asia/Shanghai
AUTH_KEY = {auth_key}
[DATABASE]
TYPE = mysql
HOSTNAME = {dbhost}
DATABASE = {dbname}
USERNAME = {dbuser}
PASSWORD = {dbpwd}
HOSTPORT = {dbport}
PREFIX = {dbprefix}
CHARSET = utf8mb4
DEBUG = false
[REDIS]
REDIS_HOSTNAME = 127.0.0.1
PORT = 6379
REDIS_PASSWORD =
SELECT = 0
[QUEUE]
state = false
[LANG]
default_lang = zh-cn
[SYSTEM]
ADMIN_TOKEN_NAME = token
API_TOKEN_NAME = token
ADMIN_SITE_ID_NAME = site-id
API_SITE_ID_NAME = site-id
ADMIN_TOKEN_EXPIRE_TIME = 604800
API_TOKEN_EXPIRE_TIME = 2592000
LANG_NAME = lang
CHANNEL_NAME = channel
ADMIN_DOMAIN =
WAP_DOMAIN =
WEB_DOMAIN =
[NIUCLOUD]
code =
secret =
|
||||
APP_DEBUG = true
[APP]
DEFAULT_TIMEZONE = Asia/Shanghai
AUTH_KEY = {auth_key}
[DATABASE]
TYPE = mysql
HOSTNAME = {dbhost}
DATABASE = {dbname}
USERNAME = {dbuser}
PASSWORD = {dbpwd}
HOSTPORT = {dbport}
PREFIX = {dbprefix}
CHARSET = utf8mb4
DEBUG = false
[REDIS]
REDIS_HOSTNAME = 127.0.0.1
PORT = 6379
REDIS_PASSWORD =
SELECT = 0
[QUEUE]
state = false
[LANG]
default_lang = zh-cn
[SYSTEM]
ADMIN_TOKEN_NAME = token
API_TOKEN_NAME = token
ADMIN_SITE_ID_NAME = site-id
API_SITE_ID_NAME = site-id
ADMIN_TOKEN_EXPIRE_TIME = 604800
API_TOKEN_EXPIRE_TIME = 86400
LANG_NAME = lang
CHANNEL_NAME = channel
ADMIN_DOMAIN =
WAP_DOMAIN =
WEB_DOMAIN =
[NIUCLOUD]
code =
secret =
|
||||
@ -80,7 +80,7 @@ class Addon extends BaseAdminController
|
||||
* 获取云安装日志
|
||||
* @description 获取云安装日志
|
||||
* @param $addon
|
||||
* @return mixed
|
||||
* @return Response
|
||||
*/
|
||||
public function cloudInstallLog($addon) {
|
||||
return success(data:(new AddonService())->cloudInstallLog($addon));
|
||||
@ -101,7 +101,7 @@ class Addon extends BaseAdminController
|
||||
* 取消安装
|
||||
* @description 取消安装
|
||||
* @param $addon
|
||||
* @return mixed
|
||||
* @return Response
|
||||
*/
|
||||
public function cancleInstall($addon)
|
||||
{
|
||||
|
||||
@ -75,7 +75,7 @@ class AddonDevelop extends BaseAdminController
|
||||
/**
|
||||
* 开发插件更新
|
||||
* @description 开发插件更新
|
||||
* @param string $id
|
||||
* @param string $key
|
||||
* @return Response
|
||||
*/
|
||||
public function edit(string $key)
|
||||
@ -101,7 +101,7 @@ class AddonDevelop extends BaseAdminController
|
||||
/**
|
||||
* 删除开发插件
|
||||
* @description 删除开发插件
|
||||
* @param $key
|
||||
* @param string $key
|
||||
* @return Response
|
||||
*/
|
||||
public function del(string $key)
|
||||
@ -114,7 +114,7 @@ class AddonDevelop extends BaseAdminController
|
||||
* 校验key是否被占用
|
||||
* @description 校验key是否被占用
|
||||
* @param $key
|
||||
* @return void
|
||||
* @return Response
|
||||
*/
|
||||
public function checkKey($key)
|
||||
{
|
||||
|
||||
@ -78,7 +78,7 @@ class Backup extends BaseAdminController
|
||||
/**
|
||||
* 恢复备份
|
||||
* @description 恢复备份
|
||||
* @return Response
|
||||
* @return array
|
||||
*/
|
||||
public function restoreBackup()
|
||||
{
|
||||
@ -107,7 +107,7 @@ class Backup extends BaseAdminController
|
||||
/**
|
||||
* 手动备份
|
||||
* @description 手动备份
|
||||
* @return Response
|
||||
* @return array
|
||||
*/
|
||||
public function manualBackup()
|
||||
{
|
||||
|
||||
@ -13,6 +13,7 @@ namespace app\adminapi\controller\dict;
|
||||
|
||||
use core\base\BaseAdminController;
|
||||
use app\service\admin\dict\DictService;
|
||||
use think\Response;
|
||||
|
||||
|
||||
/**
|
||||
@ -83,8 +84,8 @@ class Dict extends BaseAdminController
|
||||
/**
|
||||
* 数据字典删除
|
||||
* @description 数据字典删除
|
||||
* @param $id 数据字典id
|
||||
* @return \think\Response
|
||||
* @param int $id 数据字典id
|
||||
* @return Response
|
||||
*/
|
||||
public function del(int $id){
|
||||
(new DictService())->del($id);
|
||||
@ -118,8 +119,8 @@ class Dict extends BaseAdminController
|
||||
/**
|
||||
* 数据字典详情
|
||||
* @description 数据字典详情
|
||||
* @param key 数据字典关键字
|
||||
* @return \think\Response
|
||||
* @param string $type
|
||||
* @return Response
|
||||
*/
|
||||
public function getKeyInfo(string $type){
|
||||
$res = (new DictService())->getKeyInfo($type);
|
||||
|
||||
@ -369,7 +369,7 @@ class Diy extends BaseAdminController
|
||||
/**
|
||||
* 删除自定义主题配色
|
||||
* @description 删除自定义主题配色
|
||||
* @param $id
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function delDiyTheme(int $id)
|
||||
|
||||
@ -13,7 +13,6 @@ namespace app\adminapi\controller\login;
|
||||
|
||||
use app\service\admin\auth\ConfigService;
|
||||
use app\service\admin\auth\LoginService;
|
||||
use app\service\core\addon\WapTrait;
|
||||
use core\base\BaseAdminController;
|
||||
use think\Response;
|
||||
|
||||
@ -25,7 +24,6 @@ use think\Response;
|
||||
*/
|
||||
class Login extends BaseAdminController
|
||||
{
|
||||
use WapTrait;
|
||||
|
||||
/**
|
||||
* 登录
|
||||
|
||||
@ -135,7 +135,7 @@ class CashOut extends BaseAdminController
|
||||
/**
|
||||
* 校验数组是否
|
||||
* @description 校验数组是否
|
||||
* @return void
|
||||
* @return Response
|
||||
*/
|
||||
public function checkTransferStatus($id){
|
||||
(new MemberCashOutService())->checkTransferStatus($id);
|
||||
@ -146,7 +146,7 @@ class CashOut extends BaseAdminController
|
||||
* 取消
|
||||
* @description 取消
|
||||
* @param $id
|
||||
* @return void
|
||||
* @return Response
|
||||
*/
|
||||
public function cancel($id){
|
||||
|
||||
|
||||
@ -231,7 +231,7 @@ class Member extends BaseAdminController
|
||||
/**
|
||||
* 获取会员权益字典
|
||||
* @description 获取会员权益字典
|
||||
* @return mixed
|
||||
* @return Response
|
||||
*/
|
||||
public function getMemberBenefitsDict()
|
||||
{
|
||||
@ -241,7 +241,7 @@ class Member extends BaseAdminController
|
||||
/**
|
||||
* 获取会员礼包字典
|
||||
* @description 获取会员礼包字典
|
||||
* @return array|null
|
||||
* @return Response
|
||||
*/
|
||||
public function getMemberGiftDict()
|
||||
{
|
||||
@ -251,7 +251,7 @@ class Member extends BaseAdminController
|
||||
/**
|
||||
* 获取成长值规则字典
|
||||
* @description 获取成长值规则字典
|
||||
* @return array|null
|
||||
* @return Response
|
||||
*/
|
||||
public function getGrowthRuleDict()
|
||||
{
|
||||
@ -261,7 +261,7 @@ class Member extends BaseAdminController
|
||||
/**
|
||||
* 获取积分规则字典
|
||||
* @description 获取积分规则字典
|
||||
* @return array|null
|
||||
* @return Response
|
||||
*/
|
||||
public function getPointRuleDict()
|
||||
{
|
||||
|
||||
@ -11,8 +11,10 @@
|
||||
|
||||
namespace app\adminapi\controller\niucloud;
|
||||
|
||||
use app\service\admin\niucloud\NiucloudService;
|
||||
use app\service\core\niucloud\CoreCloudBuildService;
|
||||
use core\base\BaseAdminController;
|
||||
use core\util\niucloud\CloudService;
|
||||
|
||||
/**
|
||||
* 云编译
|
||||
@ -66,4 +68,42 @@ class Cloud extends BaseAdminController
|
||||
public function buildPreCheck() {
|
||||
return success(data:(new CoreCloudBuildService())->buildPreCheck());
|
||||
}
|
||||
|
||||
/**
|
||||
* 连通测试
|
||||
* @description 连通测试
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function connectTest()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ 'url', '' ],
|
||||
]);
|
||||
$is_connected = (new CloudService(true,$data['url']))->is_connected;
|
||||
return success('SUCCESS',$is_connected);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置本地地址
|
||||
* @description 连通测试
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function setLocalCloudCompileConfig()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ 'url', '' ],
|
||||
[ 'is_open', 0 ],
|
||||
]);
|
||||
return success('SUCCESS',(new NiucloudService())->setLocalCloudCompileConfig($data));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取本地地址
|
||||
* @description 连通测试
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function getLocalCloudCompileConfig()
|
||||
{
|
||||
return success('SUCCESS',(new NiucloudService())->getLocalCloudCompileConfig());
|
||||
}
|
||||
}
|
||||
|
||||
@ -208,23 +208,6 @@ class NiuSms extends BaseAdminController
|
||||
return success($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 忘记密码
|
||||
* @description 忘记密码
|
||||
* @param $username
|
||||
* @return Response
|
||||
*/
|
||||
public function forgetPassword($username)
|
||||
{
|
||||
$params = $this->request->params([
|
||||
['mobile', ''],
|
||||
['code', ''],
|
||||
['key', ''],
|
||||
]);
|
||||
$data = (new NiuSmsService())->forgetPassword($username, $params);
|
||||
return success($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 签名列表
|
||||
* @description 签名列表
|
||||
|
||||
@ -35,7 +35,7 @@ class Transfer extends BaseAdminController
|
||||
* 设置场景id
|
||||
* @description 设置场景id
|
||||
* @param $scene
|
||||
* @return void
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function setSceneId($scene){
|
||||
$data = $this->request->params([
|
||||
|
||||
@ -14,6 +14,7 @@ namespace app\adminapi\controller\site;
|
||||
use app\dict\site\SiteDict;
|
||||
use app\service\admin\auth\AuthSiteService;
|
||||
use app\service\admin\site\SiteService;
|
||||
use app\service\api\captcha\CaptchaService;
|
||||
use core\base\BaseAdminController;
|
||||
use think\Response;
|
||||
|
||||
@ -33,15 +34,15 @@ class Site extends BaseAdminController
|
||||
public function lists()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ 'keywords', '' ],
|
||||
[ 'status', "" ],
|
||||
[ 'group_id', 0 ],
|
||||
[ 'create_time', [] ],
|
||||
[ 'expire_time', [] ],
|
||||
[ 'app', '' ],
|
||||
[ 'site_domain', '' ]
|
||||
['keywords', ''],
|
||||
['status', ""],
|
||||
['group_id', 0],
|
||||
['create_time', []],
|
||||
['expire_time', []],
|
||||
['app', ''],
|
||||
['site_domain', '']
|
||||
]);
|
||||
return success(( new SiteService() )->getPage($data));
|
||||
return success((new SiteService())->getPage($data));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -52,7 +53,7 @@ class Site extends BaseAdminController
|
||||
*/
|
||||
public function info(int $id)
|
||||
{
|
||||
return success(( new SiteService() )->getInfo($id));
|
||||
return success((new SiteService())->getInfo($id));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -64,19 +65,19 @@ class Site extends BaseAdminController
|
||||
public function add()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ 'site_name', '' ],
|
||||
[ 'uid', 0 ],
|
||||
[ 'username', '' ],
|
||||
[ 'real_name', '' ],
|
||||
[ 'password', '' ],
|
||||
[ 'group_id', 0 ],
|
||||
[ 'expire_time', 0 ],
|
||||
[ 'site_domain', '' ],
|
||||
['site_name', ''],
|
||||
['uid', 0],
|
||||
['username', ''],
|
||||
['real_name', ''],
|
||||
['password', ''],
|
||||
['group_id', 0],
|
||||
['expire_time', 0],
|
||||
['site_domain', ''],
|
||||
]);
|
||||
$this->validate($data, 'app\validate\site\Site.add');
|
||||
if (empty($data[ 'uid' ])) $this->validate($data, 'app\validate\sys\User.add');
|
||||
$site_id = ( new SiteService() )->add($data);
|
||||
return success('ADD_SUCCESS', [ 'site_id' => $site_id ]);
|
||||
if (empty($data['uid'])) $this->validate($data, 'app\validate\sys\User.add');
|
||||
$site_id = (new SiteService())->add($data);
|
||||
return success('ADD_SUCCESS', ['site_id' => $site_id]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -96,7 +97,7 @@ class Site extends BaseAdminController
|
||||
*/
|
||||
public function menu()
|
||||
{
|
||||
return success(( new AuthSiteService() )->getMenuList(1, 1, 'all', 0));
|
||||
return success((new AuthSiteService())->getMenuList(1, 1, 'all', 0));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -106,9 +107,9 @@ class Site extends BaseAdminController
|
||||
public function closeSite($id)
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ 'status', SiteDict::CLOSE ],
|
||||
['status', SiteDict::CLOSE],
|
||||
]);
|
||||
( new SiteService() )->edit($id, $data);
|
||||
(new SiteService())->edit($id, $data);
|
||||
return success();
|
||||
}
|
||||
|
||||
@ -119,17 +120,17 @@ class Site extends BaseAdminController
|
||||
public function edit($id)
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ 'site_name', '' ],
|
||||
[ 'uid', 0 ],
|
||||
[ 'username', '' ],
|
||||
[ 'real_name', '' ],
|
||||
[ 'password', '' ],
|
||||
[ 'group_id', 0 ],
|
||||
[ 'expire_time', 0 ],
|
||||
[ 'site_domain', '' ],
|
||||
['site_name', ''],
|
||||
['uid', 0],
|
||||
['username', ''],
|
||||
['real_name', ''],
|
||||
['password', ''],
|
||||
['group_id', 0],
|
||||
['expire_time', 0],
|
||||
['site_domain', ''],
|
||||
]);
|
||||
$this->validate(array_merge($data, [ 'site_id' => $id ]), 'app\validate\site\Site.edit');
|
||||
( new SiteService() )->edit($id, $data);
|
||||
$this->validate(array_merge($data, ['site_id' => $id]), 'app\validate\site\Site.edit');
|
||||
(new SiteService())->edit($id, $data);
|
||||
return success('MODIFY_SUCCESS');
|
||||
}
|
||||
|
||||
@ -141,7 +142,7 @@ class Site extends BaseAdminController
|
||||
*/
|
||||
public function del($id)
|
||||
{
|
||||
( new SiteService() )->del($id);
|
||||
(new SiteService())->del($id);
|
||||
return success('DELETE_SUCCESS');
|
||||
}
|
||||
|
||||
@ -152,9 +153,9 @@ class Site extends BaseAdminController
|
||||
public function openSite($id)
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ 'status', SiteDict::ON ],
|
||||
['status', SiteDict::ON],
|
||||
]);
|
||||
( new SiteService() )->edit($id, $data);
|
||||
(new SiteService())->edit($id, $data);
|
||||
return success();
|
||||
}
|
||||
|
||||
@ -171,20 +172,20 @@ class Site extends BaseAdminController
|
||||
public function addons()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ 'title', '' ],
|
||||
['title', ''],
|
||||
]);
|
||||
$data = ( new SiteService() )->getSiteAddons($data);
|
||||
return success(data:$data);
|
||||
$data = (new SiteService())->getSiteAddons($data);
|
||||
return success(data: $data);
|
||||
}
|
||||
|
||||
public function showApp()
|
||||
{
|
||||
return success(( new SiteService() )->getShowAppTools());
|
||||
return success((new SiteService())->getShowAppTools());
|
||||
}
|
||||
|
||||
public function showMarketing()
|
||||
{
|
||||
return success(( new SiteService() )->getShowMarketingTools());
|
||||
return success((new SiteService())->getShowMarketingTools());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -195,9 +196,40 @@ class Site extends BaseAdminController
|
||||
public function siteInit()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ 'site_id', '' ],
|
||||
['site_id', ''],
|
||||
]);
|
||||
return success('SUCCESS', ( new SiteService() )->siteInit($data));
|
||||
return success('SUCCESS', (new SiteService())->siteInit($data));
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 设置是否允许切换站点
|
||||
* @return Response
|
||||
*/
|
||||
public function setIsAllowChangeSite()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
['is_allow', 1],
|
||||
]);
|
||||
(new SiteService())->setIsAllowChangeSite($data['is_allow']);
|
||||
return success('SUCCESS');
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 获取是否允许切换站点
|
||||
* @return Response
|
||||
*/
|
||||
public function getIsAllowChangeSite()
|
||||
{
|
||||
return success('SUCCESS', (new SiteService())->getIsAllowChangeSite());
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建验证码
|
||||
* @return Response
|
||||
*/
|
||||
public function captcha()
|
||||
{
|
||||
return success(( new CaptchaService() )->create());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -107,7 +107,7 @@ class SiteGroup extends BaseAdminController
|
||||
$data = $this->request->params([
|
||||
['app', ''],
|
||||
]);
|
||||
return success((new SiteGroupService())->getAll($data));
|
||||
return success((new SiteGroupService())->getAll());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -13,7 +13,6 @@ namespace app\adminapi\controller\site;
|
||||
|
||||
use app\dict\sys\UserDict;
|
||||
use app\service\admin\site\SiteUserService;
|
||||
use app\service\admin\user\UserService;
|
||||
use core\base\BaseAdminController;
|
||||
use Exception;
|
||||
use think\Response;
|
||||
|
||||
@ -74,7 +74,7 @@ class Area extends BaseAdminController
|
||||
/**
|
||||
* 根据code获取地址信息
|
||||
* @description 根据code获取地址信息
|
||||
* @return void
|
||||
* @return Response
|
||||
*/
|
||||
public function areaByAreaCode(string $code) {
|
||||
return success((new AreaService())->getAreaByAreaCode($code));
|
||||
|
||||
@ -57,7 +57,10 @@ class Config extends BaseAdminController
|
||||
[ "front_end_name", "" ],
|
||||
[ "front_end_logo", "" ],
|
||||
[ "front_end_icon", "" ],
|
||||
[ "icon", "" ]
|
||||
[ "icon", "" ],
|
||||
[ "meta_title", "" ],
|
||||
[ "meta_desc", "" ],
|
||||
[ "meta_keyword", "" ],
|
||||
]);
|
||||
$this->validate($data, 'app\validate\site\Site.edit');
|
||||
( new ConfigService() )->setWebSite($data);
|
||||
|
||||
@ -79,7 +79,7 @@ class Export extends BaseAdminController
|
||||
/**
|
||||
* 获取导出状态列表
|
||||
* @description 获取导出状态列表
|
||||
* @param string $type
|
||||
* @return Response
|
||||
*/
|
||||
public function getExportStatus()
|
||||
{
|
||||
|
||||
@ -191,7 +191,7 @@ class Poster extends BaseAdminController
|
||||
/**
|
||||
* 获取自定义海报预览
|
||||
* @description 获取自定义海报预览
|
||||
* @return array|\think\Response
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function preview()
|
||||
{
|
||||
|
||||
@ -14,6 +14,7 @@ namespace app\adminapi\controller\sys;
|
||||
use app\service\admin\sys\PrinterService;
|
||||
use app\service\admin\sys\PrinterTemplateService;
|
||||
use core\base\BaseAdminController;
|
||||
use think\Response;
|
||||
|
||||
|
||||
/**
|
||||
@ -90,8 +91,8 @@ class Printer extends BaseAdminController
|
||||
/**
|
||||
* 小票打印机编辑
|
||||
* @description 小票打印机编辑
|
||||
* @param $id 小票打印机id
|
||||
* @return \think\Response
|
||||
* @param int $id 小票打印机id
|
||||
* @return Response
|
||||
*/
|
||||
public function edit(int $id)
|
||||
{
|
||||
@ -131,8 +132,8 @@ class Printer extends BaseAdminController
|
||||
/**
|
||||
* 小票打印机删除
|
||||
* @description 小票打印机删除
|
||||
* @param $id 小票打印机id
|
||||
* @return \think\Response
|
||||
* @param int $id 小票打印机id
|
||||
* @return Response
|
||||
*/
|
||||
public function del(int $id)
|
||||
{
|
||||
@ -200,8 +201,8 @@ class Printer extends BaseAdminController
|
||||
/**
|
||||
* 小票打印模板编辑
|
||||
* @description 小票打印模板编辑
|
||||
* @param $id 小票打印模板id
|
||||
* @return \think\Response
|
||||
* @param int $id 小票打印模板id
|
||||
* @return Response
|
||||
*/
|
||||
public function templateEdit(int $id)
|
||||
{
|
||||
@ -218,8 +219,8 @@ class Printer extends BaseAdminController
|
||||
/**
|
||||
* 小票打印模板删除
|
||||
* @description 小票打印模板删除
|
||||
* @param $id 小票打印模板id
|
||||
* @return \think\Response
|
||||
* @param int $id 小票打印模板id
|
||||
* @return Response
|
||||
*/
|
||||
public function templateDel(int $id)
|
||||
{
|
||||
@ -230,7 +231,7 @@ class Printer extends BaseAdminController
|
||||
/**
|
||||
* 获取小票打印模板类型
|
||||
* @description 获取小票打印模板类型
|
||||
* @return array|\think\Response
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
@ -240,7 +241,7 @@ class Printer extends BaseAdminController
|
||||
/**
|
||||
* 获取小票打印机设备品牌
|
||||
* @description 获取小票打印机设备品牌
|
||||
* @return array|\think\Response
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function getBrand()
|
||||
{
|
||||
|
||||
@ -154,4 +154,19 @@ class Schedule extends BaseAdminController
|
||||
return fail('FAIL');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置定时任务
|
||||
* @description 重置定时任务
|
||||
* @return Response
|
||||
*/
|
||||
public function resetSchedule()
|
||||
{
|
||||
$res = (new ScheduleService())->resetSchedule();
|
||||
if ($res) {
|
||||
return success('SUCCESS');
|
||||
} else {
|
||||
return fail('FAIL');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -128,7 +128,6 @@ class Ueditor extends BaseAdminController
|
||||
'title' => $upload_res['url'],
|
||||
'original' => $upload_res['url'],
|
||||
], 'json', 200);
|
||||
break;
|
||||
case 'video':
|
||||
$upload_res = $upload_service->video($data['file']);
|
||||
return Response::create([
|
||||
@ -137,7 +136,6 @@ class Ueditor extends BaseAdminController
|
||||
'title' => $upload_res['url'],
|
||||
'original' => $upload_res['url'],
|
||||
], 'json', 200);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ class Verify extends BaseAdminController
|
||||
/**
|
||||
* 核销信息
|
||||
* @description 核销信息
|
||||
* @param int $order_id
|
||||
* @param string $verify_code
|
||||
* @return Response
|
||||
*/
|
||||
public function detail(string $verify_code)
|
||||
|
||||
@ -24,7 +24,7 @@ class Delivery extends BaseAdminController
|
||||
/**
|
||||
* 查询小程序是否已开通发货信息管理服务
|
||||
* @description 查询小程序是否已开通发货信息管理服务
|
||||
* @return bool
|
||||
* @return \think\Response
|
||||
* @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException
|
||||
*/
|
||||
public function getIsTradeManaged()
|
||||
|
||||
@ -16,7 +16,6 @@ use app\Request;
|
||||
use app\service\admin\site\UserLogService;
|
||||
use Closure;
|
||||
use ReflectionClass;
|
||||
use think\facade\Route;
|
||||
|
||||
/**
|
||||
* admin用户操作日志
|
||||
|
||||
@ -9,7 +9,6 @@
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
use app\adminapi\middleware\AdminCheckRole;
|
||||
use app\adminapi\middleware\AdminCheckToken;
|
||||
use app\adminapi\middleware\AdminLog;
|
||||
use think\facade\Route;
|
||||
|
||||
@ -55,6 +55,12 @@ Route::group('niucloud', function() {
|
||||
Route::post('build/clear', 'niucloud.Cloud/clearBuildTask');
|
||||
// 编译前环境检测
|
||||
Route::get('build/check', 'niucloud.Cloud/buildPreCheck');
|
||||
//连通测试
|
||||
Route::post('build/connect_test', 'niucloud.Cloud/connectTest');
|
||||
//保存本地服务器地址
|
||||
Route::post('build/set_local_url', 'niucloud.Cloud/setLocalCloudCompileConfig');
|
||||
//获取本地服务器地址
|
||||
Route::get('build/get_local_url', 'niucloud.Cloud/getLocalCloudCompileConfig');
|
||||
})->middleware([
|
||||
AdminCheckToken::class,
|
||||
AdminCheckRole::class,
|
||||
|
||||
@ -58,7 +58,6 @@ Route::group('notice', function () {
|
||||
Route::post('login', 'notice.NiuSms/loginAccount');
|
||||
Route::post('edit/:username', 'notice.NiuSms/editAccount');
|
||||
Route::post('reset/password/:username', 'notice.NiuSms/resetPassword');
|
||||
Route::post('forget/password/:username', 'notice.NiuSms/forgetPassword');
|
||||
Route::get('send_list/:username', 'notice.NiuSms/accountSendList');
|
||||
Route::get('info/:username', 'notice.NiuSms/accountInfo');
|
||||
});
|
||||
|
||||
@ -21,6 +21,10 @@ use think\facade\Route;
|
||||
Route::group('site', function () {
|
||||
|
||||
/***************************************************** 站点管理 ****************************************************/
|
||||
//切换站点配置
|
||||
Route::put('allow_change', 'site.Site/setIsAllowChangeSite');
|
||||
Route::get('allow_change', 'site.Site/getIsAllowChangeSite');
|
||||
|
||||
//站点列表
|
||||
Route::get('site', 'site.Site/lists');
|
||||
//站点信息
|
||||
@ -39,6 +43,8 @@ Route::group('site', function () {
|
||||
Route::get('statuslist', 'site.Site/getStatuList');
|
||||
//站点初始化
|
||||
Route::post('init', 'site.Site/siteInit');
|
||||
//生成验证码
|
||||
Route::get('captcha/create', 'site.Site/captcha');
|
||||
/***************************************************** 站点分组 *************************************************/
|
||||
//站点分组
|
||||
Route::get('group', 'site.SiteGroup/lists');
|
||||
|
||||
@ -189,6 +189,8 @@ Route::group('sys', function() {
|
||||
Route::get('schedule/datetype', 'sys.Schedule/getDateType');
|
||||
//执行一次任务
|
||||
Route::put('schedule/do/:id', 'sys.Schedule/doSchedule');
|
||||
//重置定时任务
|
||||
Route::post('schedule/reset', 'sys.Schedule/resetSchedule');
|
||||
|
||||
//任务执行记录列表
|
||||
Route::get('schedule/log/list', 'sys.ScheduleLog/lists');
|
||||
|
||||
@ -13,6 +13,7 @@ namespace app\api\controller\member;
|
||||
|
||||
use core\base\BaseApiController;
|
||||
use app\service\api\member\AddressService;
|
||||
use think\Response;
|
||||
|
||||
|
||||
/**
|
||||
@ -89,8 +90,8 @@ class Address extends BaseApiController
|
||||
|
||||
/**
|
||||
* 会员收货地址删除
|
||||
* @param $id 会员收货地址id
|
||||
* @return \think\Response
|
||||
* @param int $id 会员收货地址id
|
||||
* @return Response
|
||||
*/
|
||||
public function del(int $id){
|
||||
(new AddressService())->del($id);
|
||||
|
||||
@ -13,10 +13,6 @@ namespace app\api\controller\pay;
|
||||
|
||||
use app\service\api\pay\PayService;
|
||||
use core\base\BaseApiController;
|
||||
use think\db\exception\DataNotFoundException;
|
||||
use think\db\exception\DbException;
|
||||
use think\db\exception\ModelNotFoundException;
|
||||
use think\Response;
|
||||
|
||||
/**
|
||||
* 微信服务端通信以及网页授权
|
||||
@ -27,7 +23,7 @@ class Transfer extends BaseApiController
|
||||
|
||||
/**
|
||||
* 确认收款
|
||||
* @return Response
|
||||
* @return void
|
||||
*/
|
||||
public function confirm($transfer_no)
|
||||
{
|
||||
|
||||
@ -50,7 +50,6 @@ class Area extends BaseApiController
|
||||
|
||||
/**
|
||||
* 通过经纬度查询地址
|
||||
* @param int $level
|
||||
* @return Response
|
||||
*/
|
||||
public function getAddressByLatlng()
|
||||
|
||||
@ -91,10 +91,21 @@ class Config extends BaseApiController
|
||||
$res[ 'login_config' ] = ( new MemberConfigService() )->getLoginConfig($data[ 'url' ]);
|
||||
$res[ 'theme_list' ] = ( new DiyService() )->getDiyTheme();
|
||||
|
||||
// 查询是否已经存在该小程序用户, 如果存在则小程序端快捷登录时不再弹出授权弹框
|
||||
$openid_field = match ( $this->request->getChannel() ) {
|
||||
'wechat' => 'wx_openid',
|
||||
'weapp' => 'weapp_openid',
|
||||
default => ''
|
||||
};
|
||||
// 根据来源查询是否已经存在用户, 如果存在则快捷登录时不再弹出授权弹框
|
||||
// 根据来源查询是否绑定手机号, 如果绑定并且开启强制绑定则快捷登录时不再弹出绑定手机弹窗
|
||||
$res[ 'member_exist' ] = 0;
|
||||
$res[ 'member_mobile_exist' ] = 0;
|
||||
if (!empty($data[ 'openid' ])) {
|
||||
$res[ 'member_exist' ] = ( new MemberService() )->getCount([ [ 'weapp_openid', '=', $data[ 'openid' ] ] ]) > 0 ? 1 : 0;
|
||||
if (!empty($openid_field)){
|
||||
$res[ 'member_exist' ] = ( new MemberService() )->getCount([ [ $openid_field, '=', $data[ 'openid' ] ] ]) > 0 ? 1 : 0;
|
||||
|
||||
$res[ 'member_mobile_exist' ] = ( new MemberService() )->getCount([ [ $openid_field, '=', $data[ 'openid' ] ], [ 'mobile', '<>', '' ] ]) > 0 ? 1 : 0;
|
||||
}
|
||||
}
|
||||
|
||||
( new MemberService() )->initMemberData();
|
||||
@ -104,4 +115,31 @@ class Config extends BaseApiController
|
||||
}
|
||||
return success($res);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取公众号用户是否绑定手机
|
||||
* @return Response
|
||||
*/
|
||||
public function getMemberMobileExist()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ 'openid', '' ]
|
||||
]);
|
||||
|
||||
$openid_field = match ( $this->request->getChannel() ) {
|
||||
'wechat' => 'wx_openid',
|
||||
'weapp' => 'weapp_openid',
|
||||
default => ''
|
||||
};
|
||||
|
||||
// 根据来源查询是否绑定手机号, 如果绑定并且开启强制绑定则快捷登录时不再弹出绑定手机弹窗
|
||||
$res[ 'member_mobile_exist' ] = 0;
|
||||
if (!empty($data[ 'openid' ])) {
|
||||
if (!empty($openid_field)) {
|
||||
$res['member_mobile_exist'] = (new MemberService())->getCount([ [ $openid_field, '=', $data['openid'] ], ['mobile', '<>', ''] ]) > 0 ? 1 : 0;
|
||||
}
|
||||
}
|
||||
|
||||
return success($res);
|
||||
}
|
||||
}
|
||||
|
||||
@ -64,7 +64,7 @@ class Verify extends BaseApiController
|
||||
|
||||
/**
|
||||
* 核销记录
|
||||
* @return void
|
||||
* @return Response
|
||||
*/
|
||||
public function records()
|
||||
{
|
||||
@ -80,7 +80,7 @@ class Verify extends BaseApiController
|
||||
|
||||
/**
|
||||
* 获取核销详情
|
||||
* @param $code
|
||||
* @param string|int $code
|
||||
* @return Response
|
||||
*/
|
||||
public function detail(string|int $code)
|
||||
|
||||
@ -29,7 +29,7 @@ class Serve extends BaseController
|
||||
/**
|
||||
* 接收消息并推送
|
||||
* @param $site_id
|
||||
* @return Response
|
||||
* @return \think\Response
|
||||
* @throws BadRequestException
|
||||
* @throws InvalidArgumentException
|
||||
* @throws RuntimeException
|
||||
|
||||
@ -62,7 +62,7 @@ class Weapp extends BaseApiController
|
||||
|
||||
/**
|
||||
* 查询小程序是否已开通发货信息管理服务
|
||||
* @return bool
|
||||
* @return Response
|
||||
* @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException
|
||||
*/
|
||||
public function getIsTradeManaged()
|
||||
|
||||
@ -29,7 +29,7 @@ class Serve extends BaseController
|
||||
/**
|
||||
* 接收消息并推送
|
||||
* @param $site_id
|
||||
* @return Response
|
||||
* @return \think\Response
|
||||
* @throws BadRequestException
|
||||
* @throws InvalidArgumentException
|
||||
* @throws RuntimeException
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的saas管理平台
|
||||
// | Niucloud-admin 企业快速开发的多应用管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
@ -11,6 +11,7 @@
|
||||
|
||||
namespace app\api\controller\wechat;
|
||||
|
||||
use app\service\api\login\LoginService;
|
||||
use app\service\api\wechat\WechatAuthService;
|
||||
use core\base\BaseController;
|
||||
use think\db\exception\DataNotFoundException;
|
||||
@ -95,6 +96,10 @@ class Wechat extends BaseController
|
||||
$this->validate($data, [
|
||||
'mobile' => 'mobile'
|
||||
]);
|
||||
|
||||
// 校验手机验证码(电脑端扫码)
|
||||
( new LoginService() )->checkMobileCode($data[ 'mobile' ]);
|
||||
|
||||
$wechat_auth_service = new WechatAuthService();
|
||||
return success($wechat_auth_service->register($data[ 'openid' ], $data[ 'mobile' ], wx_unionid: $data[ 'unionid' ]));
|
||||
}
|
||||
@ -145,4 +150,15 @@ class Wechat extends BaseController
|
||||
$wechat_auth_service = new WechatAuthService();
|
||||
return success($wechat_auth_service->updateOpenid($data[ 'code' ]));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新openid
|
||||
* @return Response
|
||||
*/
|
||||
public function updateOpenidByH5()
|
||||
{
|
||||
$data = $this->request->params([ [ 'wx_openid', '' ] ]);
|
||||
$wechat_auth_service = new WechatAuthService();
|
||||
return success($wechat_auth_service->updateOpenidByH5($data[ 'wx_openid' ]));
|
||||
}
|
||||
}
|
||||
|
||||
@ -24,6 +24,7 @@ class BindDispatch extends Controller
|
||||
}
|
||||
|
||||
switch ($channel) {
|
||||
case MemberLoginTypeDict::PC:
|
||||
case MemberLoginTypeDict::WECHAT:
|
||||
$controller = 'wechat.Wechat';
|
||||
$action = 'register';
|
||||
|
||||
@ -108,6 +108,8 @@ Route::group(function() {
|
||||
|
||||
// 获取初始化数据信息
|
||||
Route::get('init', 'sys.Config/init');
|
||||
// 获取公众号用户是否绑定手机
|
||||
Route::get('member_mobile_exist', 'sys.Config/getMemberMobileExist');
|
||||
|
||||
/***************************************************** 地区管理 ****************************************************/
|
||||
//通过pid获取列表
|
||||
@ -151,6 +153,8 @@ Route::group(function() {
|
||||
Route::group(function() {
|
||||
//公众号更新用户openid
|
||||
Route::put('wechat/update_openid', 'wechat.Wechat/updateOpenid');
|
||||
//公众号更新用户openid
|
||||
Route::put('wechat/update_openid_h5', 'wechat.Wechat/updateOpenidByH5');
|
||||
//小程序更新用户openid
|
||||
Route::put('weapp/update_openid', 'weapp.Weapp/updateOpenid');
|
||||
|
||||
|
||||
@ -4,11 +4,8 @@ declare (strict_types = 1);
|
||||
namespace app\command;
|
||||
|
||||
use app\service\admin\auth\LoginService;
|
||||
use app\service\admin\install\InstallSystemService;
|
||||
use app\service\core\menu\CoreMenuService;
|
||||
use think\console\Command;
|
||||
use think\console\Input;
|
||||
use think\console\input\Option;
|
||||
use think\console\Output;
|
||||
|
||||
class Resetpassword extends Command
|
||||
|
||||
@ -228,7 +228,7 @@ function get_start_and_end_time_by_day($day = '')
|
||||
|
||||
/**
|
||||
* 获取本周的 开始、结束时间
|
||||
* @param data 日期
|
||||
* @param data $date 日期
|
||||
*/
|
||||
function get_weekinfo_by_time($date)
|
||||
{
|
||||
@ -357,7 +357,7 @@ function format_money($number)
|
||||
* 金额浮点数格式化
|
||||
* @param $number
|
||||
* @param $precision
|
||||
* @return float|int
|
||||
* @return string
|
||||
*/
|
||||
function format_float_money($number, $precision = 2)
|
||||
{
|
||||
@ -853,7 +853,7 @@ function version_to_string($ver)
|
||||
/**
|
||||
* 检测文件是否是本地图片
|
||||
* @param string $file_path
|
||||
* @return void
|
||||
* @return bool
|
||||
*/
|
||||
function check_file_is_remote(string $file_path)
|
||||
{
|
||||
@ -864,7 +864,7 @@ function check_file_is_remote(string $file_path)
|
||||
* 文件拷贝
|
||||
* @param string $source_file
|
||||
* @param string $to_file
|
||||
* @return void
|
||||
* @return bool
|
||||
*/
|
||||
function file_copy(string $source_file, string $to_file)
|
||||
{
|
||||
@ -889,11 +889,13 @@ function file_copy(string $source_file, string $to_file)
|
||||
/**
|
||||
* 创建并生成二维码
|
||||
* @param $url
|
||||
* @param $page
|
||||
* @param $data
|
||||
* @param $site_id
|
||||
* @param $dir
|
||||
* @param $file_path
|
||||
* @param $channel
|
||||
* @param $size
|
||||
* @param string $dir
|
||||
* @param string $channel
|
||||
* @param true[] $style
|
||||
* @param bool $outfile
|
||||
* @return string
|
||||
*/
|
||||
function qrcode($url, $page, $data, $site_id, $dir = '', $channel = 'h5', $style = [ 'is_transparent' => true ], $outfile = true)
|
||||
@ -933,15 +935,30 @@ function qrcode($url, $page, $data, $site_id, $dir = '', $channel = 'h5', $style
|
||||
* @param array $param
|
||||
* @param string $channel
|
||||
* @param bool $is_throw_exception
|
||||
* @return string|void
|
||||
* @return string|null
|
||||
*/
|
||||
function poster(int $site_id, $id, $type, array $param = [], string $channel = '', bool $is_throw_exception = true)
|
||||
{
|
||||
return ( new \app\service\core\poster\CorePosterService() )->get($site_id, $id, $type, $param, $channel, $is_throw_exception);
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否是url链接
|
||||
* @param $string
|
||||
* @return bool
|
||||
*/
|
||||
function is_url($string)
|
||||
{
|
||||
if (strstr($string, 'http://') === false && strstr($string, 'https://') === false) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取站点插件
|
||||
* @param int $site_id
|
||||
* @return array
|
||||
*/
|
||||
function get_site_addons($site_id = 0) : array
|
||||
@ -1124,4 +1141,4 @@ function downloadImage($img_url, $file_name)
|
||||
curl_close($ch);
|
||||
fclose($fp);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -150,7 +150,10 @@ class PagesDict
|
||||
'bgHeightScale' => 0,
|
||||
'imgWidth' => '',
|
||||
'imgHeight' => '',
|
||||
"bottomTabBarSwitch" => true,
|
||||
"bottomTabBar" => [
|
||||
'control' => true,
|
||||
'isShow' => true
|
||||
],
|
||||
"template" => [
|
||||
'textColor' => "#303133",
|
||||
'pageStartBgColor' => '',
|
||||
@ -222,7 +225,10 @@ class PagesDict
|
||||
'bgHeightScale' => 0,
|
||||
'imgWidth' => '',
|
||||
'imgHeight' => '',
|
||||
"bottomTabBarSwitch" => true,
|
||||
"bottomTabBar" => [
|
||||
'control' => true,
|
||||
'isShow' => true
|
||||
],
|
||||
"template" => [
|
||||
'textColor' => "#303133",
|
||||
'pageStartBgColor' => '',
|
||||
@ -688,7 +694,10 @@ class PagesDict
|
||||
'bgHeightScale' => 0,
|
||||
'imgWidth' => 750,
|
||||
'imgHeight' => 403,
|
||||
"bottomTabBarSwitch" => true,
|
||||
"bottomTabBar" => [
|
||||
'control' => true,
|
||||
'isShow' => true
|
||||
],
|
||||
"template" => [
|
||||
'textColor' => "#303133",
|
||||
'pageStartBgColor' => '',
|
||||
|
||||
@ -35,7 +35,9 @@ class TemplateDict
|
||||
'title' => get_lang('dict_diy.page_index'),
|
||||
'page' => '/app/pages/index/index',
|
||||
'action' => 'decorate', // 页面是否装修标识,为空标识不装修,decorate:装修
|
||||
'type' => 'index' // 页面类型,index:首页、member_index:个人中心,空:普通页面
|
||||
'type' => 'index', // 页面类型,index:首页、member_index:个人中心,空:普通页面
|
||||
'ignoreComponents' => [], // 忽略组件名单
|
||||
'global' => [] // 页面数据结构,初始化时覆盖
|
||||
],
|
||||
'DIY_MEMBER_INDEX' => [
|
||||
'title' => get_lang('dict_diy.page_member_index'),
|
||||
|
||||
@ -77,7 +77,10 @@ class TemplateDict
|
||||
"name" => ""
|
||||
]
|
||||
],
|
||||
"bottomTabBarSwitch" => true,
|
||||
"bottomTabBar" => [
|
||||
'control' => true,
|
||||
'isShow' => true
|
||||
],
|
||||
"popWindow" => [
|
||||
"imgUrl" => "",
|
||||
"imgWidth" => "",
|
||||
@ -719,7 +722,10 @@ class TemplateDict
|
||||
"name" => ""
|
||||
]
|
||||
],
|
||||
"bottomTabBarSwitch" => true,
|
||||
"bottomTabBar" => [
|
||||
'control' => true,
|
||||
'isShow' => true
|
||||
],
|
||||
"popWindow" => [
|
||||
"imgUrl" => "",
|
||||
"imgWidth" => "",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的saas管理平台
|
||||
// | Niucloud-admin 企业快速开发的多应用管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
@ -27,6 +27,9 @@ class MemberLoginTypeDict
|
||||
//微信小程序授权登录
|
||||
public const WEAPP = 'weapp';
|
||||
|
||||
// PC登录
|
||||
public const PC = 'pc';
|
||||
|
||||
public static function getType($type = '')
|
||||
{
|
||||
$data = [
|
||||
@ -34,6 +37,7 @@ class MemberLoginTypeDict
|
||||
self::MOBILE => get_lang('dict_member.login_mobile'),//手机号验证码登录,
|
||||
self::WECHAT => get_lang('dict_member.login_wechat'),//'微信公众号授权登录',
|
||||
self::WEAPP => get_lang('dict_member.login_weapp'),//'微信小程序授权登录',
|
||||
self::PC => get_lang('dict_member.login_pc'),//'微信小程序授权登录',
|
||||
];
|
||||
if (empty($type)) {
|
||||
return $data;
|
||||
@ -41,4 +45,4 @@ class MemberLoginTypeDict
|
||||
return $data[$type] ?? '';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -993,7 +993,7 @@ return [
|
||||
[
|
||||
'menu_name' => '云编译',
|
||||
'menu_key' => 'cloud_build',
|
||||
'menu_short_name' => '云编译按钮',
|
||||
'menu_short_name' => '云编译',
|
||||
'menu_type' => '2',
|
||||
'icon' => '',
|
||||
'api_url' => 'niucloud/build',
|
||||
|
||||
@ -204,20 +204,6 @@ return [
|
||||
'status' => '1',
|
||||
'is_show' => '1',
|
||||
],
|
||||
[
|
||||
'menu_name' => '添加分组',
|
||||
'menu_key' => 'add_attachment_category',
|
||||
'menu_short_name' => '删除素材',
|
||||
'menu_type' => '2',
|
||||
'icon' => '',
|
||||
'api_url' => 'sys/attachment/category',
|
||||
'router_path' => '',
|
||||
'view_path' => '',
|
||||
'methods' => 'delete',
|
||||
'sort' => '100',
|
||||
'status' => '1',
|
||||
'is_show' => '1',
|
||||
],
|
||||
[
|
||||
'menu_name' => '添加分组',
|
||||
'menu_key' => 'add_attachment_category',
|
||||
@ -245,21 +231,7 @@ return [
|
||||
'sort' => '100',
|
||||
'status' => '1',
|
||||
'is_show' => '1',
|
||||
],
|
||||
[
|
||||
'menu_name' => '编辑分组',
|
||||
'menu_key' => 'edit_attachment_category',
|
||||
'menu_short_name' => '编辑分组',
|
||||
'menu_type' => '2',
|
||||
'icon' => '',
|
||||
'api_url' => 'sys/attachment/category/<id>',
|
||||
'router_path' => '',
|
||||
'view_path' => '',
|
||||
'methods' => 'delete',
|
||||
'sort' => '100',
|
||||
'status' => '1',
|
||||
'is_show' => '1',
|
||||
],
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
@ -852,7 +824,7 @@ return [
|
||||
'children' => [
|
||||
[
|
||||
'menu_name' => '转账',
|
||||
'menu_key' => 'cash_out_transfer',
|
||||
'menu_key' => 'member_refund_transfer',
|
||||
'menu_short_name' => '转账',
|
||||
'menu_type' => '2',
|
||||
'icon' => '',
|
||||
@ -2669,7 +2641,7 @@ return [
|
||||
[
|
||||
'menu_name' => '编辑打印机',
|
||||
'menu_key' => 'printer_edit',
|
||||
'menu_short_name' => '添加打印机',
|
||||
'menu_short_name' => '编辑打印机',
|
||||
'parent_select_key' => 'printer_management_list',
|
||||
'menu_type' => '1',
|
||||
'icon' => '',
|
||||
|
||||
@ -20,6 +20,7 @@ class NoticeTypeDict
|
||||
//微信小程序
|
||||
public const WEAPP = 'weapp';
|
||||
|
||||
public const TEMPLATE_NEED_PULL = -4;
|
||||
public const TEMPLATE_AUDIT_STATUS_NEED_AGAIN_REPORT = -3;
|
||||
public const TEMPLATE_AUDIT_STATUS_NEED_EDIT = -2;
|
||||
public const TEMPLATE_AUDIT_STATUS_NOT_REPORT = -1;
|
||||
@ -79,6 +80,7 @@ class NoticeTypeDict
|
||||
self::TEMPLATE_AUDIT_STATUS_WAIT => get_lang('dict_sms_api.template_status_wait'),
|
||||
self::TEMPLATE_AUDIT_STATUS_PASS => get_lang('dict_sms_api.template_status_pass'),
|
||||
self::TEMPLATE_AUDIT_STATUS_REFUSE => get_lang('dict_sms_api.template_status_refuse'),
|
||||
self::TEMPLATE_NEED_PULL => get_lang('dict_sms_api.template_need_pull'),
|
||||
];
|
||||
return $type ? $data[$type] : $data;
|
||||
}
|
||||
|
||||
@ -44,7 +44,7 @@ class PayDict
|
||||
public const STATUS_FINISH = '2';//已支付
|
||||
|
||||
public const STATUS_AUDIT = '3';//待审核
|
||||
public const STATUS_CANCLE = '-1';//已取消
|
||||
public const STATUS_CANCEL = '-1';//已取消
|
||||
|
||||
public const MEMBER = 'member';
|
||||
public const USER = 'user';
|
||||
@ -112,7 +112,7 @@ class PayDict
|
||||
self::STATUS_WAIT => get_lang('dict_pay.status_wait'),
|
||||
self::STATUS_ING => get_lang('dict_pay.status_ing'),
|
||||
self::STATUS_FINISH => get_lang('dict_pay.status_finish'),
|
||||
self::STATUS_CANCLE => get_lang('dict_pay.status_cancle'),
|
||||
self::STATUS_CANCEL => get_lang('dict_pay.status_cancel'),
|
||||
self::STATUS_AUDIT => get_lang('dict_pay.status_audit')
|
||||
];
|
||||
}
|
||||
|
||||
@ -18,6 +18,7 @@ class RefundDict
|
||||
const DEALING = 'dealing';//退款处理中
|
||||
const WAIT = 'wait';//待退款
|
||||
const FAIL = 'fail';//失败
|
||||
const CANCEL = 'cancel';//取消
|
||||
|
||||
// 退款方式
|
||||
const WECHATPAY = 'wechatpay';//微信支付
|
||||
@ -38,6 +39,7 @@ class RefundDict
|
||||
self::DEALING => get_lang('dict_pay_refund.status_dealing'),
|
||||
self::SUCCESS => get_lang('dict_pay_refund.status_success'),
|
||||
self::FAIL => get_lang('dict_pay_refund.status_fail'),
|
||||
self::CANCEL => get_lang('dict_pay_refund.cancel'),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@ -129,7 +129,7 @@ class TransferDict
|
||||
|
||||
/**
|
||||
* 获取微信转账场景
|
||||
* @return void
|
||||
* @return array[]
|
||||
*/
|
||||
public static function getWechatTransferScene(){
|
||||
return [
|
||||
|
||||
@ -1,17 +1,6 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
[
|
||||
'key' => 'order_close',
|
||||
'name' => '未支付订单自动关闭',
|
||||
'desc' => '',
|
||||
'time' => [
|
||||
'type' => 'min',
|
||||
'min' => 1
|
||||
],
|
||||
'class' => '',
|
||||
'function' => ''
|
||||
],
|
||||
[
|
||||
'key' => 'site_expire_close',
|
||||
'name' => '站点到期自动关闭',
|
||||
@ -37,6 +26,18 @@ return [
|
||||
],
|
||||
'class' => 'app\job\schedule\AutoClearScheduleLog',
|
||||
'function' => ''
|
||||
], [
|
||||
'key' => 'auto_clear_poster_qrcode',
|
||||
'name' => '定时清理海报及二维码数据',
|
||||
'desc' => '',
|
||||
'time' => [
|
||||
'type' => 'day',
|
||||
'day' => 1,
|
||||
'hour' => 1,
|
||||
'min' => 1
|
||||
],
|
||||
'class' => 'app\job\schedule\AutoClearPosterAndQrcode',
|
||||
'function' => ''
|
||||
],
|
||||
[
|
||||
'key' => 'transfer_check_finish',
|
||||
|
||||
@ -39,5 +39,4 @@ class ConfigKeyDict
|
||||
public const WECHAT_TRANSFER_SCENE_CONFIG = 'WECHAT_TRANSFER_SCENE_CONFIG';//微信转账场景配置
|
||||
|
||||
public const SMS = 'SMS';//短信配置
|
||||
public const SHOP_THIRD_PARTY_DELIVERY_CONFIG = 'SHOP_THREE_PARTY_DELIVERY_CONFIG';//短信配置
|
||||
}
|
||||
|
||||
@ -668,6 +668,9 @@ CREATE TABLE `site` (
|
||||
`addons` text NOT NULL COMMENT '站点包含的插件',
|
||||
`initalled_addon` text DEFAULT NULL COMMENT '站点已执行初始化方法的插件',
|
||||
`site_domain` varchar(255) NOT NULL DEFAULT '' COMMENT '站点域名',
|
||||
`meta_title` VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'Meta 标题',
|
||||
`meta_desc` VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'Meta 描述',
|
||||
`meta_keyword` VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'Meta 关键字',
|
||||
PRIMARY KEY (`site_id`) USING BTREE
|
||||
) ENGINE = InnoDB AUTO_INCREMENT = 10000 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '站点表' ROW_FORMAT = Dynamic;
|
||||
|
||||
@ -803,7 +806,7 @@ CREATE TABLE `sys_backup_records`
|
||||
`id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
|
||||
`version` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '备份版本号',
|
||||
`backup_key` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '备份标识',
|
||||
`content` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '备份内容',
|
||||
`content` TEXT DEFAULT NULL COMMENT '备份内容',
|
||||
`status` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '状态',
|
||||
`fail_reason` LONGTEXT DEFAULT NULL COMMENT '失败原因',
|
||||
`remark` VARCHAR(500) NOT NULL DEFAULT '' COMMENT '备注',
|
||||
@ -1136,8 +1139,8 @@ CREATE TABLE `sys_user_log` (
|
||||
`ip` varchar(50) NOT NULL DEFAULT '' COMMENT '登录IP',
|
||||
`site_id` int(11) NOT NULL DEFAULT 0 COMMENT '站点id',
|
||||
`uid` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '管理员id',
|
||||
`username` varchar(64) NOT NULL DEFAULT '' COMMENT '管理员姓名',
|
||||
`operation` varchar(100) NOT NULL DEFAULT '' COMMENT '操作描述',
|
||||
`username` varchar(255) NOT NULL DEFAULT '' COMMENT '管理员姓名',
|
||||
`operation` varchar(255) NOT NULL DEFAULT '' COMMENT '操作描述',
|
||||
`url` varchar(300) NOT NULL DEFAULT '' COMMENT '链接',
|
||||
`params` longtext DEFAULT NULL COMMENT '参数',
|
||||
`type` varchar(32) NOT NULL DEFAULT '' COMMENT '请求方式',
|
||||
|
||||
@ -11,8 +11,6 @@
|
||||
|
||||
namespace app\job\notice;
|
||||
|
||||
use app\dict\sys\ConfigKeyDict;
|
||||
use app\service\core\sys\CoreConfigService;
|
||||
use core\base\BaseJob;
|
||||
use core\exception\NoticeException;
|
||||
|
||||
|
||||
@ -23,7 +23,8 @@ class PayReturnTo extends BaseJob
|
||||
|
||||
/**
|
||||
* 消费
|
||||
* @param $data
|
||||
* @param $site_id
|
||||
* @param $out_trade_no
|
||||
* @return true
|
||||
*/
|
||||
protected function doJob($site_id, $out_trade_no)
|
||||
|
||||
124
niucloud/app/job/schedule/AutoClearPosterAndQrcode.php
Normal file
124
niucloud/app/job/schedule/AutoClearPosterAndQrcode.php
Normal file
@ -0,0 +1,124 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的saas管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\job\schedule;
|
||||
|
||||
use core\base\BaseJob;
|
||||
use think\facade\Log;
|
||||
|
||||
/**
|
||||
* 队列异步调用定时任务
|
||||
*/
|
||||
class AutoClearPosterAndQrcode extends BaseJob
|
||||
{
|
||||
|
||||
public function doJob()
|
||||
{
|
||||
Log::write('AutoClearPosterAndQrcode 定时清除 二维码及海报数据开始' . date('Y-m-d H:i:s'));
|
||||
try {
|
||||
// 清理海报目录
|
||||
$dir = 'upload/poster';
|
||||
$dir = public_path($dir);
|
||||
Log::write('AutoClearPosterAndQrcode尝试清理海报目录: ' . $dir);
|
||||
$res = $this->clearDirectory($dir);
|
||||
Log::write('AutoClearPosterAndQrcode海报目录清理结果: ' . ($res ? '成功' : '失败'));
|
||||
|
||||
// 清理二维码目录
|
||||
$qrcode_dir = 'upload/qrcode';
|
||||
$qrcode_dir = public_path($qrcode_dir);
|
||||
Log::write('AutoClearPosterAndQrcode尝试清理二维码目录: ' . $qrcode_dir);
|
||||
$res = $this->clearDirectory($qrcode_dir);
|
||||
Log::write('AutoClearPosterAndQrcode二维码目录清理结果: ' . ($res ? '成功' : '失败'));
|
||||
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
Log::write('AutoClearPosterAndQrcode 定时清除异常: ' . $e->getMessage() . ' 位置: ' . $e->getFile() . ':' . $e->getLine() . $e->getTraceAsString());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 清空指定目录下的所有文件和子目录
|
||||
*
|
||||
* @param string $directory 目录路径
|
||||
* @param bool $preserveDirectory 是否保留根目录(默认保留)
|
||||
* @return bool 是否成功执行
|
||||
*/
|
||||
function clearDirectory(string $directory, bool $preserveDirectory = true): bool
|
||||
{
|
||||
// 规范化目录路径,统一使用DIRECTORY_SEPARATOR
|
||||
$directory = rtrim(realpath($directory), DIRECTORY_SEPARATOR);
|
||||
|
||||
Log::write('AutoClearPosterAndQrcode开始清理目录: ' . $directory);
|
||||
|
||||
// 检查目录是否存在
|
||||
if (!is_dir($directory)) {
|
||||
Log::write('AutoClearPosterAndQrcode目录不存在或不是有效目录: ' . $directory);
|
||||
return false;
|
||||
}
|
||||
|
||||
// 打开目录
|
||||
$handle = opendir($directory);
|
||||
if (!$handle) {
|
||||
Log::write('AutoClearPosterAndQrcode无法打开目录: ' . $directory);
|
||||
return false;
|
||||
}
|
||||
|
||||
// 遍历目录内容
|
||||
while (($entry = readdir($handle)) !== false) {
|
||||
// 跳过当前目录和上级目录
|
||||
if ($entry === '.' || $entry === '..') {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 使用DIRECTORY_SEPARATOR确保路径分隔符正确
|
||||
$path = $directory . DIRECTORY_SEPARATOR . $entry;
|
||||
|
||||
// 递归处理子目录
|
||||
if (is_dir($path)) {
|
||||
// 递归清空子目录
|
||||
if (!$this->clearDirectory($path, false)) {
|
||||
Log::write('AutoClearPosterAndQrcode递归清理子目录失败: ' . $path);
|
||||
closedir($handle);
|
||||
return false;
|
||||
}
|
||||
Log::write('AutoClearPosterAndQrcode已递归删除子目录: ' . $path);
|
||||
// 子目录已经在递归调用中被删除,不需要再次删除
|
||||
} else {
|
||||
// 删除文件
|
||||
if (!unlink($path)) {
|
||||
Log::write('AutoClearPosterAndQrcode删除文件失败: ' . $path);
|
||||
closedir($handle);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 关闭目录句柄
|
||||
closedir($handle);
|
||||
|
||||
// 是否删除根目录本身
|
||||
if (!$preserveDirectory) {
|
||||
Log::write('AutoClearPosterAndQrcode准备删除根目录: ' . $directory);
|
||||
if (!rmdir($directory)) {
|
||||
Log::write('AutoClearPosterAndQrcode删除根目录失败: ' . $directory);
|
||||
return false;
|
||||
}
|
||||
Log::write('AutoClearPosterAndQrcode成功删除根目录: ' . $directory);
|
||||
} else {
|
||||
Log::write('AutoClearPosterAndQrcode保留根目录: ' . $directory);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -15,7 +15,6 @@ use app\dict\pay\TransferDict;
|
||||
use app\model\pay\Transfer;
|
||||
use app\service\core\pay\CoreTransferService;
|
||||
use core\base\BaseJob;
|
||||
use think\facade\Log;
|
||||
|
||||
/**
|
||||
* 定时校验转账是否完毕(每分钟一次)
|
||||
|
||||
@ -22,7 +22,8 @@ class GetVersionUploadResult extends BaseJob
|
||||
|
||||
/**
|
||||
* 消费
|
||||
* @param $data
|
||||
* @param $task_key
|
||||
* @param $is_all
|
||||
* @return true
|
||||
*/
|
||||
protected function doJob($task_key, $is_all)
|
||||
|
||||
@ -12,9 +12,7 @@
|
||||
namespace app\job\wxoplatform;
|
||||
|
||||
use app\service\admin\wxoplatform\WeappVersionService;
|
||||
use app\service\core\pay\CorePayService;
|
||||
use core\base\BaseJob;
|
||||
use think\facade\Log;
|
||||
|
||||
/**
|
||||
* 小程序代码上传
|
||||
@ -23,7 +21,8 @@ class SiteWeappCommit extends BaseJob
|
||||
{
|
||||
/**
|
||||
* 消费
|
||||
* @param $data
|
||||
* @param $site_id
|
||||
* @param $site_group_id
|
||||
* @return true
|
||||
*/
|
||||
protected function doJob($site_id, $site_group_id)
|
||||
|
||||
@ -22,7 +22,8 @@ class VersionUploadSuccess extends BaseJob
|
||||
|
||||
/**
|
||||
* 消费
|
||||
* @param $data
|
||||
* @param $task_key
|
||||
* @param $is_all
|
||||
* @return true
|
||||
*/
|
||||
protected function doJob($task_key, $is_all)
|
||||
|
||||
@ -11,10 +11,7 @@
|
||||
|
||||
namespace app\job\wxoplatform;
|
||||
|
||||
use app\service\admin\wxoplatform\WeappVersionService;
|
||||
use app\service\core\pay\CorePayService;
|
||||
use core\base\BaseJob;
|
||||
use think\facade\Log;
|
||||
|
||||
/**
|
||||
* 小程序授权变更之后
|
||||
@ -23,7 +20,8 @@ class WeappAuthChangeAfter extends BaseJob
|
||||
{
|
||||
/**
|
||||
* 消费
|
||||
* @param $data
|
||||
* @param $site_id
|
||||
* @param $event
|
||||
* @return true
|
||||
*/
|
||||
protected function doJob($site_id, $event)
|
||||
|
||||
@ -12,9 +12,7 @@
|
||||
namespace app\job\wxoplatform;
|
||||
|
||||
use app\service\admin\wxoplatform\WeappVersionService;
|
||||
use app\service\core\pay\CorePayService;
|
||||
use core\base\BaseJob;
|
||||
use think\facade\Log;
|
||||
|
||||
/**
|
||||
* 小程序代码上传
|
||||
|
||||
@ -11,10 +11,7 @@
|
||||
|
||||
namespace app\job\wxoplatform;
|
||||
|
||||
use app\service\admin\wxoplatform\WeappVersionService;
|
||||
use app\service\core\pay\CorePayService;
|
||||
use core\base\BaseJob;
|
||||
use think\facade\Log;
|
||||
|
||||
/**
|
||||
* 公众号授权变更之后
|
||||
@ -23,7 +20,8 @@ class WechatAuthChangeAfter extends BaseJob
|
||||
{
|
||||
/**
|
||||
* 消费
|
||||
* @param $data
|
||||
* @param $site_id
|
||||
* @param $event
|
||||
* @return true
|
||||
*/
|
||||
protected function doJob($site_id, $event)
|
||||
|
||||
@ -72,6 +72,7 @@ return [
|
||||
'MUST_LOGIN' => '请登录',
|
||||
'LOGIN_EXPIRE' => '登录过期,请重新登录',
|
||||
'LOGIN_STATE_ERROR' => '登录状态有误,请重新登录',
|
||||
'SITE_USER_NOT_EXIST' => '站点用户不存在',
|
||||
'USER_LOCK' => '账号被锁定',
|
||||
'USER_ERROR' => '账号或密码错误',
|
||||
'NO_SITE_PERMISSION' => '您没有当前站点的访问权限',
|
||||
@ -310,6 +311,7 @@ return [
|
||||
'NEED_TO_AUTHORIZE_FIRST' => '使用云服务需先进行授权',
|
||||
'WEAPP_UPLOADING' => '小程序有正在上传的版本,请等待上一版本上传完毕后再进行操作',
|
||||
'CLOUD_BUILD_TASK_EXIST' => '已有正在执行中的编译任务',
|
||||
'CONNECT_FAIL' => '连接失败',
|
||||
|
||||
//核销相关
|
||||
'VERIFY_TYPE_ERROR' => '核销类型错误',
|
||||
|
||||
@ -76,25 +76,26 @@ return [
|
||||
'var_balance' => '会员余额',
|
||||
'var_point' => '会员积分',
|
||||
],
|
||||
'dict_sms_api'=>[
|
||||
'template_status_again_report'=>'需重新报备',
|
||||
'template_status_need_edit'=>'需修改报备参数',
|
||||
'template_status_not_report'=>'未报备',
|
||||
'template_status_wait'=>'待审核',
|
||||
'template_status_pass'=>'审核通过',
|
||||
'template_status_refuse'=>'审核不通过',
|
||||
'dict_sms_api' => [
|
||||
'template_status_again_report' => '需重新报备',
|
||||
'template_status_need_edit' => '需修改报备参数',
|
||||
'template_status_not_report' => '未报备',
|
||||
'template_status_wait' => '待审核',
|
||||
'template_status_pass' => '审核通过',
|
||||
'template_status_refuse' => '审核不通过',
|
||||
'template_need_pull' => '需拉取同步',
|
||||
|
||||
//验证码-1 行业通知-2 营销推广-3
|
||||
'template_type_verify_code'=>'验证码',
|
||||
'template_type_industry_notice'=>'行业通知',
|
||||
'template_type_sem'=>'营销推广',
|
||||
'template_type_verify_code' => '验证码',
|
||||
'template_type_industry_notice' => '行业通知',
|
||||
'template_type_sem' => '营销推广',
|
||||
|
||||
'sign_audit_status_wait'=>'待审核',
|
||||
'sign_audit_status_pass'=>'审核通过',
|
||||
'sign_audit_status_refuse'=>'审核不通过',
|
||||
'sign_audit_status_wait' => '待审核',
|
||||
'sign_audit_status_pass' => '审核通过',
|
||||
'sign_audit_status_refuse' => '审核不通过',
|
||||
|
||||
'balance_add'=>'充值',
|
||||
'balance_reduce'=>'扣减'
|
||||
'balance_add' => '充值',
|
||||
'balance_reduce' => '扣减'
|
||||
],
|
||||
|
||||
//上传附件相关
|
||||
@ -131,6 +132,7 @@ return [
|
||||
'login_mobile' => '手机验证码登录',
|
||||
'login_wechat' => '微信公众号授权登录',
|
||||
'login_weapp' => '微信小程序授权登录',
|
||||
'login_pc' => '电脑端微信授权登录',
|
||||
'account_point_adjust' => '账户调整',
|
||||
'account_point_member_register' => '会员注册',
|
||||
'account_point_level_upgrade' => '升级礼包',
|
||||
@ -203,7 +205,7 @@ return [
|
||||
'status_wait' => '待支付',
|
||||
'status_ing' => '支付中',
|
||||
'status_finish' => '已支付',
|
||||
'status_cancle' => '已取消',
|
||||
'status_cancel' => '已取消',
|
||||
'status_audit' => '待审核',
|
||||
'pay' => '收款',
|
||||
'refund' => '退款',
|
||||
@ -340,6 +342,7 @@ return [
|
||||
'dealing' => '退款中',
|
||||
'wait' => '待退款',
|
||||
'fail' => '退款失败',
|
||||
'cancel' => '已取消',
|
||||
'wechatpay' => '微信原路退款',
|
||||
'alipay' => '支付宝原路退款',
|
||||
'unipay' => '银联原路退款',
|
||||
@ -445,22 +448,22 @@ return [
|
||||
'complete' => '完成',
|
||||
'fail' => '失败'
|
||||
],
|
||||
'common_active_short'=>[
|
||||
'impulse_buy_short'=>'顺',
|
||||
'impulse_buy_name'=>'顺手买',
|
||||
'gift_card_short'=>'礼',
|
||||
'gift_card_name'=>'礼品卡',
|
||||
'discount_short'=>'折',
|
||||
'discount_name'=>'限时折扣',
|
||||
'exchange_short'=>'积',
|
||||
'exchange_name'=>'积分商城',
|
||||
'manjiansong_short'=>'满减',
|
||||
'manjiansong_name'=>'满减送',
|
||||
'newcomer_discount_short'=>'新',
|
||||
'newcomer_discount_name'=>'新人专项',
|
||||
'pintuan_short'=>'拼',
|
||||
'pintuan_name'=>'拼团',
|
||||
'seckill_short'=>'秒',
|
||||
'seckill_name'=>'秒杀',
|
||||
'common_active_short' => [
|
||||
'impulse_buy_short' => '顺',
|
||||
'impulse_buy_name' => '顺手买',
|
||||
'gift_card_short' => '礼',
|
||||
'gift_card_name' => '礼品卡',
|
||||
'discount_short' => '折',
|
||||
'discount_name' => '限时折扣',
|
||||
'exchange_short' => '积',
|
||||
'exchange_name' => '积分商城',
|
||||
'manjiansong_short' => '满减',
|
||||
'manjiansong_name' => '满减送',
|
||||
'newcomer_discount_short' => '新',
|
||||
'newcomer_discount_name' => '新人专享',
|
||||
'pintuan_short' => '拼',
|
||||
'pintuan_name' => '拼团',
|
||||
'seckill_short' => '秒',
|
||||
'seckill_name' => '秒杀',
|
||||
]
|
||||
];
|
||||
|
||||
@ -11,7 +11,6 @@
|
||||
|
||||
namespace app\listener\diy_form_export;
|
||||
|
||||
use app\model\diy_form\DiyFormRecords;
|
||||
use app\model\diy_form\DiyFormRecordsFields;
|
||||
use app\service\admin\diy_form\DiyFormService;
|
||||
|
||||
@ -34,7 +33,7 @@ class DiyFormRecordsFieldsExportDataListener
|
||||
$json_field_list = array_filter($field_list, function($v) { return in_array($v[ 'field_type' ], [ 'FormRadio', 'FormCheckbox', 'FormDateScope', 'FormTimeScope' ]); });
|
||||
|
||||
$records_field_model = new DiyFormRecordsFields();
|
||||
foreach ($simple_field_list as $k => &$v) {
|
||||
foreach ($simple_field_list as $k => $v) {
|
||||
$value_list = $records_field_model->field('form_id, field_key, field_type, field_name, field_value, count(*) as write_count')->where([
|
||||
[ 'site_id', '=', $site_id ],
|
||||
[ 'field_key', '=', $v[ 'field_key' ] ],
|
||||
@ -59,7 +58,7 @@ class DiyFormRecordsFieldsExportDataListener
|
||||
}
|
||||
$data = array_merge($data, $value_list);
|
||||
}
|
||||
foreach ($json_field_list as $k => &$v) {
|
||||
foreach ($json_field_list as $k => $v) {
|
||||
$field_list = $records_field_model->field('form_id, field_key, field_type, field_name, field_value')->where([
|
||||
[ 'site_id', '=', $site_id ],
|
||||
[ 'field_key', '=', $v[ 'field_key' ] ],
|
||||
@ -68,7 +67,7 @@ class DiyFormRecordsFieldsExportDataListener
|
||||
|
||||
$total_count = 0;
|
||||
$value_list = [];
|
||||
foreach ($field_list as $k1 => &$v1) {
|
||||
foreach ($field_list as $k1 => $v1) {
|
||||
if ($v1[ 'field_type' ] != 'FormCheckbox') {
|
||||
$key = $v1[ 'field_key' ] . '_' . $v1[ 'render_value' ];
|
||||
if (isset($value_list[ $key ])) {
|
||||
|
||||
@ -32,6 +32,5 @@ class MemberAccountListener
|
||||
if ($account_log['account_type'] == MemberAccountTypeDict::GROWTH) {
|
||||
(new CoreMemberLevelService())->checkLevelUpgrade($account_log['site_id'], $account_log['member_id']);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@ -26,7 +26,6 @@ class MemberLoginListener
|
||||
{
|
||||
// 新人专享活动
|
||||
event("MemberLoginAfter", ['site_id' => $member['site_id'], 'member_id' => $member['member_id']]);
|
||||
return;
|
||||
|
||||
}
|
||||
}
|
||||
@ -32,6 +32,5 @@ class MemberRegisterListener
|
||||
CoreMemberService::sendPoint($member[ 'site_id' ], $member[ 'member_id' ], 'member_register', [ 'from_type' => 'member_register' ]);
|
||||
// 新人专享活动
|
||||
event("MemberLoginAfter", [ 'site_id' => $member[ 'site_id' ], 'member_id' => $member[ 'member_id' ] ]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@ -20,6 +20,5 @@ class PayNotifyListener
|
||||
{
|
||||
public function handle($member)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -58,7 +58,7 @@ class FriendspayPoster
|
||||
[ 'site_id', '=', $site_id ],
|
||||
[ 'trade_id', '=', $trade_id ],
|
||||
[ 'trade_type', '=', $trade_type ],
|
||||
[ 'status', '<>', PayDict::STATUS_CANCLE ],///不查询已取消的单据
|
||||
[ 'status', '<>', PayDict::STATUS_CANCEL ],///不查询已取消的单据
|
||||
])->findOrEmpty()->toArray();
|
||||
|
||||
if (empty($pay_info)) return [];
|
||||
|
||||
@ -21,6 +21,5 @@ class AppInitListener
|
||||
public function handle()
|
||||
{
|
||||
//加载插件语言包
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -23,7 +23,6 @@ class Poster
|
||||
switch ($type) {
|
||||
case 'friendspay':// 找朋友帮忙付海报
|
||||
return ( new FriendspayPoster() )->handle($data);
|
||||
break;
|
||||
default:
|
||||
$site_id = $data[ 'site_id' ];
|
||||
$param = $data[ 'param' ];
|
||||
@ -53,7 +52,6 @@ class Poster
|
||||
'headimg' => $headimg,
|
||||
];
|
||||
return $return_data;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -21,7 +21,7 @@ class PosterType
|
||||
'type' => 'friendspay',
|
||||
'addon' => '',
|
||||
'name' => '找朋友帮忙付海报',
|
||||
'decs' => '找朋友帮忙付,分享后进入帮付页面',
|
||||
'desc' => '找朋友帮忙付,分享后进入帮付页面',
|
||||
'icon' => 'static/resource/images/poster/type_friendspay.png'
|
||||
],
|
||||
];
|
||||
|
||||
@ -44,6 +44,7 @@ class Dict extends BaseModel
|
||||
|
||||
/**
|
||||
* 搜索器:数据字典字典名称
|
||||
* @param $query
|
||||
* @param $value
|
||||
* @param $data
|
||||
*/
|
||||
@ -56,6 +57,7 @@ class Dict extends BaseModel
|
||||
|
||||
/**
|
||||
* 搜索器:数据字典字典关键词
|
||||
* @param $query
|
||||
* @param $value
|
||||
* @param $data
|
||||
*/
|
||||
|
||||
@ -11,8 +11,6 @@
|
||||
|
||||
namespace app\model\diy;
|
||||
|
||||
use app\dict\diy\PagesDict;
|
||||
use app\dict\diy\TemplateDict;
|
||||
use core\base\BaseModel;
|
||||
|
||||
|
||||
|
||||
@ -76,7 +76,7 @@ class DiyFormRecords extends BaseModel
|
||||
|
||||
/**
|
||||
* 搜索器:创建时间
|
||||
* @param $query
|
||||
* @param Query $query
|
||||
* @param $value
|
||||
* @param $data
|
||||
*/
|
||||
|
||||
@ -128,7 +128,7 @@ class MemberAccountLog extends BaseModel
|
||||
|
||||
/**
|
||||
* 关键词搜索
|
||||
* @param $query
|
||||
* @param Query $query
|
||||
* @param $value
|
||||
* @param $data
|
||||
*/
|
||||
|
||||
@ -11,7 +11,6 @@
|
||||
|
||||
namespace app\model\pay;
|
||||
|
||||
use app\dict\pay\TransferDict;
|
||||
use core\base\BaseModel;
|
||||
|
||||
/**
|
||||
|
||||
@ -12,7 +12,6 @@
|
||||
namespace app\model\site;
|
||||
|
||||
use app\dict\site\SiteDict;
|
||||
use app\model\addon\Addon;
|
||||
use core\base\BaseModel;
|
||||
use think\db\Query;
|
||||
use think\model\relation\HasOne;
|
||||
|
||||
@ -44,7 +44,7 @@ class SiteGroup extends BaseModel
|
||||
* 关联应用
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @return Addon[]|array|\think\Collection
|
||||
* @return Addon[]|array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
|
||||
@ -57,6 +57,7 @@ class SysPrinter extends BaseModel
|
||||
|
||||
/**
|
||||
* 搜索器:小票打印机
|
||||
* @param $query
|
||||
* @param $value
|
||||
* @param $data
|
||||
*/
|
||||
@ -69,6 +70,7 @@ class SysPrinter extends BaseModel
|
||||
|
||||
/**
|
||||
* 搜索器:小票打印机设备品牌(易联云,365,飞鹅)
|
||||
* @param $query
|
||||
* @param $value
|
||||
* @param $data
|
||||
*/
|
||||
@ -81,6 +83,7 @@ class SysPrinter extends BaseModel
|
||||
|
||||
/**
|
||||
* 搜索器:小票打印机打印机名称
|
||||
* @param $query
|
||||
* @param $value
|
||||
* @param $data
|
||||
*/
|
||||
@ -93,6 +96,7 @@ class SysPrinter extends BaseModel
|
||||
|
||||
/**
|
||||
* 搜索器:小票打印机状态(0,关闭,1:开启)
|
||||
* @param $query
|
||||
* @param $value
|
||||
* @param $data
|
||||
*/
|
||||
|
||||
@ -57,6 +57,7 @@ class SysPrinterTemplate extends BaseModel
|
||||
|
||||
/**
|
||||
* 搜索器:小票打印模板
|
||||
* @param $query
|
||||
* @param $value
|
||||
* @param $data
|
||||
*/
|
||||
@ -69,6 +70,7 @@ class SysPrinterTemplate extends BaseModel
|
||||
|
||||
/**
|
||||
* 搜索器:小票打印模板模板类型
|
||||
* @param $query
|
||||
* @param $value
|
||||
* @param $data
|
||||
*/
|
||||
@ -81,6 +83,7 @@ class SysPrinterTemplate extends BaseModel
|
||||
|
||||
/**
|
||||
* 搜索器:小票打印模板模板名称
|
||||
* @param $query
|
||||
* @param $value
|
||||
* @param $data
|
||||
*/
|
||||
|
||||
@ -47,7 +47,7 @@ class Verify extends BaseModel
|
||||
|
||||
/**
|
||||
* 核销码搜索
|
||||
* @param $query
|
||||
* @param Query $query
|
||||
* @param $value
|
||||
* @param $data
|
||||
*/
|
||||
@ -60,7 +60,7 @@ class Verify extends BaseModel
|
||||
|
||||
/**
|
||||
* 关键词搜索
|
||||
* @param $query
|
||||
* @param Query $query
|
||||
* @param $value
|
||||
* @param $data
|
||||
*/
|
||||
@ -134,6 +134,7 @@ class Verify extends BaseModel
|
||||
/**
|
||||
* 核销类型转换
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @return void
|
||||
*/
|
||||
public function getTypeNameAttr($value, $data)
|
||||
|
||||
@ -24,15 +24,16 @@ use core\base\BaseAdminService;
|
||||
*/
|
||||
class AddonDevelopService extends BaseAdminService
|
||||
{
|
||||
public $core_addon_develop_service;
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增插件开发
|
||||
* @param string $key
|
||||
* @param array $data
|
||||
* @return mixed
|
||||
* @return true
|
||||
*/
|
||||
public function add(string $key, array $data)
|
||||
{
|
||||
@ -41,9 +42,9 @@ class AddonDevelopService extends BaseAdminService
|
||||
|
||||
/**
|
||||
* 编辑插件开发
|
||||
* @param int $id
|
||||
* @param string $key
|
||||
* @param array $data
|
||||
* @return SysAttachment
|
||||
* @return true
|
||||
*/
|
||||
public function edit(string $key, array $data)
|
||||
{
|
||||
@ -53,8 +54,8 @@ class AddonDevelopService extends BaseAdminService
|
||||
|
||||
/**
|
||||
* 删除插件开发
|
||||
* @param int $id
|
||||
* @return mixed
|
||||
* @param string $key
|
||||
* @return true
|
||||
*/
|
||||
public function del(string $key)
|
||||
{
|
||||
@ -74,7 +75,7 @@ class AddonDevelopService extends BaseAdminService
|
||||
/**
|
||||
* 查询
|
||||
* @param $key
|
||||
* @return void
|
||||
* @return array
|
||||
*/
|
||||
public function getInfo($key){
|
||||
return (new CoreAddonService())->getAddonDevelopInfo($key);
|
||||
@ -83,7 +84,7 @@ class AddonDevelopService extends BaseAdminService
|
||||
/**
|
||||
* 打包
|
||||
* @param string $key
|
||||
* @return array
|
||||
* @return true|null
|
||||
*/
|
||||
public function build(string $key){
|
||||
return (new CoreAddonDevelopBuildService())->build($key);
|
||||
@ -93,7 +94,7 @@ class AddonDevelopService extends BaseAdminService
|
||||
/**
|
||||
* 下载
|
||||
* @param string $key
|
||||
* @return true
|
||||
* @return \think\response\File
|
||||
*/
|
||||
public function download(string $key){
|
||||
return (new CoreAddonDevelopBuildService())->download($key);
|
||||
|
||||
@ -13,21 +13,15 @@ namespace app\service\admin\addon;
|
||||
|
||||
|
||||
use app\dict\addon\AddonDict;
|
||||
use app\dict\sys\AppTypeDict;
|
||||
use app\model\addon\Addon;
|
||||
use app\service\admin\site\SiteGroupService;
|
||||
use app\service\admin\site\SiteService;
|
||||
use app\service\core\addon\CoreAddonCloudService;
|
||||
use app\service\core\addon\CoreAddonDownloadService;
|
||||
use app\service\core\addon\CoreAddonInstallService;
|
||||
use app\service\core\addon\CoreAddonService;
|
||||
use app\service\core\niucloud\CoreModuleService;
|
||||
use app\service\core\site\CoreSiteService;
|
||||
use core\base\BaseAdminService;
|
||||
use core\exception\CommonException;
|
||||
use Exception;
|
||||
use think\db\exception\DbException;
|
||||
use think\Response;
|
||||
|
||||
|
||||
/**
|
||||
@ -36,14 +30,17 @@ use think\Response;
|
||||
class AddonService extends BaseAdminService
|
||||
{
|
||||
public static $cache_tag_name = 'addon_cache';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->model = new Addon();
|
||||
|
||||
}
|
||||
public function getList(){
|
||||
return (new CoreAddonService())->getLocalAddonList();
|
||||
|
||||
public function getList()
|
||||
{
|
||||
return ( new CoreAddonService() )->getLocalAddonList();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -52,7 +49,7 @@ class AddonService extends BaseAdminService
|
||||
*/
|
||||
public function getLocalAddonList()
|
||||
{
|
||||
return (new CoreAddonService())->getLocalAddonList();
|
||||
return ( new CoreAddonService() )->getLocalAddonList();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -112,9 +109,10 @@ class AddonService extends BaseAdminService
|
||||
|
||||
/**
|
||||
* @param string $addon
|
||||
* @return void
|
||||
* @return array|array[]|null
|
||||
*/
|
||||
public function uninstallCheck(string $addon) {
|
||||
public function uninstallCheck(string $addon)
|
||||
{
|
||||
return ( new CoreAddonInstallService($addon) )->uninstallCheck();
|
||||
}
|
||||
|
||||
@ -135,7 +133,7 @@ class AddonService extends BaseAdminService
|
||||
*/
|
||||
public function getPage(array $where = [])
|
||||
{
|
||||
return (new CoreAddonService())->getPage($where);
|
||||
return ( new CoreAddonService() )->getPage($where);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -145,7 +143,7 @@ class AddonService extends BaseAdminService
|
||||
*/
|
||||
public function getInfo(int $id)
|
||||
{
|
||||
return (new CoreAddonService())->getInfo($id);
|
||||
return ( new CoreAddonService() )->getInfo($id);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -153,8 +151,9 @@ class AddonService extends BaseAdminService
|
||||
* @param int $id
|
||||
* @param int $status
|
||||
*/
|
||||
public function setStatus(int $id, int $status){
|
||||
return (new CoreAddonService())->setStatus($id, $status);
|
||||
public function setStatus(int $id, int $status)
|
||||
{
|
||||
return ( new CoreAddonService() )->setStatus($id, $status);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -162,9 +161,10 @@ class AddonService extends BaseAdminService
|
||||
* @param string $app_key
|
||||
* @return true
|
||||
*/
|
||||
public function download(string $app_key, string $version){
|
||||
public function download(string $app_key, string $version)
|
||||
{
|
||||
if (empty($version)) throw new CommonException('ADDON_DOWNLOAD_VERSION_EMPTY');
|
||||
return (new CoreAddonDownloadService())->download($app_key, $version);
|
||||
return ( new CoreAddonDownloadService() )->download($app_key, $version);
|
||||
}
|
||||
|
||||
|
||||
@ -172,8 +172,9 @@ class AddonService extends BaseAdminService
|
||||
* 查询已安装应用
|
||||
* @return array
|
||||
*/
|
||||
public function getInstallList(){
|
||||
return (new CoreAddonService())->getInstallAddonList();
|
||||
public function getInstallList()
|
||||
{
|
||||
return ( new CoreAddonService() )->getInstallAddonList();
|
||||
}
|
||||
|
||||
|
||||
@ -185,12 +186,14 @@ class AddonService extends BaseAdminService
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function getAddonListBySiteId(int $site_id){
|
||||
public function getAddonListBySiteId(int $site_id)
|
||||
{
|
||||
$addon_keys = $this->getAddonKeysBySiteId($site_id);
|
||||
return $this->getAddonListByKeys($addon_keys);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 应用key缓存
|
||||
* @param $keys
|
||||
@ -199,15 +202,16 @@ class AddonService extends BaseAdminService
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function getAddonListByKeys($keys){
|
||||
public function getAddonListByKeys($keys)
|
||||
{
|
||||
sort($keys);
|
||||
$cache_name = 'addon_list'.implode('_', $keys);
|
||||
$cache_name = 'addon_list' . implode('_', $keys);
|
||||
return cache_remember(
|
||||
$cache_name,
|
||||
function () use ($keys) {
|
||||
$where = [
|
||||
['key', 'in', $keys],
|
||||
['status', '=', AddonDict::ON]
|
||||
[ 'key', 'in', $keys ],
|
||||
[ 'status', '=', AddonDict::ON ]
|
||||
];
|
||||
return $this->model->where($where)->field('title, icon, key, desc, status, cover')->select()->toArray();
|
||||
|
||||
@ -221,13 +225,14 @@ class AddonService extends BaseAdminService
|
||||
* @param int $site_id
|
||||
* @return array
|
||||
*/
|
||||
public function getAddonKeysBySiteId(int $site_id){
|
||||
return (new CoreSiteService())->getAddonKeysBySiteId($site_id);
|
||||
public function getAddonKeysBySiteId(int $site_id)
|
||||
{
|
||||
return ( new CoreSiteService() )->getAddonKeysBySiteId($site_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取插件信息
|
||||
* @param int $id
|
||||
* @param string $key
|
||||
* @return array
|
||||
*/
|
||||
public function getInfoByKey(string $key)
|
||||
|
||||
@ -50,7 +50,12 @@ class AuthSiteService extends BaseAdminService
|
||||
* 通过站点id获取菜单列表
|
||||
* @param int $is_tree
|
||||
* @param int|string $status
|
||||
* @param string $addon
|
||||
* @param int $is_button
|
||||
* @return mixed
|
||||
* @throws DataNotFoundException
|
||||
* @throws DbException
|
||||
* @throws ModelNotFoundException
|
||||
*/
|
||||
public function getMenuList(int $is_tree, $status, $addon = 'all', int $is_button = 1)
|
||||
{
|
||||
|
||||
@ -15,14 +15,11 @@ use app\dict\sys\AppTypeDict;
|
||||
use app\model\sys\SysUser;
|
||||
use app\model\sys\SysUserRole;
|
||||
use app\service\admin\captcha\CaptchaService;
|
||||
use app\service\admin\site\SiteService;
|
||||
use app\service\admin\user\UserRoleService;
|
||||
use app\service\admin\user\UserService;
|
||||
use app\service\core\sys\CoreConfigService;
|
||||
use core\base\BaseAdminService;
|
||||
use core\exception\AuthException;
|
||||
use core\util\TokenAuth;
|
||||
use Exception;
|
||||
use Throwable;
|
||||
use app\service\admin\home\AuthSiteService as HomeAuthSiteService;
|
||||
|
||||
@ -90,20 +87,34 @@ class LoginService extends BaseAdminService
|
||||
$app_type = AppTypeDict::SITE;
|
||||
}
|
||||
} else if($app_type == AppTypeDict::SITE){
|
||||
$auth_site_service = new \app\service\admin\home\AuthSiteService();
|
||||
$site_user = $auth_site_service->checkSiteUserAccount();
|
||||
|
||||
if ($site_user->isEmpty()) {
|
||||
throw new AuthException('SITE_USER_NOT_EXIST');
|
||||
}
|
||||
|
||||
$site_ids = $auth_site_service->getSiteIds();
|
||||
if(!empty($site_ids)){
|
||||
|
||||
if(empty($site_ids)){
|
||||
throw new AuthException('USER_LOCK');
|
||||
}else{
|
||||
$default_site_id = in_array($this->site_id, $site_ids) || AuthService::isSuperAdmin() ? $this->site_id : $site_ids[0];
|
||||
}
|
||||
if (!empty($default_site_id)) {
|
||||
$userrole = $user_role_service->getUserRole($default_site_id, $userinfo->uid);
|
||||
if (!empty($userrole)) {
|
||||
if (!$userrole['status']) throw new AuthException('USER_LOCK');
|
||||
if (!$userrole['is_admin']) {
|
||||
$rules = $user_role_service->getRoleByUserRoleIds($userrole['role_ids'], $default_site_id);
|
||||
if (empty($rules) || count($rules) == 0) throw new AuthException('USER_LOCK');
|
||||
}
|
||||
}
|
||||
}
|
||||
// $site_ids = $auth_site_service->getSiteIds();
|
||||
// if(!empty($site_ids)){
|
||||
// $default_site_id = in_array($this->site_id, $site_ids) || AuthService::isSuperAdmin() ? $this->site_id : $site_ids[0];
|
||||
// }
|
||||
// if (!empty($default_site_id)) {
|
||||
// $userrole = $user_role_service->getUserRole($default_site_id, $userinfo->uid);
|
||||
// if (!empty($userrole)) {
|
||||
// if (!$userrole['status']) throw new AuthException('USER_LOCK');
|
||||
// if (!$userrole['is_admin']) {
|
||||
// $rules = $user_role_service->getRoleByUserRoleIds($userrole['role_ids'], $default_site_id);
|
||||
// if (empty($rules) || count($rules) == 0) throw new AuthException('USER_LOCK');
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
} else {
|
||||
throw new AuthException('APP_TYPE_NOT_EXIST');
|
||||
}
|
||||
|
||||
@ -13,6 +13,9 @@ namespace app\service\admin\dict;
|
||||
|
||||
use app\model\dict\Dict;
|
||||
use core\base\BaseAdminService;
|
||||
use think\db\exception\DataNotFoundException;
|
||||
use think\db\exception\DbException;
|
||||
use think\db\exception\ModelNotFoundException;
|
||||
|
||||
|
||||
/**
|
||||
@ -99,8 +102,10 @@ class DictService extends BaseAdminService
|
||||
|
||||
/**
|
||||
* 获取全部数据字典
|
||||
* @param array $where
|
||||
* @return array
|
||||
* @throws DataNotFoundException
|
||||
* @throws DbException
|
||||
* @throws ModelNotFoundException
|
||||
*/
|
||||
public function getAll()
|
||||
{
|
||||
|
||||
@ -28,7 +28,7 @@ class DiyConfigService extends BaseAdminService
|
||||
/**
|
||||
* 获取底部导航列表
|
||||
* @param array $params
|
||||
* @return array|mixed
|
||||
* @return array
|
||||
*/
|
||||
public function getBottomList($params = [])
|
||||
{
|
||||
|
||||
@ -29,7 +29,6 @@ use think\db\exception\DataNotFoundException;
|
||||
use think\db\exception\DbException;
|
||||
use think\db\exception\ModelNotFoundException;
|
||||
use think\facade\Db;
|
||||
use think\facade\Log;
|
||||
|
||||
/**
|
||||
* 自定义页面服务层
|
||||
@ -62,26 +61,43 @@ class DiyService extends BaseAdminService
|
||||
/**
|
||||
* 获取自定义页面分页列表,轮播搜索组件用
|
||||
* 查询微页面,数据排除存在轮播搜索组件的
|
||||
* @param array $where
|
||||
* @return array
|
||||
* @throws DbException
|
||||
*/
|
||||
public function getPageByCarouselSearch()
|
||||
{
|
||||
$field = 'id,site_id,title,page_title,name,template,type,mode,is_default,share,visit_count,create_time,update_time,value';
|
||||
$field = 'id,title,page_title,name,type,create_time,value';
|
||||
$order = "update_time desc";
|
||||
$search_model = $this->model->whereOr([
|
||||
[
|
||||
[ 'type', '=', 'DIY_PAGE' ],
|
||||
[ 'site_id', '=', $this->site_id ],
|
||||
[ 'value', 'not in', [ 'top_fixed', 'right_fixed', 'bottom_fixed', 'left_fixed', 'fixed' ] ]
|
||||
],
|
||||
[
|
||||
[ 'type', '<>', 'DIY_PAGE' ],
|
||||
[ 'site_id', '=', $this->site_id ],
|
||||
[ 'is_default', '=', 0 ],
|
||||
[ 'value', 'not in', [ 'top_fixed', 'right_fixed', 'bottom_fixed', 'left_fixed', 'fixed' ] ]
|
||||
]
|
||||
])->field($field)->order($order)->append([ 'type_name', 'type_page', 'addon_name' ]);
|
||||
$search_model = $this->model
|
||||
->whereOr([
|
||||
[
|
||||
[ 'type', '=', 'DIY_PAGE' ],
|
||||
[ 'site_id', '=', $this->site_id ],
|
||||
[ 'value', 'not like',
|
||||
[
|
||||
'%"position":"top_fixed"%',
|
||||
'%"position":"right_fixed"%',
|
||||
'%"position":"bottom_fixed"%',
|
||||
'%"position":"left_fixed"%',
|
||||
'%"position":"fixed"%'
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
[ 'type', '<>', 'DIY_PAGE' ],
|
||||
[ 'site_id', '=', $this->site_id ],
|
||||
[ 'is_default', '=', 0 ],
|
||||
[ 'value', 'not like',
|
||||
[
|
||||
'%"position":"top_fixed"%',
|
||||
'%"position":"right_fixed"%',
|
||||
'%"position":"bottom_fixed"%',
|
||||
'%"position":"left_fixed"%',
|
||||
'%"position":"fixed"%'
|
||||
]
|
||||
]
|
||||
]
|
||||
])->field($field)->order($order)->append([ 'type_name', 'type_page', 'addon_name' ]);
|
||||
return $this->pageQuery($search_model);
|
||||
}
|
||||
|
||||
@ -326,6 +342,17 @@ class DiyService extends BaseAdminService
|
||||
$data[ 'component' ] = $this->getComponentList($data[ 'type' ]);
|
||||
$data[ 'domain_url' ] = ( new SystemService() )->getUrl();
|
||||
|
||||
$diy_template = [];
|
||||
if (!empty($data[ 'name' ])) {
|
||||
$diy_template = TemplateDict::getTemplate([
|
||||
'key' => [ $data[ 'name' ] ]
|
||||
]);
|
||||
if (!empty($diy_template)) {
|
||||
$diy_template = $diy_template[ $data[ 'name' ] ];
|
||||
}
|
||||
}
|
||||
$data[ 'global' ] = $diy_template[ 'global' ] ?? [];
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
@ -337,11 +364,27 @@ class DiyService extends BaseAdminService
|
||||
public function getComponentList(string $name = '')
|
||||
{
|
||||
$data = ComponentDict::getComponent();
|
||||
|
||||
$diy_template = [];
|
||||
if (!empty($name)) {
|
||||
$diy_template = TemplateDict::getTemplate([
|
||||
'key' => [ $name ]
|
||||
]);
|
||||
if (!empty($diy_template)) {
|
||||
$diy_template = $diy_template[ $name ];
|
||||
}
|
||||
}
|
||||
foreach ($data as $k => $v) {
|
||||
// 查询组件支持的页面
|
||||
$sort_arr = [];
|
||||
foreach ($v[ 'list' ] as $ck => $cv) {
|
||||
$support_page = $cv[ 'support_page' ];
|
||||
// 过滤忽略组件名单
|
||||
if (!empty($name) && !empty($diy_template) && isset($diy_template[ 'ignoreComponents' ]) && in_array($ck, $diy_template[ 'ignoreComponents' ])) {
|
||||
unset($data[ $k ][ 'list' ][ $ck ]);
|
||||
continue;
|
||||
}
|
||||
// 过滤页面不支持的组件
|
||||
if (!( count($support_page) == 0 || in_array($name, $support_page) )) {
|
||||
unset($data[ $k ][ 'list' ][ $ck ]);
|
||||
continue;
|
||||
@ -350,6 +393,10 @@ class DiyService extends BaseAdminService
|
||||
$sort_arr [] = $cv[ 'sort' ];
|
||||
unset($data[ $k ][ 'list' ][ $ck ][ 'sort' ], $data[ $k ][ 'list' ][ $ck ][ 'support_page' ]);
|
||||
}
|
||||
if (empty($data[ $k ][ 'list' ])) {
|
||||
unset($data[ $k ]);
|
||||
continue;
|
||||
}
|
||||
array_multisort($sort_arr, SORT_ASC, $data[ $k ][ 'list' ]); //排序,根据 sort 排序
|
||||
}
|
||||
|
||||
|
||||
@ -32,7 +32,6 @@ use think\db\exception\DataNotFoundException;
|
||||
use think\db\exception\DbException;
|
||||
use think\db\exception\ModelNotFoundException;
|
||||
use think\facade\Db;
|
||||
use think\facade\Log;
|
||||
|
||||
/**
|
||||
* 万能表单服务层
|
||||
@ -112,7 +111,7 @@ class DiyFormService extends BaseAdminService
|
||||
* 获取万能表单信息
|
||||
* @param int $form_id
|
||||
* @param string $field
|
||||
* @return mixed
|
||||
* @return array
|
||||
*/
|
||||
public function getInfo(int $form_id, $field = 'form_id, page_title, title, type, status, value, addon, share, write_num,template')
|
||||
{
|
||||
@ -122,7 +121,7 @@ class DiyFormService extends BaseAdminService
|
||||
/**
|
||||
* 获取万能表单数量
|
||||
* @param array $where
|
||||
* @return mixed
|
||||
* @return int
|
||||
*/
|
||||
public function getCount(array $where = [])
|
||||
{
|
||||
@ -551,7 +550,7 @@ class DiyFormService extends BaseAdminService
|
||||
/**
|
||||
* 修改状态
|
||||
* @param $data
|
||||
* @return Bool
|
||||
* @return DiyForm
|
||||
*/
|
||||
public function modifyStatus($data)
|
||||
{
|
||||
@ -627,8 +626,10 @@ class DiyFormService extends BaseAdminService
|
||||
* 获取万能表单字段列表
|
||||
* @param array $where
|
||||
* @param string $field
|
||||
* @param string $order
|
||||
* @return mixed
|
||||
* @return array
|
||||
* @throws DataNotFoundException
|
||||
* @throws DbException
|
||||
* @throws ModelNotFoundException
|
||||
*/
|
||||
public function getFieldsList($where = [], $field = 'field_id, form_id, field_key, field_type, field_name, field_remark, write_num, field_required, field_hidden, field_unique, privacy_protection, create_time, update_time')
|
||||
{
|
||||
|
||||
@ -435,7 +435,7 @@ class WebEditGenerator extends BaseGenerator
|
||||
|
||||
/**
|
||||
* 获取文件生成到插件中
|
||||
* @return void
|
||||
* @return string
|
||||
*/
|
||||
public function getAddonObjectOutDir() {
|
||||
$dir = $this->rootDir . DIRECTORY_SEPARATOR.'niucloud'.DIRECTORY_SEPARATOR.'addon'.DIRECTORY_SEPARATOR.$this->addonName.DIRECTORY_SEPARATOR.'admin'.DIRECTORY_SEPARATOR.'views'.DIRECTORY_SEPARATOR. $this->moduleName . DIRECTORY_SEPARATOR.'components'.DIRECTORY_SEPARATOR;
|
||||
@ -492,7 +492,7 @@ class WebEditGenerator extends BaseGenerator
|
||||
|
||||
/**
|
||||
* 调用字典方法
|
||||
* @return void
|
||||
* @return string
|
||||
*/
|
||||
public function getDictList()
|
||||
{
|
||||
@ -518,7 +518,7 @@ class WebEditGenerator extends BaseGenerator
|
||||
|
||||
/**
|
||||
* 调用远程下拉方法
|
||||
* @return void
|
||||
* @return string
|
||||
*/
|
||||
public function getModelData()
|
||||
{
|
||||
@ -542,7 +542,7 @@ class WebEditGenerator extends BaseGenerator
|
||||
|
||||
/**
|
||||
* 编辑远程下拉方法
|
||||
* @return void
|
||||
* @return string
|
||||
*/
|
||||
public function getEditWithApiPath()
|
||||
{
|
||||
@ -559,7 +559,7 @@ class WebEditGenerator extends BaseGenerator
|
||||
|
||||
/**
|
||||
* 增加关联方法
|
||||
* @return void
|
||||
* @return string
|
||||
*/
|
||||
public function getWithApiPath()
|
||||
{
|
||||
|
||||
@ -505,7 +505,7 @@ class WebEditPageGenerator extends BaseGenerator
|
||||
|
||||
/**
|
||||
* 调用远程下拉方法
|
||||
* @return void
|
||||
* @return string
|
||||
*/
|
||||
public function getModelData()
|
||||
{
|
||||
@ -528,7 +528,7 @@ class WebEditPageGenerator extends BaseGenerator
|
||||
|
||||
/**
|
||||
* 编辑远程下拉方法
|
||||
* @return void
|
||||
* @return string
|
||||
*/
|
||||
public function getEditWithApiPath()
|
||||
{
|
||||
|
||||
@ -539,7 +539,7 @@ class WebIndexGenerator extends BaseGenerator
|
||||
|
||||
/**
|
||||
* 增加关联方法
|
||||
* @return void
|
||||
* @return string
|
||||
*/
|
||||
public function getWithApiPath()
|
||||
{
|
||||
@ -556,7 +556,7 @@ class WebIndexGenerator extends BaseGenerator
|
||||
|
||||
/**
|
||||
* 调用远程下拉方法
|
||||
* @return void
|
||||
* @return string
|
||||
*/
|
||||
public function getModelData()
|
||||
{
|
||||
|
||||
@ -13,19 +13,15 @@ namespace app\service\admin\home;
|
||||
|
||||
|
||||
use app\dict\addon\AddonDict;
|
||||
use app\dict\sys\AppTypeDict;
|
||||
use app\dict\sys\MenuTypeDict;
|
||||
use app\model\addon\Addon;
|
||||
use app\model\site\Site;
|
||||
use app\model\site\SiteGroup;
|
||||
use app\model\sys\SysMenu;
|
||||
use app\model\sys\SysUserRole;
|
||||
use app\model\sys\UserCreateSiteLimit;
|
||||
use app\service\admin\auth\AuthService;
|
||||
use app\service\admin\site\SiteGroupService;
|
||||
use app\service\admin\site\SiteService;
|
||||
use app\service\admin\sys\ConfigService;
|
||||
use app\service\admin\sys\RoleService;
|
||||
use core\base\BaseAdminService;
|
||||
use core\exception\CommonException;
|
||||
use core\exception\HomeException;
|
||||
@ -98,8 +94,10 @@ class AuthSiteService extends BaseAdminService
|
||||
|
||||
/**
|
||||
* 查询用户角色类表
|
||||
* @param int $uid
|
||||
* @return mixed|string
|
||||
* @throws DataNotFoundException
|
||||
* @throws DbException
|
||||
* @throws ModelNotFoundException
|
||||
*/
|
||||
public function getSiteIds(){
|
||||
$cache_name = 'user_role_list_'.$this->uid;
|
||||
@ -119,6 +117,19 @@ class AuthSiteService extends BaseAdminService
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测站点用户是否存在
|
||||
* @return Site|array|mixed|\think\Model
|
||||
*/
|
||||
public function checkSiteUserAccount()
|
||||
{
|
||||
$where = [
|
||||
['uid', '=', $this->uid],
|
||||
['site_id', '<>', request()->defaultSiteId()]
|
||||
];
|
||||
return (new SysUserRole())->where($where)->findOrEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑站点信息
|
||||
* @param int $site_id
|
||||
@ -199,7 +210,7 @@ class AuthSiteService extends BaseAdminService
|
||||
/**
|
||||
* 创建站点
|
||||
* @param array $data
|
||||
* @return void
|
||||
* @return true
|
||||
*/
|
||||
public function createSite(array $data) {
|
||||
if (!AuthService::isSuperAdmin()) {
|
||||
|
||||
@ -15,7 +15,6 @@ use app\model\member\MemberAddress;
|
||||
use app\service\admin\sys\AreaService;
|
||||
use app\service\core\member\CoreMemberAddressService;
|
||||
use core\base\BaseAdminService;
|
||||
use core\exception\AdminException;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user