mirror of
https://gitee.com/niucloud-team/niucloud-admin.git
synced 2026-03-17 11:13:43 +00:00
update niucloud
This commit is contained in:
parent
07292e4188
commit
c1e13b7b46
@ -57,7 +57,7 @@ class Request extends \think\Request
|
||||
$filter_rule = [
|
||||
"/<(\\/?)(script|i?frame|style|html|body|title|link|metaf|alert|font|object|\\?|\\%)([^>]*?)>/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);
|
||||
}
|
||||
|
||||
@ -13,7 +13,6 @@ namespace app\adminapi\controller\addon;
|
||||
|
||||
use app\dict\addon\AddonDict;
|
||||
use app\service\admin\addon\AddonDevelopService;
|
||||
use app\service\admin\niucloud\AppService;
|
||||
use core\base\BaseAdminController;
|
||||
use think\Response;
|
||||
|
||||
|
||||
@ -32,20 +32,6 @@ class Auth extends BaseAdminController
|
||||
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
|
||||
@ -85,15 +71,4 @@ class Auth extends BaseAdminController
|
||||
( new AuthService() )->editAuth($data);
|
||||
return success('MODIFY_SUCCESS');
|
||||
}
|
||||
|
||||
/**
|
||||
* 授权应用加星
|
||||
*/
|
||||
public function setStar(){
|
||||
$data = $this->request->params([
|
||||
['key', ''],
|
||||
]);
|
||||
(new AuthService())->setAddonStat($data['key']);
|
||||
return success('SUCCESS');
|
||||
}
|
||||
}
|
||||
|
||||
@ -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\menu\CoreMenuService;
|
||||
use core\base\BaseAdminController;
|
||||
use think\Response;
|
||||
|
||||
@ -60,8 +59,4 @@ class Login extends BaseAdminController
|
||||
{
|
||||
return success(( new ConfigService() )->getConfig());
|
||||
}
|
||||
|
||||
public function test() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,7 +15,6 @@ use app\dict\member\MemberDict;
|
||||
use app\dict\member\MemberRegisterChannelDict;
|
||||
use app\dict\member\MemberRegisterTypeDict;
|
||||
use app\service\admin\member\MemberService;
|
||||
use app\service\core\sys\CoreExportService;
|
||||
use core\base\BaseAdminController;
|
||||
use think\db\exception\DataNotFoundException;
|
||||
use think\db\exception\DbException;
|
||||
|
||||
@ -94,21 +94,6 @@ class Notice extends BaseAdminController
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 消息列表
|
||||
* @return Response
|
||||
*/
|
||||
public function getLogList()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
['key', ''],
|
||||
['receiver', ''],
|
||||
]);
|
||||
|
||||
$res = (new NoticeService())->getLogPage($data);
|
||||
return success($res);
|
||||
}
|
||||
|
||||
/**
|
||||
* 消息修改
|
||||
* @return Response
|
||||
|
||||
@ -134,46 +134,6 @@ class Config extends BaseAdminController
|
||||
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));
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置快捷菜单
|
||||
*/
|
||||
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
|
||||
* @return Response
|
||||
|
||||
@ -190,7 +190,7 @@ class Poster extends BaseAdminController
|
||||
] ], // 数据参数
|
||||
[ 'channel', 'h5' ]
|
||||
]);
|
||||
return success(data: poster($this->request->siteId(), ...$data));
|
||||
return success(data: poster(...$data));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
279
niucloud/app/adminapi/controller/sys/Printer.php
Normal file
279
niucloud/app/adminapi/controller/sys/Printer.php
Normal 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' ]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -50,6 +50,17 @@ class User extends BaseAdminController
|
||||
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
|
||||
|
||||
@ -13,7 +13,6 @@ namespace app\adminapi\controller\weapp;
|
||||
|
||||
use app\service\admin\weapp\WeappDeliveryService;
|
||||
use core\base\BaseAdminController;
|
||||
use think\Response;
|
||||
|
||||
/**
|
||||
* 小程序发货信息管理服务
|
||||
|
||||
@ -13,7 +13,6 @@ namespace app\adminapi\controller\weapp;
|
||||
|
||||
use app\service\admin\weapp\WeappVersionService;
|
||||
use core\base\BaseAdminController;
|
||||
use Exception;
|
||||
use think\Response;
|
||||
|
||||
/**
|
||||
|
||||
@ -24,8 +24,6 @@ Route::group('auth', function () {
|
||||
/***************************************************** 授权信息 ****************************************************/
|
||||
//授权用户站点菜单
|
||||
Route::get('authmenu', 'auth.Auth/authMenuList');
|
||||
//授权用户站点应用
|
||||
Route::get('authaddon', 'auth.Auth/getAuthAddonList');
|
||||
//授权用户信息
|
||||
Route::get('get', 'auth.Auth/get');
|
||||
//授权用户信息
|
||||
|
||||
@ -16,7 +16,6 @@ use app\adminapi\middleware\AdminCheckToken;
|
||||
use app\adminapi\middleware\AdminLog;
|
||||
|
||||
|
||||
// USER_CODE_BEGIN -- sys_dict
|
||||
Route::group('dict', function () {
|
||||
|
||||
//数据字典列表
|
||||
@ -40,4 +39,3 @@ Route::group('dict', function () {
|
||||
AdminCheckRole::class,
|
||||
AdminLog::class
|
||||
]);
|
||||
// USER_CODE_END -- sys_dict
|
||||
|
||||
@ -54,7 +54,7 @@ Route::group('diy', function() {
|
||||
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');
|
||||
|
||||
@ -32,8 +32,6 @@ Route::group('notice', function () {
|
||||
Route::get('notice/sms/:sms_type', 'notice.Notice/smsConfig');
|
||||
//短信配置修改
|
||||
Route::put('notice/sms/:sms_type', 'notice.Notice/editSms');
|
||||
//消息发送记录
|
||||
Route::get('notice/log', 'notice.Notice/getLogList');
|
||||
//消息修改
|
||||
Route::post('notice/edit', 'notice.Notice/edit');
|
||||
|
||||
|
||||
@ -26,8 +26,6 @@ Route::group(function () {
|
||||
Route::get('captcha/create', 'login.Captcha/create');
|
||||
//一次校验验证码
|
||||
Route::get('captcha/check', 'login.Captcha/check');
|
||||
|
||||
Route::get('test', 'login.Login/test');
|
||||
});
|
||||
|
||||
//加载插件路由
|
||||
|
||||
@ -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
|
||||
]);
|
||||
@ -86,24 +86,6 @@ Route::group('sys', function() {
|
||||
//地图设置
|
||||
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');
|
||||
//登录注册设置
|
||||
@ -274,6 +256,63 @@ Route::group('sys', function() {
|
||||
/***************************************************** 获取布局 ****************************************************/
|
||||
Route::get('layout', 'sys.System/layout');
|
||||
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([
|
||||
AdminCheckToken::class,
|
||||
AdminCheckRole::class,
|
||||
|
||||
@ -19,6 +19,8 @@ use think\facade\Route;
|
||||
Route::group('user', function () {
|
||||
/***************************************************** 用户 ****************************************************/
|
||||
Route::get('', 'user.User/lists');
|
||||
//全部用户列表
|
||||
Route::get('user_all', 'user.User/getUserAll');
|
||||
//用户详情
|
||||
Route::get(':uid', 'user.User/info');
|
||||
//用户新增
|
||||
|
||||
@ -11,7 +11,9 @@
|
||||
|
||||
namespace app\api\controller\login;
|
||||
|
||||
use app\dict\member\MemberLoginTypeDict;
|
||||
use app\service\api\captcha\CaptchaService;
|
||||
use app\service\api\login\ConfigService;
|
||||
use app\service\api\login\LoginService;
|
||||
use core\base\BaseController;
|
||||
use Exception;
|
||||
@ -25,11 +27,12 @@ class Login extends BaseController
|
||||
*/
|
||||
public function login()
|
||||
{
|
||||
|
||||
$data = $this->request->params([
|
||||
[ 'username', '' ],
|
||||
[ 'password', '' ],
|
||||
]);
|
||||
//校验登录注册配置
|
||||
( new ConfigService() )->checkLoginConfig(MemberLoginTypeDict::USERNAME);
|
||||
//参数验证
|
||||
//验证码验证
|
||||
$result = ( new LoginService() )->account($data[ 'username' ], $data[ 'password' ]);
|
||||
@ -38,7 +41,6 @@ class Login extends BaseController
|
||||
return fail('ACCOUNT_OR_PASSWORD_ERROR');
|
||||
}
|
||||
return success($result);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -83,6 +85,8 @@ class Login extends BaseController
|
||||
$data = $this->request->params([
|
||||
[ 'mobile', '' ],
|
||||
]);
|
||||
//校验登录注册配置
|
||||
( new ConfigService() )->checkLoginConfig(MemberLoginTypeDict::MOBILE);
|
||||
return success(( new LoginService() )->mobile($data[ 'mobile' ]));
|
||||
}
|
||||
|
||||
|
||||
@ -11,6 +11,8 @@
|
||||
|
||||
namespace app\api\controller\login;
|
||||
|
||||
use app\dict\member\MemberLoginTypeDict;
|
||||
use app\service\api\login\ConfigService;
|
||||
use app\service\api\login\RegisterService;
|
||||
use core\base\BaseController;
|
||||
use think\Response;
|
||||
@ -30,6 +32,8 @@ class Register extends BaseController
|
||||
[ 'password', '' ],
|
||||
[ 'mobile', '' ],
|
||||
]);
|
||||
//校验登录注册配置
|
||||
( new ConfigService() )->checkLoginConfig(MemberLoginTypeDict::USERNAME);
|
||||
//参数验证
|
||||
$this->validate($data, 'app\validate\member\Member.account_register');
|
||||
//验证码验证
|
||||
@ -46,6 +50,8 @@ class Register extends BaseController
|
||||
$data = $this->request->params([
|
||||
[ 'mobile', '' ],
|
||||
]);
|
||||
//校验登录注册配置
|
||||
( new ConfigService() )->checkLoginConfig(MemberLoginTypeDict::MOBILE);
|
||||
//参数验证
|
||||
$this->validate($data, [
|
||||
'mobile' => 'require|mobile'
|
||||
@ -55,5 +61,4 @@ class Register extends BaseController
|
||||
return success($result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -33,10 +33,12 @@ class Account extends BaseApiController
|
||||
public function point(): Response
|
||||
{
|
||||
$data = $this->request->params([
|
||||
['from_type', '']
|
||||
['from_type', ''],
|
||||
['amount_type', 'all'],//全部all 收入income 支出disburse
|
||||
['create_time', []],
|
||||
]);
|
||||
$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
|
||||
{
|
||||
$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
|
||||
{
|
||||
$data = $this->request->params([
|
||||
['keyword', ''],
|
||||
['from_type', ''],
|
||||
['account_data_gt', ''],
|
||||
['account_data_lt', ''],
|
||||
['create_time', []],
|
||||
]);
|
||||
$data['account_type'] = MemberAccountTypeDict::COMMISSION;
|
||||
return success((new MemberAccountService())->getPage($data));
|
||||
|
||||
@ -15,9 +15,6 @@ use app\service\api\login\AuthService;
|
||||
use app\service\api\member\MemberLogService;
|
||||
use app\service\api\member\MemberService;
|
||||
use core\base\BaseApiController;
|
||||
use think\db\exception\DataNotFoundException;
|
||||
use think\db\exception\DbException;
|
||||
use think\db\exception\ModelNotFoundException;
|
||||
use think\Response;
|
||||
|
||||
class Member extends BaseApiController
|
||||
|
||||
@ -11,7 +11,6 @@
|
||||
|
||||
namespace app\api\controller\sys;
|
||||
|
||||
use app\service\api\scan\ScanService;
|
||||
use app\service\api\verify\VerifyService;
|
||||
use core\base\BaseApiController;
|
||||
use think\Response;
|
||||
@ -64,6 +63,7 @@ class Verify extends BaseApiController
|
||||
['relate_tag', 0],
|
||||
['type', ''],
|
||||
['code', ''],
|
||||
['keyword', ''],
|
||||
['create_time', []]
|
||||
]);
|
||||
return success(data:(new VerifyService())->getRecordsPageByVerifier($data));
|
||||
|
||||
@ -48,7 +48,6 @@ class Weapp extends BaseApiController
|
||||
return success($weapp_auth_service->register($data[ 'openid' ], $data[ 'mobile' ], $data[ 'mobile_code' ], $data[ 'unionid' ]));
|
||||
}
|
||||
|
||||
|
||||
public function subscribeMessage()
|
||||
{
|
||||
$data = $this->request->params([ [ 'keys', '' ] ]);
|
||||
@ -68,7 +67,6 @@ class Weapp extends BaseApiController
|
||||
if ($result) {
|
||||
return success([ 'is_trade_managed' => true ]);
|
||||
}
|
||||
|
||||
} catch (\Exception $e) {
|
||||
}
|
||||
return success([ 'is_trade_managed' => false ]);
|
||||
@ -86,7 +84,17 @@ class Weapp extends BaseApiController
|
||||
$wechat_template_service = new WeappDeliveryService();
|
||||
$result = $wechat_template_service->getMsgJumpPath($data[ 'out_trade_no' ]);
|
||||
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' ]));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -13,7 +13,6 @@ namespace app\api\controller\wechat;
|
||||
|
||||
use app\service\api\wechat\WechatAuthService;
|
||||
use core\base\BaseController;
|
||||
use EasyWeChat\Kernel\Exceptions\InvalidArgumentException;
|
||||
use think\db\exception\DataNotFoundException;
|
||||
use think\db\exception\DbException;
|
||||
use think\db\exception\ModelNotFoundException;
|
||||
@ -27,7 +26,8 @@ class Wechat extends BaseController
|
||||
* 获取跳转获取code
|
||||
* @return Response
|
||||
*/
|
||||
public function getCodeUrl(){
|
||||
public function getCodeUrl()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ 'url', '' ],
|
||||
[ 'scopes', '' ]
|
||||
@ -40,7 +40,8 @@ class Wechat extends BaseController
|
||||
* code获取微信信息
|
||||
* @return Response
|
||||
*/
|
||||
public function getWechatUser(){
|
||||
public function getWechatUser()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ 'code', '' ],
|
||||
]);
|
||||
@ -53,7 +54,8 @@ class Wechat extends BaseController
|
||||
* 授权信息登录
|
||||
* @return Response
|
||||
*/
|
||||
public function wechatLogin(){
|
||||
public function wechatLogin()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ 'data', '' ],
|
||||
]);
|
||||
@ -69,7 +71,8 @@ class Wechat extends BaseController
|
||||
* @throws DbException
|
||||
* @throws ModelNotFoundException
|
||||
*/
|
||||
public function login(){
|
||||
public function login()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ 'code', '' ],
|
||||
]);
|
||||
@ -81,7 +84,8 @@ class Wechat extends BaseController
|
||||
* 注册
|
||||
* @return Response
|
||||
*/
|
||||
public function register(){
|
||||
public function register()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ 'openid', '' ],
|
||||
[ 'unionid', '' ],
|
||||
@ -99,7 +103,8 @@ class Wechat extends BaseController
|
||||
* 同步
|
||||
* @return Response
|
||||
*/
|
||||
public function sync(){
|
||||
public function sync()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ 'code', '' ],
|
||||
]);
|
||||
@ -111,7 +116,8 @@ class Wechat extends BaseController
|
||||
* 获取jssdk config
|
||||
* @return Response
|
||||
*/
|
||||
public function jssdkConfig(){
|
||||
public function jssdkConfig()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ 'url', '' ],
|
||||
]);
|
||||
@ -123,9 +129,20 @@ class Wechat extends BaseController
|
||||
* 扫码登录
|
||||
* @return Response
|
||||
*/
|
||||
public function scanLogin(){
|
||||
public function scanLogin()
|
||||
{
|
||||
$wechat_auth_service = new WechatAuthService();
|
||||
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' ]));
|
||||
}
|
||||
}
|
||||
|
||||
@ -100,8 +100,6 @@ Route::group(function() {
|
||||
Route::get('site', 'sys.Config/site');
|
||||
//场景域名
|
||||
Route::get('scene_domain', 'sys.Config/getSceneDomain');
|
||||
// 获取手机端首页列表
|
||||
Route::get('wap_index', 'sys.Config/getWapIndexList');
|
||||
|
||||
// 获取地图设置
|
||||
Route::get('map', 'sys.Config/getMap');
|
||||
@ -144,5 +142,15 @@ Route::group(function() {
|
||||
})->middleware(ApiChannel::class)
|
||||
->middleware(ApiCheckToken::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' ]);
|
||||
|
||||
@ -7,7 +7,6 @@ use app\service\admin\install\InstallSystemService;
|
||||
use app\service\core\menu\CoreMenuService;
|
||||
use think\console\Command;
|
||||
use think\console\Input;
|
||||
use think\console\input\Argument;
|
||||
use think\console\input\Option;
|
||||
use think\console\Output;
|
||||
|
||||
|
||||
@ -18,6 +18,7 @@ use Workerman\Worker;
|
||||
class Queue extends Command
|
||||
{
|
||||
use WorkerCommand;
|
||||
|
||||
public function configure()
|
||||
{
|
||||
// 指令配置
|
||||
@ -27,8 +28,6 @@ class Queue extends Command
|
||||
->setDescription('基于Redis的消息队列,支持消息延迟处理。');
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 执行任务
|
||||
* @return void
|
||||
@ -43,8 +42,7 @@ class Queue extends Command
|
||||
// $worker->count = 3;
|
||||
$worker->onWorkerStart = function() use ($output) {
|
||||
// 定时,每10秒一次
|
||||
Timer::add(30, function()use($output)
|
||||
{
|
||||
Timer::add(30, function() use ($output) {
|
||||
( new SysSchedule() )->select();
|
||||
});
|
||||
$redis_option = [
|
||||
@ -87,7 +85,8 @@ class Queue extends Command
|
||||
* 捕获所有队列任务
|
||||
* @return array
|
||||
*/
|
||||
public function getAllQueue(){
|
||||
public function getAllQueue()
|
||||
{
|
||||
$class_list = [];
|
||||
$system_dir = root_path() . 'app' . DIRECTORY_SEPARATOR . 'job';
|
||||
$addon_dir = root_path() . 'addon' . DIRECTORY_SEPARATOR;
|
||||
|
||||
@ -16,6 +16,7 @@ use Workerman\Worker;
|
||||
class Schedule extends Command
|
||||
{
|
||||
use WorkerCommand;
|
||||
|
||||
public function configure()
|
||||
{
|
||||
// 指令配置
|
||||
@ -25,8 +26,6 @@ class Schedule extends Command
|
||||
->setDescription('定时任务,类似linux的crontab。支持秒级别定时。');
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 执行任务
|
||||
* @return void
|
||||
|
||||
@ -21,6 +21,7 @@ use Workerman\Worker;
|
||||
class Workerman extends Command
|
||||
{
|
||||
use WorkerCommand;
|
||||
|
||||
public function configure()
|
||||
{
|
||||
// 指令配置
|
||||
@ -30,8 +31,6 @@ class Workerman extends Command
|
||||
->setDescription('Workerman,高性能PHP应用容器');
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 执行任务
|
||||
* @return void
|
||||
@ -79,8 +78,7 @@ class Workerman extends Command
|
||||
$worker->onWorkerStart = function() use ($output) {
|
||||
$output->writeln('[' . date('Y-m-d H:i:s') . ']' . " Queue Starting...");
|
||||
// 定时,每10秒一次
|
||||
Timer::add(30, function()use($output)
|
||||
{
|
||||
Timer::add(30, function() use ($output) {
|
||||
( new SysSchedule() )->select();
|
||||
});
|
||||
$redis_option = [
|
||||
@ -168,7 +166,8 @@ class Workerman extends Command
|
||||
* 捕获所有队列任务
|
||||
* @return array
|
||||
*/
|
||||
public function getAllQueue(){
|
||||
public function getAllQueue()
|
||||
{
|
||||
$class_list = [];
|
||||
$system_dir = root_path() . 'app' . DIRECTORY_SEPARATOR . 'job';
|
||||
$addon_dir = root_path() . 'addon' . DIRECTORY_SEPARATOR;
|
||||
|
||||
@ -36,7 +36,7 @@ class AddonDict
|
||||
|
||||
// 插件关键字黑名单
|
||||
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'
|
||||
];
|
||||
|
||||
|
||||
@ -552,6 +552,8 @@ class ComponentDict
|
||||
'value' => [
|
||||
"imageSize" => 40,
|
||||
"aroundRadius" => 0,
|
||||
'style' => 'style-1',
|
||||
"styleName" => "风格一",
|
||||
"bottomPosition" => "lowerRight", // 左上:upperLeft,右上:upperRight,左下:lowerLeft,右下:lowerRight
|
||||
"list" => [
|
||||
[
|
||||
|
||||
@ -114,7 +114,14 @@ class LinkDict
|
||||
'url' => '/app/pages/verify/index',
|
||||
'is_share' => 1,
|
||||
'action' => ''
|
||||
]
|
||||
],
|
||||
[
|
||||
'name' => 'MEMBER_CONTACT',
|
||||
'title' => get_lang('dict_diy.member_contact'),
|
||||
'url' => '/app/pages/member/contact',
|
||||
'is_share' => 1,
|
||||
'action' => ''
|
||||
],
|
||||
]
|
||||
],
|
||||
'DIY_PAGE' => [
|
||||
|
||||
@ -62,7 +62,7 @@ class PagesDict
|
||||
"margin" => [
|
||||
"top" => 10,
|
||||
"bottom" => 10,
|
||||
"both" => 16
|
||||
"both" => 10
|
||||
],
|
||||
"ignore" => [],
|
||||
"list" => []
|
||||
@ -152,10 +152,11 @@ class PagesDict
|
||||
'topStatusBar' => [
|
||||
'isShow' => true,
|
||||
'bgColor' => "#ffffff",
|
||||
'isTransparent' => false,
|
||||
'rollBgColor' => "#ffffff",
|
||||
'style' => 'style-1',
|
||||
'styleName' => '风格1',
|
||||
'textColor' => "#333333",
|
||||
'rollTextColor' => "#333333",
|
||||
'textAlign' => 'center',
|
||||
'inputPlaceholder' => '请输入搜索关键词',
|
||||
'imgUrl' => '',
|
||||
@ -217,16 +218,17 @@ class PagesDict
|
||||
"margin" => [
|
||||
"top" => 0,
|
||||
"bottom" => 0,
|
||||
"both" => 12
|
||||
"both" => 10
|
||||
]
|
||||
],
|
||||
'topStatusBar' => [
|
||||
"topStatusBar" => [
|
||||
'isShow' => true,
|
||||
'bgColor' => "#ffffff",
|
||||
'isTransparent' => false,
|
||||
'rollBgColor' => "#ffffff",
|
||||
'style' => 'style-1',
|
||||
'styleName' => '风格1',
|
||||
'textColor' => "#333333",
|
||||
'rollTextColor' => "#333333",
|
||||
'textAlign' => 'center',
|
||||
'inputPlaceholder' => '请输入搜索关键词',
|
||||
'imgUrl' => '',
|
||||
@ -269,7 +271,7 @@ class PagesDict
|
||||
"margin" => [
|
||||
"top" => 12,
|
||||
"bottom" => 6,
|
||||
"both" => 16
|
||||
"both" => 10
|
||||
],
|
||||
"style" => "style-1",
|
||||
"styleName" => "风格1",
|
||||
@ -306,7 +308,7 @@ class PagesDict
|
||||
"margin" => [
|
||||
"top" => 6,
|
||||
"bottom" => 0,
|
||||
"both" => 16
|
||||
"both" => 10
|
||||
]
|
||||
],
|
||||
[
|
||||
@ -359,7 +361,7 @@ class PagesDict
|
||||
"margin" => [
|
||||
"top" => 0,
|
||||
"bottom" => 0,
|
||||
"both" => 16
|
||||
"both" => 10
|
||||
]
|
||||
],
|
||||
[
|
||||
@ -400,7 +402,7 @@ class PagesDict
|
||||
"margin" => [
|
||||
"top" => 0,
|
||||
"bottom" => 6,
|
||||
"both" => 16
|
||||
"both" => 10
|
||||
],
|
||||
"ignore" => [],
|
||||
"list" => [
|
||||
@ -467,7 +469,11 @@ class PagesDict
|
||||
[
|
||||
"title" => "联系客服",
|
||||
"link" => [
|
||||
"name" => ""
|
||||
"name" => "MEMBER_CONTACT",
|
||||
"parent" => "MEMBER_LINK",
|
||||
"title" => "客服",
|
||||
"url" => "/app/pages/member/contact",
|
||||
"action" => ""
|
||||
],
|
||||
"imageUrl" => "static/resource/images/diy/horz_m_service.png",
|
||||
"label" => [
|
||||
@ -570,7 +576,11 @@ class PagesDict
|
||||
[
|
||||
"title" => "联系客服",
|
||||
"link" => [
|
||||
"name" => ""
|
||||
"name" => "MEMBER_CONTACT",
|
||||
"parent" => "MEMBER_LINK",
|
||||
"title" => "客服",
|
||||
"url" => "/app/pages/member/contact",
|
||||
"action" => ""
|
||||
],
|
||||
"imageUrl" => "static/resource/images/diy/vert_m_service.png",
|
||||
"label" => [
|
||||
@ -618,7 +628,7 @@ class PagesDict
|
||||
"margin" => [
|
||||
"top" => 6,
|
||||
"bottom" => 12,
|
||||
"both" => 16
|
||||
"both" => 10
|
||||
]
|
||||
]
|
||||
]
|
||||
@ -660,7 +670,7 @@ class PagesDict
|
||||
"margin" => [
|
||||
"top" => 0,
|
||||
"bottom" => 0,
|
||||
"both" => 12
|
||||
"both" => 10
|
||||
]
|
||||
],
|
||||
'topStatusBar' => [
|
||||
@ -749,7 +759,7 @@ class PagesDict
|
||||
"margin" => [
|
||||
"top" => 0,
|
||||
"bottom" => 0,
|
||||
"both" => 16
|
||||
"both" => 10
|
||||
]
|
||||
],
|
||||
[
|
||||
@ -802,7 +812,7 @@ class PagesDict
|
||||
"margin" => [
|
||||
"top" => 0,
|
||||
"bottom" => 0,
|
||||
"both" => 16
|
||||
"both" => 10
|
||||
]
|
||||
],
|
||||
[
|
||||
@ -843,7 +853,7 @@ class PagesDict
|
||||
"margin" => [
|
||||
"top" => 0,
|
||||
"bottom" => 6,
|
||||
"both" => 16
|
||||
"both" => 10
|
||||
],
|
||||
"ignore" => [],
|
||||
"list" => [
|
||||
@ -910,7 +920,11 @@ class PagesDict
|
||||
[
|
||||
"title" => "联系客服",
|
||||
"link" => [
|
||||
"name" => ""
|
||||
"name" => "MEMBER_CONTACT",
|
||||
"parent" => "MEMBER_LINK",
|
||||
"title" => "客服",
|
||||
"url" => "/app/pages/member/contact",
|
||||
"action" => ""
|
||||
],
|
||||
"imageUrl" => "static/resource/images/diy/horz_m_service.png",
|
||||
"label" => [
|
||||
@ -1013,7 +1027,11 @@ class PagesDict
|
||||
[
|
||||
"title" => "联系客服",
|
||||
"link" => [
|
||||
"name" => ""
|
||||
"name" => "MEMBER_CONTACT",
|
||||
"parent" => "MEMBER_LINK",
|
||||
"title" => "客服",
|
||||
"url" => "/app/pages/member/contact",
|
||||
"action" => ""
|
||||
],
|
||||
"imageUrl" => "static/resource/images/diy/vert_m_service.png",
|
||||
"label" => [
|
||||
@ -1061,7 +1079,7 @@ class PagesDict
|
||||
"margin" => [
|
||||
"top" => 6,
|
||||
"bottom" => 12,
|
||||
"both" => 16
|
||||
"both" => 10
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
@ -24,49 +24,49 @@ class MemberLevelDict
|
||||
{
|
||||
|
||||
return [
|
||||
// 'level_1' => [
|
||||
// 'bg_color' => '#414852',
|
||||
// 'level_color' => '#666666',
|
||||
// 'progress' => ['#999999','#666666'],
|
||||
// 'gift'=> '#ECEBEB',
|
||||
// ],
|
||||
'level_1' => [
|
||||
'bg_color' => '#414852',
|
||||
'level_color' => '#666666',
|
||||
'progress' => ['#999999','#666666'],
|
||||
'gift'=> '#ECEBEB',
|
||||
],
|
||||
'level_2' => [
|
||||
'bg_color' => '#354B54',
|
||||
'level_color' => '#116787',
|
||||
'progress' => ['#4BA5C7','#116787'],
|
||||
'gift'=> '#F1FDFF',
|
||||
],
|
||||
'level_3' => [
|
||||
'level_2' => [
|
||||
'bg_color' => '#203B54',
|
||||
'level_color' => '#286BAA',
|
||||
'progress' => ['#529BDF','#286BAA'],
|
||||
'gift'=> '#E3F2FF',
|
||||
],
|
||||
'level_4' => [
|
||||
'level_3' => [
|
||||
'bg_color' => '#403E32',
|
||||
'level_color' => '#967600',
|
||||
'progress' => ['#D1A400','#967600'],
|
||||
'gift'=> '#FFFAE3',
|
||||
],
|
||||
'level_5' => [
|
||||
'level_4' => [
|
||||
'bg_color' => '#36354B',
|
||||
'level_color' => '#4B3EF9',
|
||||
'progress' => ['#8F87FF','#4B3EF9'],
|
||||
'gift'=> '#E7EEFF',
|
||||
],
|
||||
'level_6' => [
|
||||
'level_5' => [
|
||||
'bg_color' => '#362F28',
|
||||
'level_color' => '#9F5300',
|
||||
'progress' => ['#EFA244','#9F5300'],
|
||||
'gift'=> '#FFF5DC',
|
||||
],
|
||||
'level_7' => [
|
||||
'level_6' => [
|
||||
'bg_color' => '#322432',
|
||||
'level_color' => '#DE43D6',
|
||||
'progress' => ['#FFA0FA','#DE43D6'],
|
||||
'gift'=> '#FFEAFF',
|
||||
],
|
||||
'level_8' => [
|
||||
'level_7' => [
|
||||
'bg_color' => '#301C1E',
|
||||
'level_color' => '#DE000B',
|
||||
'progress' => ['#FF8B36','#DE000B'],
|
||||
|
||||
@ -112,6 +112,8 @@ return [
|
||||
'inc' => 1,
|
||||
//是否减少
|
||||
'dec' => 0,
|
||||
//是否累增
|
||||
'is_change_get' => 0,
|
||||
],
|
||||
//会员升级礼包
|
||||
'level_upgrade' => [
|
||||
@ -160,6 +162,8 @@ return [
|
||||
'inc' => 0,
|
||||
//是否减少
|
||||
'dec' => 1,
|
||||
//是否累增
|
||||
'is_change_get' => 0,
|
||||
],
|
||||
],
|
||||
//会员佣金
|
||||
@ -182,6 +186,8 @@ return [
|
||||
'inc' => 0,
|
||||
//是否减少
|
||||
'dec' => 1,
|
||||
//是否累增
|
||||
'is_change_get' => 0,
|
||||
],
|
||||
]
|
||||
];
|
||||
|
||||
@ -2201,7 +2201,7 @@ return [
|
||||
'router_path' => 'setting/agreement',
|
||||
'view_path' => 'setting/agreement',
|
||||
'methods' => 'get',
|
||||
'sort' => '80',
|
||||
'sort' => '100',
|
||||
'status' => '1',
|
||||
'is_show' => '1',
|
||||
],
|
||||
@ -2289,7 +2289,7 @@ return [
|
||||
'router_path' => 'setting/storage',
|
||||
'view_path' => 'setting/storage',
|
||||
'methods' => 'get',
|
||||
'sort' => '30',
|
||||
'sort' => '98',
|
||||
'status' => '1',
|
||||
'is_show' => '1',
|
||||
'children' => [
|
||||
@ -2333,7 +2333,7 @@ return [
|
||||
'router_path' => 'setting/export',
|
||||
'view_path' => 'setting/export',
|
||||
'methods' => 'get',
|
||||
'sort' => '30',
|
||||
'sort' => '97',
|
||||
'status' => '1',
|
||||
'is_show' => '1',
|
||||
'children' => [
|
||||
@ -2352,9 +2352,125 @@ return [
|
||||
'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',
|
||||
],
|
||||
]
|
||||
],
|
||||
|
||||
],
|
||||
],
|
||||
|
||||
@ -37,6 +37,10 @@ class ComponentDict
|
||||
'sort' => 10000,
|
||||
'relate' => '', // 关联字段,空为不处理// 组件属性
|
||||
'value' => '文本内容',
|
||||
'template' => [
|
||||
"width" => 165, // 宽度
|
||||
'height' => 53 // 高度
|
||||
]
|
||||
],
|
||||
'Image' => [
|
||||
'title' => "图片",
|
||||
@ -68,10 +72,11 @@ class ComponentDict
|
||||
'relate' => 'headimg', // 关联字段,空为不处理
|
||||
'value' => '',
|
||||
'template' => [
|
||||
"width" => 50, // 宽度
|
||||
'height' => 50, // 高度
|
||||
'minWidth' => 30, // 最小宽度
|
||||
'minHeight' => 30, // 最小高度
|
||||
"width" => 100, // 宽度
|
||||
'height' => 100, // 高度
|
||||
'minWidth' => 60, // 最小宽度
|
||||
'minHeight' => 60, // 最小高度
|
||||
'shape' => 'circle'
|
||||
],
|
||||
],
|
||||
'NickName' => [
|
||||
@ -84,10 +89,10 @@ class ComponentDict
|
||||
'relate' => 'nickname', // 关联字段,空为不处理
|
||||
'value' => '',
|
||||
'template' => [
|
||||
"width" => 50, // 宽度
|
||||
'height' => 50, // 高度
|
||||
'minWidth' => 30, // 最小宽度
|
||||
'minHeight' => 30, // 最小高度
|
||||
"width" => 164, // 宽度
|
||||
'height' => 55, // 高度
|
||||
'minWidth' => 120, // 最小宽度
|
||||
'minHeight' => 50, // 最小高度
|
||||
],
|
||||
],
|
||||
'Draw' => [
|
||||
@ -100,10 +105,10 @@ class ComponentDict
|
||||
'relate' => '', // 关联字段,空为不处理
|
||||
'value' => '',
|
||||
'template' => [
|
||||
"width" => 100, // 宽度
|
||||
'height' => 100, // 高度
|
||||
'minWidth' => 30, // 最小宽度
|
||||
'minHeight' => 30, // 最小高度
|
||||
"width" => 200, // 宽度
|
||||
'height' => 200, // 高度
|
||||
'minWidth' => 60, // 最小宽度
|
||||
'minHeight' => 60, // 最小高度
|
||||
'drawType' => 'Polygon',
|
||||
'bgColor' => '#eeeeee',
|
||||
'points' => [], // [x,y]:左上,右上,右下,左下
|
||||
|
||||
@ -12,28 +12,5 @@ return [
|
||||
'class' => '',
|
||||
'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' => ''
|
||||
]
|
||||
];
|
||||
|
||||
|
||||
@ -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'),//转账
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
@ -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'),//停止
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
@ -30,8 +30,6 @@ class ConfigKeyDict
|
||||
|
||||
public const H5 = 'h5';//h5
|
||||
|
||||
public const WXOPLATFORM = 'WXOPLATFORM'; // 微信开放平台
|
||||
|
||||
public const WEAPP_AUTHORIZATION_INFO = 'weapp_authorization_info';
|
||||
|
||||
public const WECHAT_AUTHORIZATION_INFO = 'wechat_authorization_info';
|
||||
|
||||
@ -30,6 +30,8 @@ class FileDict
|
||||
public const MID = 'mid';//小程序上传
|
||||
public const SMALL = 'small';
|
||||
|
||||
public const EXCEL = 'excel';//excel导入
|
||||
|
||||
/**
|
||||
* 附件类型
|
||||
* @return array
|
||||
@ -68,6 +70,7 @@ class FileDict
|
||||
self::IMAGE,//图片上传
|
||||
self::VIDEO,//视频上传
|
||||
self::APPLET,//小程序包上传
|
||||
self::EXCEL,//excel导入
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
62
niucloud/app/dict/sys/PrinterDict.php
Normal file
62
niucloud/app/dict/sys/PrinterDict.php
Normal 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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -47,18 +47,10 @@ $system_event = [
|
||||
],
|
||||
//协议类型加载
|
||||
'AgreementType' => [],
|
||||
//站点首页加载
|
||||
'SiteIndex' => [
|
||||
'app\listener\system\SiteIndexListener'
|
||||
],
|
||||
// 站点端布局
|
||||
'SiteLayout' => [
|
||||
'app\listener\system\SiteLayout'
|
||||
],
|
||||
//平台首页加载
|
||||
'AdminIndex' => [
|
||||
'app\listener\system\AdminIndexListener'
|
||||
],
|
||||
'BottomNavigation' => [
|
||||
'app\listener\system\BottomNavigationListener'
|
||||
],
|
||||
@ -88,12 +80,12 @@ $system_event = [
|
||||
//导出数据类型
|
||||
'ExportDataType' => [
|
||||
//会员导出
|
||||
'app\listener\member\MemberExportTypeListener',
|
||||
'app\listener\member_export\MemberExportTypeListener',
|
||||
],
|
||||
//导出数据源
|
||||
'ExportData' => [
|
||||
//会员导出
|
||||
'app\listener\member\MemberExportDataListener',
|
||||
'app\listener\member_export\MemberExportDataListener',
|
||||
],
|
||||
//统计执行
|
||||
'StatExecute' => [],
|
||||
|
||||
@ -109,7 +109,8 @@ class Index extends BaseInstall
|
||||
}
|
||||
}
|
||||
|
||||
public function build() {
|
||||
public function build()
|
||||
{
|
||||
$install_user = Cache::get('install_user');
|
||||
$token = ( new LoginService() )->login($install_user[ 'username' ], $install_user[ 'password' ]);
|
||||
$this->assign('token', $token[ 'token' ]);
|
||||
@ -169,6 +170,7 @@ class Index extends BaseInstall
|
||||
];
|
||||
|
||||
} else {
|
||||
try {
|
||||
if (@mysqli_select_db($conn, $dbname)) {
|
||||
$result = [
|
||||
"status" => 2,
|
||||
@ -180,6 +182,13 @@ class Index extends BaseInstall
|
||||
"message" => "数据库不存在,系统将自动创建"
|
||||
];
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$result = [
|
||||
"status" => 1,
|
||||
"message" => "数据库不存在,系统将自动创建"
|
||||
];
|
||||
return fail($result);
|
||||
}
|
||||
}
|
||||
@mysqli_close($conn);
|
||||
} else {
|
||||
@ -343,7 +352,8 @@ class Index extends BaseInstall
|
||||
* 安装插件
|
||||
* @return true
|
||||
*/
|
||||
public function installAddon() {
|
||||
public function installAddon()
|
||||
{
|
||||
$root_path = str_replace("\\", DIRECTORY_SEPARATOR, dirname(__FILE__, 4));
|
||||
$root_path = str_replace("../", DIRECTORY_SEPARATOR, $root_path);
|
||||
$addon_path = $root_path . DIRECTORY_SEPARATOR . 'addon';
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -4,7 +4,6 @@
|
||||
<meta name="renderer" content="webkit" />
|
||||
<meta http-equiv="X-UA-COMPATIBLE" content="IE=edge,chrome=1" />
|
||||
<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="stylesheet" type="text/css" href="INSTALL_CSS/style.css" />
|
||||
<link rel="stylesheet" type="text/css" href="INSTALL_CSS/layui.css" />
|
||||
|
||||
@ -165,7 +165,7 @@
|
||||
|
||||
{/block}
|
||||
{block name='script'}
|
||||
<script language="javascript" type="text/javascript">
|
||||
<script type="text/javascript">
|
||||
ControlContent(2);
|
||||
var is_existdb = 1;//数据库是否存在
|
||||
var message = '数据库账号或密码不能为空';
|
||||
|
||||
@ -30,10 +30,12 @@
|
||||
.pop-link-wrap .link-text:nth-child(2) a{
|
||||
color: var(--base-color);
|
||||
}
|
||||
.pop-link-wrap .link-btn{
|
||||
margin-top: 40px;
|
||||
}
|
||||
|
||||
.pop-link-wrap button{
|
||||
margin-top: 40px;
|
||||
width: 250px;
|
||||
width: 160px;
|
||||
height: 40px;
|
||||
background: var(--base-color);
|
||||
color: #fff !important;
|
||||
@ -97,6 +99,11 @@
|
||||
<script>
|
||||
ControlContent(4);
|
||||
const visitFn = (type)=>{
|
||||
let tips = window.localStorage.getItem('pageToLinkTips')
|
||||
if(tips){
|
||||
pageToLink(type)
|
||||
return false
|
||||
}
|
||||
layer.open({
|
||||
type: 1, // page 层类型
|
||||
area: ['400px', '230px'],
|
||||
@ -108,20 +115,30 @@
|
||||
<div class="pop-link-wrap">
|
||||
<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-btn">
|
||||
<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>
|
||||
`
|
||||
});
|
||||
}
|
||||
|
||||
// 页面跳转
|
||||
function pageToLink(type){
|
||||
if(type == 'admin')
|
||||
function pageToLink(type,flag = false){
|
||||
if(flag){
|
||||
window.localStorage.setItem('pageToLinkTips', true)
|
||||
}
|
||||
if(type == 'admin'){
|
||||
layer.closeAll()
|
||||
window.open('{$root_url}/admin/login')
|
||||
else if(type == 'web')
|
||||
}else if(type == 'web'){
|
||||
layer.closeAll()
|
||||
window.open('{$root_url}/web/')
|
||||
else if(type == 'wap')
|
||||
}else if(type == 'wap'){
|
||||
layer.closeAll()
|
||||
window.open('{$root_url}/wap/')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
|
||||
@ -9,23 +9,19 @@
|
||||
// | 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;
|
||||
|
||||
/**
|
||||
* 队列异步执行插件安装任务
|
||||
* 队列设置会员会员码
|
||||
*/
|
||||
class AddonInstall extends BaseJob
|
||||
class SetMemberNoJob extends BaseJob
|
||||
{
|
||||
public function doJob($addon, $task)
|
||||
public function doJob($member_id)
|
||||
{
|
||||
(new CoreAddonInstallService($addon))->executeTask($task);
|
||||
}
|
||||
|
||||
public function failed($data)
|
||||
{
|
||||
|
||||
CoreMemberService::setMemberNo($member_id);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -28,7 +28,7 @@ return [
|
||||
'DOWNLOAD_FAIL' => 'download fail',
|
||||
'SET_SUCCESS' => 'set success',
|
||||
'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',
|
||||
'CAPTCHA_ERROR' => 'captcha fail',
|
||||
|
||||
|
||||
@ -35,14 +35,6 @@ return [
|
||||
'status_on' => 'on',
|
||||
'status_off' => 'off'
|
||||
],
|
||||
// 站点
|
||||
'dict_site' => [
|
||||
//站点类型
|
||||
'type_cms' => 'cms',
|
||||
'status_on' => 'on',
|
||||
'status_experience' => 'experience',
|
||||
'status_expire' => 'expire'
|
||||
],
|
||||
'dict_notice' => [
|
||||
'type_sms' => 'sms',
|
||||
'type_wechat' => 'wechat',
|
||||
|
||||
@ -91,7 +91,7 @@ return [
|
||||
'USER_NOT_EXIST' => '用户不存在',
|
||||
'NO_SITE_USER_ROLE' => '用户不存在关联权限',
|
||||
'ADMIN_NOT_ALLOW_EDIT_ROLE' => '超级管理员不允许改动权限',
|
||||
'USERNAME_REPEAT' => '用户名重复',
|
||||
'USERNAME_REPEAT' => '账号重复',
|
||||
'SITE_USER_EXIST' => '该用户已存在',
|
||||
|
||||
//角色管理
|
||||
@ -110,7 +110,7 @@ return [
|
||||
'OSS_FILE_URL_NOT_EXIST' => '远程资源文件地址不能为空',
|
||||
'BASE_IMAGE_FILE_NOT_EXIST' => 'base图片资源不能为空',
|
||||
'UPLOAD_TYPE_NOT_SUPPORT' => '不支持的上传类型',
|
||||
'FILE_ERROE' => '无效的资源',
|
||||
'FILE_ERROR' => '无效的资源',
|
||||
'UPLOAD_STORAGE_TYPE_ALL_CLOSE' => '至少要有一个启用的存储方式',
|
||||
'STORAGE_NOT_HAS_HTTP_OR_HTTPS' => '空间域名请补全http://或https://',
|
||||
|
||||
@ -137,6 +137,7 @@ return [
|
||||
'ACCOUNT_OR_PASSWORD_ERROR' => '账号或密码错误',
|
||||
'MEMBER_LOCK' => '账号被锁定',
|
||||
'MEMBER_NOT_EXIST' => '账号不存在',
|
||||
'MEMBER_OPENID_EXIST' => 'openid已存在',
|
||||
'MEMBER_LOGOUT' => '账号退出',
|
||||
'MEMBER_TYPE_NOT_EXIST' => '账户类型不存在',
|
||||
'MEMBER_IS_EXIST' => '账号已存在',
|
||||
@ -277,7 +278,9 @@ return [
|
||||
'CONTINUE_SIGN' => '连签',
|
||||
'DAYS' => '天!',
|
||||
'SIGN_SUCCESS' => '签到成功',
|
||||
'SIGN_AWARD' => '签到奖励',
|
||||
'GET_AWARD' => '恭喜您获得以下奖励',
|
||||
'WILL_GET_AWARD' => '您将获得以下奖励',
|
||||
|
||||
//导出相关
|
||||
'EXPORT_SUCCESS' => '导出成功',
|
||||
@ -290,5 +293,7 @@ return [
|
||||
'WECHAT_OPLATFORM_NOT_EXIST' => '未配置微信开放平台',
|
||||
'WEAPP_EXIST' => '该小程序已经授权给其他站点',
|
||||
'WECHAT_EXIST' => '该公众号已经授权给其他站点',
|
||||
'PLEASE_ADD_FIRST_SITE_GROUP' => '请先添加站点套餐'
|
||||
'PLEASE_ADD_FIRST_SITE_GROUP' => '请先添加站点套餐',
|
||||
|
||||
'PRINTER_NOT_EXIST' => '打印机不存在'
|
||||
];
|
||||
|
||||
@ -38,18 +38,6 @@ return [
|
||||
'status_off' => '停用'
|
||||
],
|
||||
// 站点
|
||||
'dict_site' => [
|
||||
//站点类型
|
||||
'type_cms' => 'cms',
|
||||
'status_on' => '正常',
|
||||
'status_experience' => '体验期',
|
||||
'status_expire' => '已到期',
|
||||
'status_close' => '已停止',
|
||||
'pay' => '支付',
|
||||
'refund' => '退款',
|
||||
'transfer' => '转账',
|
||||
],
|
||||
// 站点
|
||||
'dict_site_index' => [
|
||||
//站点类型
|
||||
'system' => '框架首页',
|
||||
@ -232,6 +220,7 @@ return [
|
||||
'member_my_level' => '会员等级',
|
||||
'member_my_sign_in' => '我的签到',
|
||||
'member_verify_index' => '核销台',
|
||||
'member_contact' => '客服',
|
||||
|
||||
'diy_page' => '自定义页面',
|
||||
'diy_link' => '自定义链接',
|
||||
@ -379,4 +368,8 @@ return [
|
||||
'status_not_sign' => '未签到',
|
||||
'status_signed' => '已签到'
|
||||
],
|
||||
// 打印机品牌
|
||||
'dict_printer' => [
|
||||
'yilianyun' => '易联云打印机'
|
||||
]
|
||||
];
|
||||
|
||||
@ -30,11 +30,11 @@ return [
|
||||
'limit_between' => 'limit必须是正整数并且不能超过120',
|
||||
],
|
||||
'validate_user' => [
|
||||
'username_require' => '用户名必须填写',
|
||||
'username_unique' => '用户名必须是惟一的',
|
||||
'username_max' => '用户名最多不能超过15个字符',
|
||||
'username_require' => '账号必须填写',
|
||||
'username_unique' => '账号必须是唯一的',
|
||||
'username_max' => '账号最多不能超过15个字符',
|
||||
'real_name_require' => '实际姓名必须填写',
|
||||
'password_require' => '用户密码必须填写',
|
||||
'password_require' => '账号密码必须填写',
|
||||
],
|
||||
//站点
|
||||
'validate_site' => [
|
||||
|
||||
@ -9,14 +9,14 @@
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\listener\member;
|
||||
namespace app\listener\member_export;
|
||||
|
||||
use app\model\member\Member;
|
||||
|
||||
/**
|
||||
* 会员导出数据源查询
|
||||
* Class MemberExportTypeListener
|
||||
* @package app\listener\member
|
||||
* Class MemberExportDataListener
|
||||
* @package app\listener\member_export
|
||||
*/
|
||||
class MemberExportDataListener
|
||||
{
|
||||
@ -26,7 +26,7 @@ class MemberExportDataListener
|
||||
$data = [];
|
||||
if ($param['type'] == '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'])
|
||||
->with(['memberLevelNameBind'])->field($field)->append(['register_channel_name', 'sex_name', 'status_name']);
|
||||
@ -36,10 +36,9 @@ class MemberExportDataListener
|
||||
$data = $search_model->select()->toArray();
|
||||
}
|
||||
foreach ($data as $key => $value) {
|
||||
$data[$key]['username'] = !empty($value['username']) ? $value['username'] : '-';
|
||||
$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]['last_visit_time'] = !empty($value['last_visit_time']) ? $value['last_visit_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'] : '';
|
||||
}
|
||||
}
|
||||
return $data;
|
||||
@ -9,7 +9,7 @@
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\listener\member;
|
||||
namespace app\listener\member_export;
|
||||
|
||||
/**
|
||||
* 会员导出数据类型查询
|
||||
@ -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"
|
||||
]
|
||||
];
|
||||
}
|
||||
}
|
||||
@ -38,7 +38,7 @@ class Poster
|
||||
|
||||
$headimg = $member_info[ 'headimg' ];
|
||||
if (empty($headimg)) {
|
||||
$headimg = 'static/resource/images/default_headimg.jpg';
|
||||
$headimg = 'static/resource/images/default_headimg.png';
|
||||
}
|
||||
$return_data = [
|
||||
'nickname' => $nickname,
|
||||
|
||||
@ -77,7 +77,7 @@ class Addon extends BaseModel
|
||||
*/
|
||||
public function searchTitleAttr($query, $value, $data)
|
||||
{
|
||||
if ($value) {
|
||||
if ($value != '') {
|
||||
$query->whereLike('title', '%' . $value . '%');
|
||||
}
|
||||
}
|
||||
|
||||
@ -12,9 +12,6 @@
|
||||
namespace app\model\dict;
|
||||
|
||||
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
|
||||
{
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 数据表主键
|
||||
* @var string
|
||||
@ -54,7 +49,7 @@ class Dict extends BaseModel
|
||||
*/
|
||||
public function searchNameAttr($query, $value, $data)
|
||||
{
|
||||
if ($value) {
|
||||
if ($value != '') {
|
||||
$query->where("name", $value);
|
||||
}
|
||||
}
|
||||
@ -66,12 +61,9 @@ class Dict extends BaseModel
|
||||
*/
|
||||
public function searchKeyAttr($query, $value, $data)
|
||||
{
|
||||
if ($value) {
|
||||
if ($value != '') {
|
||||
$query->where("key", $value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -174,8 +174,8 @@ class Diy extends BaseModel
|
||||
*/
|
||||
public function searchTitleAttr($query, $value, $data)
|
||||
{
|
||||
if ($value) {
|
||||
$query->where("title|page_title", 'like', '%' . $value . '%');
|
||||
if ($value != '') {
|
||||
$query->where("title|page_title", 'like', '%' . $this->handelSpecialCharacter($value) . '%');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -55,7 +55,7 @@ class DiyRoute extends BaseModel
|
||||
*/
|
||||
public function searchTitleAttr($query, $value, $data)
|
||||
{
|
||||
if ($value) {
|
||||
if ($value != '') {
|
||||
$query->where("title", 'like', '%' . $value . '%');
|
||||
}
|
||||
}
|
||||
|
||||
@ -44,7 +44,7 @@ class GenerateTable extends BaseModel
|
||||
*/
|
||||
public function searchTableNameAttr($query, $value, $data)
|
||||
{
|
||||
if ($value) {
|
||||
if ($value != '') {
|
||||
$query->where('table_name', 'like', '%' . $value . '%');
|
||||
}
|
||||
}
|
||||
@ -57,7 +57,7 @@ class GenerateTable extends BaseModel
|
||||
*/
|
||||
public function searchTableContentAttr($query, $value, $data)
|
||||
{
|
||||
if ($value) {
|
||||
if ($value != '') {
|
||||
$query->where('table_content', 'like', '%' . $value . '%');
|
||||
}
|
||||
}
|
||||
@ -70,7 +70,7 @@ class GenerateTable extends BaseModel
|
||||
*/
|
||||
public function searchAddonNameAttr($query, $value, $data)
|
||||
{
|
||||
if ($value) {
|
||||
if ($value != '') {
|
||||
if($value == 2)
|
||||
{
|
||||
$query->where('addon_name','=','');
|
||||
|
||||
@ -161,8 +161,8 @@ class Member extends BaseModel
|
||||
*/
|
||||
public function searchKeywordAttr($query, $value, $data)
|
||||
{
|
||||
if ($value) {
|
||||
$query->where('member_no|username|nickname|mobile', 'like', '%' . $value . '%');
|
||||
if ($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');
|
||||
}
|
||||
|
||||
public function memberLevelNameBind() {
|
||||
public function memberLevelNameBind()
|
||||
{
|
||||
return $this->hasOne(MemberLevel::class, 'level_id', 'member_level')->bind([ 'member_level_name' => 'level_name' ]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,6 +14,7 @@ namespace app\model\member;
|
||||
use app\dict\member\MemberAccountChangeTypeDict;
|
||||
use app\dict\member\MemberAccountTypeDict;
|
||||
use core\base\BaseModel;
|
||||
use think\db\Query;
|
||||
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
|
||||
|
||||
@ -157,7 +157,7 @@ class MemberCashOut extends BaseModel
|
||||
*/
|
||||
public function searchCashOutNoAttr($query, $value, $data)
|
||||
{
|
||||
if ($value) {
|
||||
if ($value != '') {
|
||||
$query->where('cash_out_no', $value);
|
||||
}
|
||||
}
|
||||
|
||||
@ -62,8 +62,8 @@ class MemberLabel extends BaseModel
|
||||
*/
|
||||
public function searchLabelNameAttr($query, $value, $data)
|
||||
{
|
||||
if ($value) {
|
||||
$query->where('label_name', 'like', '%' . $value . '%');
|
||||
if ($value != '') {
|
||||
$query->where('label_name', 'like', '%' . $this->handelSpecialCharacter($value) . '%');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -11,7 +11,6 @@
|
||||
|
||||
namespace app\model\member;
|
||||
|
||||
use app\service\core\member\CoreMemberService;
|
||||
use core\base\BaseModel;
|
||||
|
||||
/**
|
||||
@ -63,7 +62,7 @@ class MemberLevel extends BaseModel
|
||||
public function searchLevelNameAttr($query, $value, $data)
|
||||
{
|
||||
if ($value != '') {
|
||||
$query->where('level_name', 'like', '%'.$value.'%');
|
||||
$query->where('level_name', 'like', '%' . $this->handelSpecialCharacter($value) . '%');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -66,8 +66,8 @@ class Poster extends BaseModel
|
||||
*/
|
||||
public function searchNameAttr($query, $value, $data)
|
||||
{
|
||||
if ($value) {
|
||||
$query->where("name", 'like', '%' . $value . '%');
|
||||
if ($value != '') {
|
||||
$query->where("name", 'like', '%' . $this->handelSpecialCharacter($value) . '%');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -70,7 +70,7 @@ class SysExport extends BaseModel
|
||||
public function searchExportKeyAttr(Query $query, $value, $data)
|
||||
{
|
||||
if ($value) {
|
||||
$query->whereLike('export_key', '%' . $value . '%');
|
||||
$query->where('export_key', $value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -112,7 +112,7 @@ class SysNoticeLog extends BaseModel
|
||||
*/
|
||||
public function searchReceiverAttr($query, $value)
|
||||
{
|
||||
if ($value) {
|
||||
if ($value != '') {
|
||||
$query->where('receiver', $value);
|
||||
}
|
||||
}
|
||||
|
||||
@ -143,7 +143,7 @@ class SysNoticeSmsLog extends BaseModel
|
||||
*/
|
||||
public function searchMobileAttr($query, $value)
|
||||
{
|
||||
if ($value) {
|
||||
if ($value != '') {
|
||||
$query->where('mobile', $value);
|
||||
}
|
||||
}
|
||||
|
||||
106
niucloud/app/model/sys/SysPrinter.php
Normal file
106
niucloud/app/model/sys/SysPrinter.php
Normal 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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
94
niucloud/app/model/sys/SysPrinterTemplate.php
Normal file
94
niucloud/app/model/sys/SysPrinterTemplate.php
Normal 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 . '%');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -38,16 +38,9 @@ class SysRole extends BaseModel
|
||||
// 设置JSON数据返回数组
|
||||
protected $jsonAssoc = true;
|
||||
|
||||
/**
|
||||
* 角色状态
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @return string
|
||||
*/
|
||||
public function getStatusNameAttr($value, $data)
|
||||
{
|
||||
return RoleStatusDict::getStatus()[ $data[ 'status' ] ] ?? '';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -14,7 +14,6 @@ namespace app\model\sys;
|
||||
use app\dict\sys\UserDict;
|
||||
use core\base\BaseModel;
|
||||
use think\model\concern\SoftDelete;
|
||||
use think\model\relation\HasMany;
|
||||
|
||||
/**
|
||||
* 系统用户模型
|
||||
@ -50,14 +49,13 @@ class SysUser extends BaseModel
|
||||
protected $json = [ 'role_ids' ];
|
||||
// 设置JSON数据返回数组
|
||||
protected $jsonAssoc = true;
|
||||
|
||||
/**
|
||||
* 定义软删除字段的默认值
|
||||
* @var int
|
||||
*/
|
||||
protected $defaultSoftDelete = 0;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 状态字段转化
|
||||
* @param $value
|
||||
@ -70,6 +68,7 @@ class SysUser extends BaseModel
|
||||
return UserDict::getStatus()[ $data[ 'status' ] ] ?? '';
|
||||
}
|
||||
|
||||
|
||||
public function getCreateTimeAttr($value, $data)
|
||||
{
|
||||
return $data[ 'create_time' ] ? get_date_by_time($data[ 'create_time' ]) : '';
|
||||
@ -82,8 +81,8 @@ class SysUser extends BaseModel
|
||||
*/
|
||||
public function searchUsernameAttr($query, $value)
|
||||
{
|
||||
if ($value) {
|
||||
$query->whereLike('username', '%' . $value . '%');
|
||||
if ($value != '') {
|
||||
$query->whereLike('username', '%' . $this->handelSpecialCharacter($value) . '%');
|
||||
}
|
||||
|
||||
}
|
||||
@ -95,26 +94,12 @@ class SysUser extends BaseModel
|
||||
*/
|
||||
public function searchRealnameAttr($query, $value)
|
||||
{
|
||||
if ($value) {
|
||||
if ($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
|
||||
@ -124,17 +109,6 @@ class SysUser extends BaseModel
|
||||
$query->where('is_del', 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 状态搜索器
|
||||
* @param $query
|
||||
* @param $value
|
||||
*/
|
||||
public function searchStatusAttr($query, $value)
|
||||
{
|
||||
$query->where('status', $value);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 创建时间搜索器
|
||||
* @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 ] ]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -61,7 +61,7 @@ class SysUserLog extends BaseModel
|
||||
*/
|
||||
public function searchUsernameAttr(Query $query, $value, $data)
|
||||
{
|
||||
if ($value) {
|
||||
if ($value != '') {
|
||||
$query->whereLike('username', '%' . $value . '%');
|
||||
}
|
||||
}
|
||||
@ -87,7 +87,7 @@ class SysUserLog extends BaseModel
|
||||
*/
|
||||
public function searchUrlAttr(Query $query, $value, $data)
|
||||
{
|
||||
if ($value) {
|
||||
if ($value != '') {
|
||||
$query->whereLike('url', '%' . $value . '%');
|
||||
}
|
||||
}
|
||||
@ -100,7 +100,7 @@ class SysUserLog extends BaseModel
|
||||
*/
|
||||
public function searchIpAttr(Query $query, $value, $data)
|
||||
{
|
||||
if ($value) {
|
||||
if ($value != '') {
|
||||
$query->whereLike('ip', '%' . $value . '%');
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,7 +11,6 @@
|
||||
|
||||
namespace app\model\verify;
|
||||
|
||||
use app\dict\verify\VerifyDict;
|
||||
use app\model\member\Member;
|
||||
use core\base\BaseModel;
|
||||
|
||||
|
||||
@ -54,8 +54,21 @@ class Verify extends BaseModel
|
||||
*/
|
||||
public function searchCodeAttr(Query $query, $value, $data)
|
||||
{
|
||||
if ($value) {
|
||||
$query->whereLike('code', '%'.$value.'%');
|
||||
if ($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) . '%');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -24,7 +24,6 @@ class AppletDownloadService extends BaseAdminService
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -12,7 +12,6 @@
|
||||
namespace app\service\admin\auth;
|
||||
|
||||
use app\Request;
|
||||
use app\service\admin\addon\AddonService;
|
||||
use app\service\admin\sys\MenuService;
|
||||
use app\service\admin\sys\RoleService;
|
||||
use app\service\admin\user\UserService;
|
||||
@ -34,7 +33,8 @@ class AuthService extends BaseAdminService
|
||||
* @return bool
|
||||
* @throws Exception
|
||||
*/
|
||||
public function checkRole(Request $request){
|
||||
public function checkRole(Request $request)
|
||||
{
|
||||
|
||||
$rule = strtolower(trim($request->rule()->getRule()));
|
||||
$method = strtolower(trim($request->method()));
|
||||
@ -58,7 +58,8 @@ class AuthService extends BaseAdminService
|
||||
* 当前授权用户接口权限
|
||||
* @return array
|
||||
*/
|
||||
public function getAuthApiList(){
|
||||
public function getAuthApiList()
|
||||
{
|
||||
$user_info = ( new UserService() )->getUserCache($this->uid);
|
||||
if (empty($user_info))
|
||||
return [];
|
||||
@ -80,7 +81,8 @@ class AuthService extends BaseAdminService
|
||||
* 当前授权用户菜单权限
|
||||
* @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);
|
||||
if (empty($user_info))
|
||||
return [];
|
||||
@ -99,7 +101,8 @@ class AuthService extends BaseAdminService
|
||||
/**
|
||||
* 获取授权用户信息
|
||||
*/
|
||||
public function getAuthInfo(){
|
||||
public function getAuthInfo()
|
||||
{
|
||||
return ( new UserService() )->getUserCache($this->uid);
|
||||
}
|
||||
|
||||
@ -108,7 +111,8 @@ class AuthService extends BaseAdminService
|
||||
* @param array $data
|
||||
* @return true
|
||||
*/
|
||||
public function editAuth(array $data){
|
||||
public function editAuth(array $data)
|
||||
{
|
||||
if (!empty($data[ 'password' ])) {
|
||||
//检测原始密码是否正确
|
||||
$user = ( new UserService() )->find($this->uid);
|
||||
@ -118,41 +122,4 @@ class AuthService extends BaseAdminService
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -37,7 +37,7 @@ class DiyConfigService extends BaseAdminService
|
||||
$apps = ( new CoreAddonService() )->getList([ [ 'type', '=', 'app' ] ]);
|
||||
|
||||
// 单应用,排除 系统 底部导航设置
|
||||
if (count($apps) == 1) {
|
||||
if (count($list) > 1 && count($apps) == 1) {
|
||||
foreach ($list as $k => $v) {
|
||||
if ($v[ 'key' ] = 'app') {
|
||||
unset($list[ $k ]);
|
||||
|
||||
@ -50,7 +50,7 @@ class DiyRouteService extends BaseAdminService
|
||||
if (!empty($cv[ 'url' ])) {
|
||||
$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;
|
||||
}
|
||||
|
||||
|
||||
@ -11,7 +11,6 @@
|
||||
|
||||
namespace app\service\admin\generator;
|
||||
|
||||
use app\model\addon\Addon;
|
||||
use app\model\generator\GenerateColumn;
|
||||
use app\model\generator\GenerateTable;
|
||||
use core\base\BaseAdminService;
|
||||
@ -23,7 +22,6 @@ use think\db\exception\ModelNotFoundException;
|
||||
use think\facade\Db;
|
||||
use think\helper\Str;
|
||||
use think\Model;
|
||||
use think\model\relation\HasOne;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -11,9 +11,6 @@
|
||||
|
||||
namespace app\service\admin\generator\core;
|
||||
|
||||
use app\dict\sys\MenuDict;
|
||||
use app\model\sys\SysMenu;
|
||||
use think\facade\Cache;
|
||||
use think\helper\Str;
|
||||
|
||||
/**
|
||||
|
||||
@ -307,6 +307,7 @@ class ValidateGenerator extends BaseGenerator
|
||||
$dir .= $this->moduleName . '/';
|
||||
return $dir;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成的文件名
|
||||
* @return string
|
||||
@ -316,5 +317,4 @@ class ValidateGenerator extends BaseGenerator
|
||||
return $this->getUCaseClassName() . '.php';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -15,7 +15,6 @@ namespace app\service\admin\generator\core;
|
||||
|
||||
|
||||
|
||||
use app\service\core\menu\CoreMenuService;
|
||||
use think\helper\Str;
|
||||
|
||||
/**
|
||||
|
||||
@ -38,7 +38,7 @@ class {UCASE_NAME}Service extends BaseAdminService
|
||||
$field = '{FIELDS}';
|
||||
$order = '{ORDER}';
|
||||
|
||||
$search_model = {SEARCH_MODEL};
|
||||
$search_model = {SEARCH_MODEL}
|
||||
$list = $this->pageQuery($search_model);
|
||||
return $list;
|
||||
}
|
||||
@ -52,7 +52,7 @@ class {UCASE_NAME}Service extends BaseAdminService
|
||||
{
|
||||
$field = '{FIELDS}';
|
||||
|
||||
$info = {INFO_SEARCH_MODEL};
|
||||
$info = {INFO_SEARCH_MODEL}
|
||||
return $info;
|
||||
}
|
||||
|
||||
|
||||
@ -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';
|
||||
$member_where = [];
|
||||
if (!empty($where[ 'keywords' ])) {
|
||||
$member_where[] = [ "member.member_no|member.nickname|member.mobile", 'like', '%' . $where[ 'keywords' ] . '%' ];
|
||||
if (isset($where[ 'keywords' ]) && $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)
|
||||
->withJoin(
|
||||
|
||||
@ -16,7 +16,6 @@ use app\dict\member\MemberRegisterTypeDict;
|
||||
use app\model\member\Member;
|
||||
use app\service\admin\sys\ExportService;
|
||||
use app\service\core\member\CoreMemberService;
|
||||
use app\service\core\sys\CoreExportService;
|
||||
use core\base\BaseAdminService;
|
||||
use core\dict\DictLoader;
|
||||
use core\exception\AdminException;
|
||||
|
||||
@ -36,9 +36,9 @@ class MemberSignService extends BaseAdminService
|
||||
public function getPage(array $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';
|
||||
$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');
|
||||
|
||||
@ -115,7 +115,7 @@ class SmsService extends BaseAdminService
|
||||
{
|
||||
$config['default'] = $sms_type;
|
||||
}else{
|
||||
$config['default'] = '';
|
||||
$config['default'] = $config['default'] == $sms_type ? '' : $config['default'];
|
||||
}
|
||||
foreach ($sms_type_list[$sms_type]['params'] as $k_param => $v_param)
|
||||
{
|
||||
|
||||
@ -154,6 +154,8 @@ class PayChannelService extends BaseAdminService
|
||||
'collection_desc' => $data[ 'collection_desc' ] ?? '',// 必填-转账说明
|
||||
];
|
||||
break;
|
||||
default:
|
||||
$config = $data;
|
||||
}
|
||||
return $config;
|
||||
}
|
||||
|
||||
@ -12,10 +12,8 @@
|
||||
namespace app\service\admin\pay;
|
||||
|
||||
use app\dict\pay\PayDict;
|
||||
use app\model\pay\Pay;
|
||||
use app\model\pay\Refund;
|
||||
use app\service\core\pay\CoreRefundService;
|
||||
use app\service\core\paytype\CoreOfflineService;
|
||||
use core\base\BaseAdminService;
|
||||
|
||||
/**
|
||||
|
||||
@ -206,8 +206,7 @@ class AttachmentService extends BaseAdminService
|
||||
*/
|
||||
public function getCategoryPage(array $data)
|
||||
{
|
||||
$where = array (
|
||||
);
|
||||
$where = array ();
|
||||
if (!empty($data[ 'type' ])) {
|
||||
$where[] = [ 'type', '=', $data[ 'type' ] ];
|
||||
}
|
||||
@ -231,8 +230,8 @@ class AttachmentService extends BaseAdminService
|
||||
if (!empty($data[ 'type' ])) {
|
||||
$where[] = [ 'type', '=', $data[ 'type' ] ];
|
||||
}
|
||||
if (!empty($data[ 'name' ])) {
|
||||
$where[] = [ 'name', 'like', '%' . $data[ 'name' ] . '%' ];
|
||||
if (isset($data[ 'name' ]) && $data[ 'name' ] != '') {
|
||||
$where[] = [ 'name', 'like', '%' . $this->model->handelSpecialCharacter($data[ 'name' ]) . '%' ];
|
||||
}
|
||||
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();
|
||||
foreach ($icon_list as $k => $v) {
|
||||
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 ]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -102,11 +102,13 @@ class ConfigService extends BaseAdminService
|
||||
{
|
||||
return $this->core_config_service->setConfig('WEB_SITE_INFO', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取前端域名
|
||||
* @return array|string[]
|
||||
*/
|
||||
public function getSceneDomain(){
|
||||
public function getSceneDomain()
|
||||
{
|
||||
return ( new CoreSysConfigService() )->getSceneDomain();
|
||||
}
|
||||
|
||||
@ -117,8 +119,7 @@ class ConfigService extends BaseAdminService
|
||||
public function getService()
|
||||
{
|
||||
$info = ( new CoreConfigService() )->getConfig('SERVICE_INFO');
|
||||
if(empty($info))
|
||||
{
|
||||
if (empty($info)) {
|
||||
$info = [];
|
||||
$info[ 'value' ] = [
|
||||
'wechat_code' => '',
|
||||
@ -181,215 +182,6 @@ class ConfigService extends BaseAdminService
|
||||
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
|
||||
@ -404,7 +196,8 @@ class ConfigService extends BaseAdminService
|
||||
* 获取开发者key
|
||||
* @return array
|
||||
*/
|
||||
public function getDeveloperToken() {
|
||||
public function getDeveloperToken()
|
||||
{
|
||||
return ( new CoreConfigService() )->getConfigValue("DEVELOPER_TOKEN");
|
||||
}
|
||||
|
||||
@ -413,7 +206,8 @@ class ConfigService extends BaseAdminService
|
||||
* @param array $data
|
||||
* @return array
|
||||
*/
|
||||
public function setDeveloperToken(array $data) {
|
||||
public function setDeveloperToken(array $data)
|
||||
{
|
||||
return ( new CoreConfigService() )->setConfig("DEVELOPER_TOKEN", $data);
|
||||
}
|
||||
}
|
||||
|
||||
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