mirror of
https://gitee.com/niucloud-team/niucloud-admin.git
synced 2025-12-12 10:52:48 +00:00
up
This commit is contained in:
parent
0e98ec1b94
commit
bee973460f
133
niucloud/app/adminapi/controller/web/Adv.php
Normal file
133
niucloud/app/adminapi/controller/web/Adv.php
Normal file
@ -0,0 +1,133 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的saas管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\web;
|
||||
|
||||
use app\dict\web\AdvPositionDict;
|
||||
use app\service\admin\web\AdvService;
|
||||
use core\base\BaseAdminController;
|
||||
use think\Response;
|
||||
|
||||
|
||||
/**
|
||||
* 广告管理
|
||||
* Class Nav
|
||||
* @package app\adminapi\controller\web
|
||||
*/
|
||||
class Adv extends BaseAdminController
|
||||
{
|
||||
|
||||
/**
|
||||
* 广告位
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function advPosition()
|
||||
{
|
||||
return success(AdvPositionDict::getAdvPosition());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取广告分页列表
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function pages()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ 'adv_key', '' ]
|
||||
]);
|
||||
return success(( new AdvService() )->getPage($data));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取广告列表
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ 'adv_key', '' ]
|
||||
]);
|
||||
return success(( new AdvService() )->getList($data));
|
||||
}
|
||||
|
||||
/**
|
||||
* 广告详情
|
||||
* @param int $id
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function info(int $id)
|
||||
{
|
||||
return success(( new AdvService() )->getInfo($id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加广告
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ 'adv_key', '' ],
|
||||
[ 'adv_title', '' ],
|
||||
[ 'adv_url', '' ],
|
||||
[ 'adv_image', '' ],
|
||||
[ 'sort', 0 ],
|
||||
[ 'background', '#FFFFFF' ],
|
||||
]);
|
||||
$id = ( new AdvService() )->add($data);
|
||||
return success('ADD_SUCCESS', [ 'id' => $id ]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 广告编辑
|
||||
* @param $id 广告id
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ 'adv_key', '' ],
|
||||
[ 'adv_title', '' ],
|
||||
[ 'adv_url', '' ],
|
||||
[ 'adv_image', '' ],
|
||||
[ 'sort', 0 ],
|
||||
[ 'background', '#FFFFFF' ],
|
||||
]);
|
||||
( new AdvService() )->edit($id, $data);
|
||||
return success('EDIT_SUCCESS');
|
||||
}
|
||||
|
||||
/**
|
||||
* 广告删除
|
||||
* @param int $id
|
||||
* @return Response
|
||||
*/
|
||||
public function del(int $id)
|
||||
{
|
||||
( new AdvService() )->del($id);
|
||||
return success('DELETE_SUCCESS');
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改广告位排序号
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function editSort()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ 'id', '' ],
|
||||
[ 'sort', '' ],
|
||||
]);
|
||||
( new AdvService() )->editSort($data);
|
||||
return success('SUCCESS');
|
||||
}
|
||||
|
||||
}
|
||||
34
niucloud/app/adminapi/controller/web/Config.php
Normal file
34
niucloud/app/adminapi/controller/web/Config.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的saas管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\web;
|
||||
|
||||
use app\service\admin\web\WebService;
|
||||
use core\base\BaseAdminController;
|
||||
|
||||
|
||||
/**
|
||||
* PC控制器
|
||||
* Class Web
|
||||
* @package app\adminapi\controller\web
|
||||
*/
|
||||
class Config extends BaseAdminController
|
||||
{
|
||||
|
||||
/**
|
||||
* 获取自定义链接列表
|
||||
*/
|
||||
public function getLink()
|
||||
{
|
||||
$web_service = new WebService();
|
||||
return success($web_service->getLink());
|
||||
}
|
||||
}
|
||||
110
niucloud/app/adminapi/controller/web/FriendlyLink.php
Normal file
110
niucloud/app/adminapi/controller/web/FriendlyLink.php
Normal file
@ -0,0 +1,110 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的多应用管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\web;
|
||||
|
||||
use core\base\BaseAdminController;
|
||||
use app\service\admin\web\FriendlyLinkService;
|
||||
use think\Response;
|
||||
|
||||
|
||||
/**
|
||||
* 友情链接控制器
|
||||
* Class FriendlyLink
|
||||
* @package app\adminapi\controller\web
|
||||
*/
|
||||
class FriendlyLink extends BaseAdminController
|
||||
{
|
||||
/**
|
||||
* 获取友情链接列表
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ 'link_title', '' ]
|
||||
]);
|
||||
return success(( new FriendlyLinkService() )->getPage($data));
|
||||
}
|
||||
|
||||
/**
|
||||
* 友情链接详情
|
||||
* @param int $id
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function info(int $id)
|
||||
{
|
||||
return success(( new FriendlyLinkService() )->getInfo($id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加友情链接
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ 'link_pic', '' ],
|
||||
[ 'link_title', '' ],
|
||||
[ 'link_url', '' ],
|
||||
[ 'sort', 0 ],
|
||||
[ 'is_show', 0 ]
|
||||
]);
|
||||
$this->validate($data, 'app\validate\web\FriendlyLink.add');
|
||||
$id = ( new FriendlyLinkService() )->add($data);
|
||||
return success('ADD_SUCCESS', [ 'id' => $id ]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 友情链接编辑
|
||||
* @param int $id 友情链接id
|
||||
* @return Response
|
||||
*/
|
||||
public function edit(int $id)
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ 'link_pic', '' ],
|
||||
[ 'link_title', '' ],
|
||||
[ 'link_url', '' ],
|
||||
[ 'sort', 0 ],
|
||||
[ 'is_show', 0 ]
|
||||
]);
|
||||
$this->validate($data, 'app\validate\web\FriendlyLink.edit');
|
||||
( new FriendlyLinkService() )->edit($id, $data);
|
||||
return success('EDIT_SUCCESS');
|
||||
}
|
||||
|
||||
/**
|
||||
* 友情链接删除
|
||||
* @param int $id 友情链接id
|
||||
* @return Response
|
||||
*/
|
||||
public function del(int $id)
|
||||
{
|
||||
( new FriendlyLinkService() )->del($id);
|
||||
return success('DELETE_SUCCESS');
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改友情链接排序号
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function editSort()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ 'id', '' ],
|
||||
[ 'sort', '' ],
|
||||
]);
|
||||
( new FriendlyLinkService() )->editSort($data);
|
||||
return success('SUCCESS');
|
||||
}
|
||||
|
||||
}
|
||||
121
niucloud/app/adminapi/controller/web/Nav.php
Normal file
121
niucloud/app/adminapi/controller/web/Nav.php
Normal file
@ -0,0 +1,121 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的saas管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\controller\web;
|
||||
|
||||
use app\service\admin\web\NavService;
|
||||
use core\base\BaseAdminController;
|
||||
use think\Response;
|
||||
|
||||
|
||||
/**
|
||||
* 电脑端导航
|
||||
* Class Nav
|
||||
* @package app\adminapi\controller\web
|
||||
*/
|
||||
class Nav extends BaseAdminController
|
||||
{
|
||||
|
||||
/**
|
||||
* 获取首页导航分页列表
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function pages()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ "nav_title", "" ],
|
||||
]);
|
||||
return success(( new NavService() )->getPage($data));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取首页导航列表
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ "nav_title", "" ]
|
||||
]);
|
||||
return success(( new NavService() )->getList($data));
|
||||
}
|
||||
|
||||
/**
|
||||
* 首页导航详情
|
||||
* @param int $id
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function info(int $id)
|
||||
{
|
||||
return success(( new NavService() )->getInfo($id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加首页导航
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ "nav_title", "" ],
|
||||
[ "nav_url", "" ],
|
||||
[ "sort", "" ],
|
||||
[ "is_blank", "" ],
|
||||
[ "is_show", "" ],
|
||||
]);
|
||||
$id = ( new NavService() )->add($data);
|
||||
return success('ADD_SUCCESS', [ 'id' => $id ]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 首页导航编辑
|
||||
* @param $id 首页导航id
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ "nav_title", "" ],
|
||||
[ "nav_url", "" ],
|
||||
[ "sort", "" ],
|
||||
[ "is_blank", "" ],
|
||||
[ "is_show", "" ],
|
||||
]);
|
||||
( new NavService() )->edit($id, $data);
|
||||
return success('EDIT_SUCCESS');
|
||||
}
|
||||
|
||||
/**
|
||||
* 首页导航删除
|
||||
* @param int $id 首页导航id
|
||||
* @return Response
|
||||
*/
|
||||
public function del(int $id)
|
||||
{
|
||||
( new NavService() )->del($id);
|
||||
return success('DELETE_SUCCESS');
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改首页导航排序号
|
||||
* @return \think\Response
|
||||
*/
|
||||
public function editSort()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ 'id', '' ],
|
||||
[ 'sort', '' ],
|
||||
]);
|
||||
( new NavService() )->editSort($data);
|
||||
return success('SUCCESS');
|
||||
}
|
||||
|
||||
}
|
||||
89
niucloud/app/adminapi/route/web.php
Normal file
89
niucloud/app/adminapi/route/web.php
Normal file
@ -0,0 +1,89 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的多应用管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
use think\facade\Route;
|
||||
|
||||
use app\adminapi\middleware\AdminCheckRole;
|
||||
use app\adminapi\middleware\AdminCheckToken;
|
||||
use app\adminapi\middleware\AdminLog;
|
||||
|
||||
/**
|
||||
* 电脑端相关
|
||||
*/
|
||||
Route::group('web', function() {
|
||||
|
||||
/***************************************************** 电脑端管理 ****************************************************/
|
||||
//链接列表
|
||||
Route::get('link', 'web.Config/getLink');
|
||||
|
||||
//首页导航分页列表
|
||||
Route::get('nav', 'web.Nav/pages');
|
||||
|
||||
//首页导航列表
|
||||
Route::get('nav/list', 'web.Nav/lists');
|
||||
|
||||
//首页导航详情
|
||||
Route::get('nav/:id', 'web.Nav/info');
|
||||
|
||||
//添加首页导航
|
||||
Route::post('nav', 'web.Nav/add');
|
||||
|
||||
//添加首页导航
|
||||
Route::put('nav/:id', 'web.Nav/edit');
|
||||
|
||||
//删除首页导航
|
||||
Route::delete('nav/:id', 'web.Nav/del');
|
||||
|
||||
//修改首页导航排序号
|
||||
Route::put('nav/sort', 'web.Nav/editSort');
|
||||
|
||||
//友情链接列表
|
||||
Route::get('friendly_link', 'web.FriendlyLink/lists');
|
||||
|
||||
//友情链接详情
|
||||
Route::get('friendly_link/:id', 'web.FriendlyLink/info');
|
||||
|
||||
//添加友情链接
|
||||
Route::post('friendly_link', 'web.FriendlyLink/add');
|
||||
|
||||
//编辑友情链接
|
||||
Route::put('friendly_link/:id', 'web.FriendlyLink/edit');
|
||||
|
||||
//删除友情链接
|
||||
Route::delete('friendly_link/:id', 'web.FriendlyLink/del');
|
||||
|
||||
//修改友情链接排序号
|
||||
Route::put('friendly_link/sort', 'web.FriendlyLink/editSort');
|
||||
|
||||
|
||||
/***************************************************** 广告管理 *****************************************************/
|
||||
// 广告位管理
|
||||
Route::get('adv_position', 'web.Adv/advPosition');
|
||||
|
||||
//广告管理
|
||||
Route::get('adv', 'web.Adv/pages');
|
||||
|
||||
Route::get('adv/:id', 'web.Adv/info');
|
||||
|
||||
Route::post('adv', 'web.Adv/add');
|
||||
|
||||
Route::put('adv/:id', 'web.Adv/edit');
|
||||
|
||||
Route::delete('adv/:id', 'web.Adv/del');
|
||||
|
||||
//修改广告位排序号
|
||||
Route::put('adv/sort', 'web.Adv/editSort');
|
||||
|
||||
})->middleware([
|
||||
AdminCheckToken::class,
|
||||
AdminCheckRole::class,
|
||||
AdminLog::class
|
||||
]);
|
||||
@ -15,9 +15,7 @@ use app\service\api\diy\DiyConfigService;
|
||||
use app\service\api\member\MemberConfigService;
|
||||
use app\service\api\member\MemberLevelService;
|
||||
use app\service\api\member\MemberService;
|
||||
use app\service\api\site\SiteService;
|
||||
use app\service\api\sys\ConfigService;
|
||||
use app\service\api\wechat\WechatAuthService;
|
||||
use core\base\BaseApiController;
|
||||
use think\Response;
|
||||
|
||||
@ -90,6 +88,8 @@ class Config extends BaseApiController
|
||||
$res[ 'login_config' ] = ( new MemberConfigService() )->getLoginConfig($data[ 'url' ]);
|
||||
|
||||
( new MemberService() )->initMemberData();
|
||||
|
||||
event('initWap');
|
||||
return success($res);
|
||||
}
|
||||
}
|
||||
|
||||
@ -32,11 +32,13 @@ class Verify extends BaseApiController
|
||||
|
||||
/**
|
||||
* 获取核销码信息
|
||||
* @param $code
|
||||
* @return Response
|
||||
*/
|
||||
public function getInfoByCode($code){
|
||||
return success(data:(new VerifyService())->getInfoByCode($code));
|
||||
public function getInfoByCode(){
|
||||
$data = $this->request->params([
|
||||
['code', ''],
|
||||
]);
|
||||
return success(data:(new VerifyService())->getInfoByCode($data['code']));
|
||||
}
|
||||
/**
|
||||
* 核销
|
||||
|
||||
28
niucloud/app/api/controller/web/Adv.php
Normal file
28
niucloud/app/api/controller/web/Adv.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-mall 企业快速开发的多应用管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\api\controller\web;
|
||||
|
||||
use app\service\api\web\AdvService;
|
||||
use core\base\BaseApiController;
|
||||
|
||||
class Adv extends BaseApiController
|
||||
{
|
||||
|
||||
public function getAdv()
|
||||
{
|
||||
$data = $this->request->params([
|
||||
[ 'adv_key', '' ]
|
||||
]);
|
||||
return success(( new AdvService() )->getInfo($data[ 'adv_key' ]));
|
||||
}
|
||||
|
||||
}
|
||||
29
niucloud/app/api/controller/web/FriendlyLink.php
Normal file
29
niucloud/app/api/controller/web/FriendlyLink.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-mall 企业快速开发的多应用管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\api\controller\web;
|
||||
|
||||
use app\service\api\web\FriendlyLinkService;
|
||||
use core\base\BaseApiController;
|
||||
use think\Response;
|
||||
|
||||
class FriendlyLink extends BaseApiController
|
||||
{
|
||||
/**
|
||||
* 友情链接
|
||||
* @return Response
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
return success(( new FriendlyLinkService() )->getList());
|
||||
}
|
||||
|
||||
}
|
||||
29
niucloud/app/api/controller/web/Nav.php
Normal file
29
niucloud/app/api/controller/web/Nav.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-mall 企业快速开发的多应用管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\api\controller\web;
|
||||
|
||||
use app\service\api\web\NavService;
|
||||
use core\base\BaseApiController;
|
||||
use think\Response;
|
||||
|
||||
class Nav extends BaseApiController
|
||||
{
|
||||
/**
|
||||
* 导航列表
|
||||
* @return Response
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
return success(( new NavService() )->getList());
|
||||
}
|
||||
|
||||
}
|
||||
@ -11,6 +11,7 @@
|
||||
|
||||
namespace app\api\controller\wechat;
|
||||
|
||||
use app\service\api\wechat\WechatConfigService;
|
||||
use app\service\api\wechat\WechatAuthService;
|
||||
use core\base\BaseController;
|
||||
use think\db\exception\DataNotFoundException;
|
||||
@ -135,6 +136,15 @@ class Wechat extends BaseController
|
||||
return success($wechat_auth_service->scanLogin());
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查微信公众号是否配置
|
||||
* @return Response
|
||||
*/
|
||||
public function checkWechatConfig()
|
||||
{
|
||||
return success('SUCCESS', (new WechatConfigService())->checkWechatConfig());
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新openid
|
||||
* @return Response
|
||||
|
||||
@ -37,7 +37,8 @@ class ApiCheckToken
|
||||
public function handle(Request $request, Closure $next, bool $is_throw_exception = false)
|
||||
{
|
||||
$request->appType(AppTypeDict::API);
|
||||
|
||||
// 校验渠道
|
||||
( new AuthService() )->checkChannel($request);
|
||||
//通过配置来设置系统header参数
|
||||
try {
|
||||
$token = $request->apiToken();
|
||||
@ -47,8 +48,6 @@ class ApiCheckToken
|
||||
}
|
||||
//校验会员和站点
|
||||
( new AuthService() )->checkMember($request);
|
||||
// 校验渠道
|
||||
( new AuthService() )->checkChannel($request);
|
||||
} catch (AuthException $e) {
|
||||
//是否将登录错误抛出
|
||||
if ($is_throw_exception)
|
||||
|
||||
@ -46,6 +46,8 @@ Route::group(function() {
|
||||
Route::get('wechat/user', 'wechat.Wechat/getWechatUser');
|
||||
//公众号通过授权信息登录
|
||||
Route::post('wechat/userlogin', 'wechat.Wechat/wechatLogin');
|
||||
//检查微信公众号是否配置
|
||||
Route::get('wechat/check', 'wechat.Wechat/checkWechatConfig');
|
||||
|
||||
//公众号通过code登录
|
||||
Route::post('wechat/login', 'wechat.Wechat/login');
|
||||
@ -132,7 +134,7 @@ Route::group(function() {
|
||||
//核销详情
|
||||
Route::get('verify_detail/:code', 'sys.Verify/detail');
|
||||
//通过code码获取核销信息
|
||||
Route::get('get_verify_by_code/:code', 'sys.Verify/getInfoByCode');
|
||||
Route::get('get_verify_by_code', 'sys.Verify/getInfoByCode');
|
||||
//核销操作
|
||||
Route::post('verify/:code', 'sys.Verify/verify');
|
||||
|
||||
|
||||
36
niucloud/app/api/route/web.php
Normal file
36
niucloud/app/api/route/web.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-mall 企业快速开发的多应用管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
use app\api\middleware\ApiChannel;
|
||||
use app\api\middleware\ApiCheckToken;
|
||||
use app\api\middleware\ApiLog;
|
||||
use think\facade\Route;
|
||||
|
||||
|
||||
/**
|
||||
* 商城系统
|
||||
*/
|
||||
Route::group('web', function() {
|
||||
|
||||
/***************************************************** 菜单信息相关接口 ****************************************************/
|
||||
|
||||
// 导航列表
|
||||
Route::get('nav', 'web.Nav/lists');
|
||||
|
||||
// 友情链接
|
||||
Route::get('friendly_link', 'web.FriendlyLink/lists');
|
||||
|
||||
// 广告位
|
||||
Route::get('adv', 'web.Adv/getAdv');
|
||||
|
||||
})->middleware(ApiChannel::class)
|
||||
->middleware(ApiCheckToken::class)//false表示不验证登录
|
||||
->middleware(ApiLog::class);
|
||||
@ -95,6 +95,7 @@ class ComponentDict
|
||||
'sort' => 10002,
|
||||
'value' => [
|
||||
"imageHeight" => 180,
|
||||
"isSameScreen"=> false,
|
||||
"list" => [
|
||||
[
|
||||
"link" => [
|
||||
@ -485,8 +486,8 @@ class ComponentDict
|
||||
"topRounded" => 12, // 组件上圆角
|
||||
"bottomRounded" => 12, // 组件下圆角
|
||||
"elementBgColor" => '#FFFAF5', // 元素背景颜色
|
||||
"topElementRounded" => 0,// 元素上圆角
|
||||
"bottomElementRounded" => 0, // 元素下圆角
|
||||
"topElementRounded" => 10,// 元素上圆角
|
||||
"bottomElementRounded" => 10, // 元素下圆角
|
||||
"margin" => [
|
||||
"top" => 10, // 上边距
|
||||
"bottom" => 10, // 下边距
|
||||
|
||||
@ -288,7 +288,211 @@ return [
|
||||
'sort' => '0',
|
||||
'status' => '1',
|
||||
'is_show' => '0',
|
||||
]
|
||||
],
|
||||
[
|
||||
'menu_name' => '电脑端',
|
||||
'menu_key' => 'diy_web',
|
||||
'menu_short_name' => '电脑端',
|
||||
'menu_type' => '0',
|
||||
'icon' => 'iconfont icondesktop',
|
||||
'api_url' => '',
|
||||
'router_path' => 'web',
|
||||
'view_path' => '',
|
||||
'methods' => '',
|
||||
'sort' => '93',
|
||||
'status' => '1',
|
||||
'is_show' => '1',
|
||||
'children' =>[
|
||||
[
|
||||
'menu_name' => '首页导航',
|
||||
'menu_key' => 'diy_web_nav',
|
||||
'menu_short_name' => '首页导航',
|
||||
'menu_type' => '1',
|
||||
'icon' => 'iconfont-iconshouye1',
|
||||
'api_url' => '',
|
||||
'router_path' => 'web/nav',
|
||||
'view_path' => 'web/nav',
|
||||
'methods' => '',
|
||||
'sort' => '100',
|
||||
'status' => '1',
|
||||
'is_show' => '1',
|
||||
'children' => [
|
||||
[
|
||||
'menu_name' => '首页导航添加',
|
||||
'menu_key' => 'diy_web_nav_add',
|
||||
'menu_short_name' => '首页导航添加',
|
||||
'menu_type' => '2',
|
||||
'icon' => '',
|
||||
'api_url' => 'web/nav',
|
||||
'router_path' => '',
|
||||
'view_path' => '',
|
||||
'methods' => 'post',
|
||||
'sort' => '1',
|
||||
'status' => '1',
|
||||
'is_show' => '1',
|
||||
],
|
||||
[
|
||||
'menu_name' => '首页导航编辑',
|
||||
'menu_key' => 'diy_web_nav_edit',
|
||||
'menu_short_name' => '首页导航编辑',
|
||||
'menu_type' => '2',
|
||||
'icon' => '',
|
||||
'api_url' => 'web/nav/<id>',
|
||||
'router_path' => '',
|
||||
'view_path' => '',
|
||||
'methods' => 'put',
|
||||
'sort' => '1',
|
||||
'status' => '1',
|
||||
'is_show' => '1',
|
||||
],
|
||||
[
|
||||
'menu_name' => '首页导航删除',
|
||||
'menu_key' => 'diy_web_nav_delete',
|
||||
'menu_short_name' => '首页导航删除',
|
||||
'menu_type' => '2',
|
||||
'icon' => '',
|
||||
'api_url' => 'web/nav/<id>',
|
||||
'router_path' => '',
|
||||
'view_path' => '',
|
||||
'methods' => 'delete',
|
||||
'sort' => '1',
|
||||
'status' => '1',
|
||||
'is_show' => '1',
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
'menu_name' => '广告位',
|
||||
'menu_key' => 'web_adv_position',
|
||||
'menu_short_name' => '广告位',
|
||||
'menu_type' => '1',
|
||||
'icon' => 'iconfont-icontupianguanggao1',
|
||||
'api_url' => '',
|
||||
'router_path' => 'web/adv_position',
|
||||
'view_path' => 'web/adv_position',
|
||||
'methods' => 'get',
|
||||
'sort' => '99',
|
||||
'status' => '1',
|
||||
'is_show' => '1',
|
||||
],
|
||||
[
|
||||
'menu_name' => '广告管理',
|
||||
'menu_key' => 'web_adv',
|
||||
'menu_short_name' => '广告',
|
||||
'menu_type' => '1',
|
||||
'icon' => 'element-House',
|
||||
'api_url' => '',
|
||||
'router_path' => 'web/adv',
|
||||
'view_path' => 'web/adv',
|
||||
'methods' => '',
|
||||
'sort' => '0',
|
||||
'status' => '1',
|
||||
'is_show' => '0',
|
||||
'children' => [
|
||||
[
|
||||
'menu_name' => '广告添加',
|
||||
'menu_key' => 'web_adv_add',
|
||||
'menu_short_name' => '广告添加',
|
||||
'menu_type' => '2',
|
||||
'icon' => '',
|
||||
'api_url' => 'web/adv',
|
||||
'router_path' => '',
|
||||
'view_path' => '',
|
||||
'methods' => 'post',
|
||||
'sort' => '1',
|
||||
'status' => '1',
|
||||
'is_show' => '1',
|
||||
],
|
||||
[
|
||||
'menu_name' => '广告编辑',
|
||||
'menu_key' => 'web_adv_edit',
|
||||
'menu_short_name' => '广告编辑',
|
||||
'menu_type' => '2',
|
||||
'icon' => '',
|
||||
'api_url' => 'web/adv/<id>',
|
||||
'router_path' => '',
|
||||
'view_path' => '',
|
||||
'methods' => 'put',
|
||||
'sort' => '1',
|
||||
'status' => '1',
|
||||
'is_show' => '1',
|
||||
],
|
||||
[
|
||||
'menu_name' => '广告删除',
|
||||
'menu_key' => 'web_adv_delete',
|
||||
'menu_short_name' => '广告删除',
|
||||
'menu_type' => '2',
|
||||
'icon' => '',
|
||||
'api_url' => 'web/adv/<id>',
|
||||
'router_path' => '',
|
||||
'view_path' => '',
|
||||
'methods' => 'delete',
|
||||
'sort' => '1',
|
||||
'status' => '1',
|
||||
'is_show' => '1',
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
'menu_name' => '友情链接',
|
||||
'menu_key' => 'diy_web_friendly_link',
|
||||
'menu_short_name' => '友情链接',
|
||||
'menu_type' => '1',
|
||||
'icon' => 'iconfont-iconyouqinglianjie1',
|
||||
'api_url' => '',
|
||||
'router_path' => 'web/friendly_link',
|
||||
'view_path' => 'web/friendly_link',
|
||||
'methods' => '',
|
||||
'sort' => '98',
|
||||
'status' => '1',
|
||||
'is_show' => '1',
|
||||
'children' => [
|
||||
[
|
||||
'menu_name' => '友情链接添加',
|
||||
'menu_key' => 'diy_web_friendly_link_add',
|
||||
'menu_short_name' => '友情链接添加',
|
||||
'menu_type' => '2',
|
||||
'icon' => '',
|
||||
'api_url' => 'web/friendly_link',
|
||||
'router_path' => '',
|
||||
'view_path' => '',
|
||||
'methods' => 'post',
|
||||
'sort' => '1',
|
||||
'status' => '1',
|
||||
'is_show' => '1',
|
||||
],
|
||||
[
|
||||
'menu_name' => '友情链接编辑',
|
||||
'menu_key' => 'diy_web_friendly_link_edit',
|
||||
'menu_short_name' => '友情链接编辑',
|
||||
'menu_type' => '2',
|
||||
'icon' => '',
|
||||
'api_url' => 'web/friendly_link/<id>',
|
||||
'router_path' => '',
|
||||
'view_path' => '',
|
||||
'methods' => 'put',
|
||||
'sort' => '1',
|
||||
'status' => '1',
|
||||
'is_show' => '1',
|
||||
],
|
||||
[
|
||||
'menu_name' => '友情链接删除',
|
||||
'menu_key' => 'diy_web_friendly_link_delete',
|
||||
'menu_short_name' => '友情链接删除',
|
||||
'menu_type' => '2',
|
||||
'icon' => '',
|
||||
'api_url' => 'web/friendly_link/<id>',
|
||||
'router_path' => '',
|
||||
'view_path' => '',
|
||||
'methods' => 'delete',
|
||||
'sort' => '1',
|
||||
'status' => '1',
|
||||
'is_show' => '1',
|
||||
]
|
||||
]
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
|
||||
38
niucloud/app/dict/web/AdvPositionDict.php
Normal file
38
niucloud/app/dict/web/AdvPositionDict.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的多应用管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\dict\web;
|
||||
|
||||
use core\dict\DictLoader;
|
||||
|
||||
/**
|
||||
* 系统广告位
|
||||
* Class AdvPositionDict
|
||||
* @package app\dict\web
|
||||
*/
|
||||
class AdvPositionDict
|
||||
{
|
||||
|
||||
public static function getAdvPosition()
|
||||
{
|
||||
$system_adv_position = [
|
||||
// [
|
||||
// 'keywords' => '', //关键字不能重复
|
||||
// 'ap_name' => '', //广告位名称
|
||||
// 'ap_desc' => '', //广告位简介
|
||||
// 'default_content' => [], //默认数据
|
||||
// 'ap_bg_color' => '', //背景色,默认白色
|
||||
// ]
|
||||
];
|
||||
return ( new DictLoader("AdvPosition") )->load($system_adv_position);
|
||||
}
|
||||
|
||||
}
|
||||
132
niucloud/app/dict/web/WebLinkDict.php
Normal file
132
niucloud/app/dict/web/WebLinkDict.php
Normal file
@ -0,0 +1,132 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的多应用管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\dict\web;
|
||||
|
||||
use core\dict\DictLoader;
|
||||
|
||||
/**
|
||||
* 电脑端页面链接
|
||||
* Class WebLinkDict
|
||||
* @package app\dict\diy
|
||||
*/
|
||||
class WebLinkDict
|
||||
{
|
||||
/**
|
||||
* 查询存在页面路由的应用插件列表 query 格式:'query' => 'addon'
|
||||
* 查询插件的链接列表,包括系统的链接 addon 格式:'addon' => 'shop'
|
||||
* @param array $params
|
||||
* @return array|null
|
||||
*/
|
||||
public static function getLink($params = [])
|
||||
{
|
||||
$system_links = [
|
||||
'SYSTEM_LINK' => [
|
||||
'title' => get_lang('dict_diy.system_link'),
|
||||
'addon_info' => [
|
||||
'title' => '系统',
|
||||
'key' => 'app'
|
||||
],
|
||||
'child_list' => [
|
||||
[
|
||||
'name' => 'INDEX',
|
||||
'title' => get_lang('dict_diy.system_web_index'),
|
||||
'url' => '/app/index',
|
||||
'is_share' => 1,
|
||||
'action' => '' // 默认空,decorate 表示支持装修
|
||||
],
|
||||
]
|
||||
],
|
||||
'MEMBER_LINK' => [
|
||||
'title' => get_lang('dict_diy.member_link'),
|
||||
'addon_info' => [
|
||||
'title' => '系统',
|
||||
'key' => 'app'
|
||||
],
|
||||
'child_list' => [
|
||||
[
|
||||
'name' => 'AUTH_LOGIN',
|
||||
'title' => get_lang('dict_diy.auth_login'),
|
||||
'url' => '/auth/login',
|
||||
'is_share' => 1,
|
||||
'action' => ''
|
||||
],
|
||||
[
|
||||
'name' => 'AUTH_REGISTER',
|
||||
'title' => get_lang('dict_diy.auth_register'),
|
||||
'url' => '/auth/register',
|
||||
'is_share' => 1,
|
||||
'action' => ''
|
||||
],
|
||||
[
|
||||
'name' => 'AUTH_BIND',
|
||||
'title' => get_lang('dict_diy.auth_bind'),
|
||||
'url' => '/auth/bind',
|
||||
'is_share' => 1,
|
||||
'action' => ''
|
||||
],
|
||||
[
|
||||
'name' => 'MEMBER_CENTER',
|
||||
'title' => get_lang('dict_diy.member_my_personal'),
|
||||
'url' => '/member/center',
|
||||
'is_share' => 1,
|
||||
'action' => ''
|
||||
],
|
||||
[
|
||||
'name' => 'MEMBER_BALANCE',
|
||||
'title' => get_lang('dict_diy.member_my_balance'),
|
||||
'url' => '/member/balance',
|
||||
'is_share' => 1,
|
||||
'action' => ''
|
||||
],
|
||||
[
|
||||
'name' => 'MEMBER_POINT',
|
||||
'title' => get_lang('dict_diy.member_my_point'),
|
||||
'url' => '/member/point',
|
||||
'is_share' => 1,
|
||||
'action' => ''
|
||||
],
|
||||
[
|
||||
'name' => 'MEMBER_ADDRESS',
|
||||
'title' => get_lang('dict_diy.member_my_address'),
|
||||
'url' => '/member/address_list',
|
||||
'is_share' => 1,
|
||||
'action' => ''
|
||||
]
|
||||
]
|
||||
],
|
||||
'DIY_LINK' => [
|
||||
'title' => get_lang('dict_diy.diy_link'),
|
||||
'addon_info' => [
|
||||
'title' => '系统',
|
||||
'key' => 'app'
|
||||
],
|
||||
'child_list' => []
|
||||
]
|
||||
];
|
||||
|
||||
// 查询存在页面路由的应用插件列表
|
||||
if (!empty($params[ 'query' ]) && $params[ 'query' ] == 'addon') {
|
||||
$system = [
|
||||
'app' => [
|
||||
'title' => '系统',
|
||||
'key' => 'app'
|
||||
]
|
||||
];
|
||||
$addons = (new DictLoader("WebLink"))->load([ 'data' => $system, 'params' => $params ]);
|
||||
$app = array_merge($system, $addons);
|
||||
return $app;
|
||||
} else {
|
||||
return (new DictLoader("WebLink"))->load([ 'data' => $system_links, 'params' => $params ]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -75,6 +75,19 @@ CREATE TABLE `applet_version` (
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '小程序版本表' ROW_FORMAT = Dynamic;
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `web_adv`;
|
||||
CREATE TABLE `web_adv` (
|
||||
`adv_id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`adv_key` VARCHAR(50) NOT NULL DEFAULT '0' COMMENT '广告位key',
|
||||
`adv_title` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '广告内容描述',
|
||||
`adv_url` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '广告链接',
|
||||
`adv_image` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '广告内容图片',
|
||||
`sort` INT(11) NOT NULL DEFAULT 0 COMMENT '排序号',
|
||||
`background` VARCHAR(255) NOT NULL DEFAULT '#FFFFFF' COMMENT '背景色',
|
||||
PRIMARY KEY (`adv_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='广告表';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `diy_page`;
|
||||
CREATE TABLE `diy_page` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
@ -878,6 +891,32 @@ CREATE TABLE `weapp_version` (
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '小程序版本' ROW_FORMAT = Dynamic;
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `web_friendly_link`;
|
||||
CREATE TABLE `web_friendly_link` (
|
||||
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '索引id',
|
||||
`link_title` VARCHAR(100) NOT NULL COMMENT '标题',
|
||||
`link_url` VARCHAR(100) NOT NULL COMMENT '链接',
|
||||
`link_pic` VARCHAR(100) NOT NULL COMMENT '图片',
|
||||
`sort` INT(11) NOT NULL DEFAULT 0 COMMENT '排序号',
|
||||
`is_show` INT(11) NOT NULL DEFAULT 1 COMMENT '是否显示 1.是 2.否',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='电脑端友情链接表';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `web_nav`;
|
||||
CREATE TABLE `web_nav` (
|
||||
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`nav_title` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '导航名称',
|
||||
`nav_url` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '链接地址',
|
||||
`sort` INT(11) NOT NULL COMMENT '排序号',
|
||||
`is_blank` INT(11) DEFAULT 0 COMMENT '是否新打开',
|
||||
`create_time` INT(11) DEFAULT 0 COMMENT '创建时间',
|
||||
`update_time` INT(11) DEFAULT 0 COMMENT '修改时间',
|
||||
`is_show` SMALLINT(6) NOT NULL DEFAULT 1 COMMENT '是否显示 1显示 0不显示',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='PC导航管理';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `wechat_fans`;
|
||||
CREATE TABLE `wechat_fans` (
|
||||
`fans_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '粉丝ID',
|
||||
|
||||
@ -25,7 +25,6 @@
|
||||
}
|
||||
.pop-link-wrap .link-text:nth-child(2){
|
||||
margin-top: 10px;
|
||||
|
||||
}
|
||||
.pop-link-wrap .link-text:nth-child(2) a{
|
||||
color: var(--base-color);
|
||||
@ -46,7 +45,7 @@
|
||||
<div class="install-success">
|
||||
<div class="install-success-box">
|
||||
<div class="success-img">
|
||||
<img class="install-success-pic" src="INSTALL_IMG/success_img.jpg" alt="">
|
||||
<img class="install-success-pic" src="INSTALL_IMG/success_img.png" alt="">
|
||||
</div>
|
||||
<div class="install-success-text">
|
||||
{if $is_build == 1}
|
||||
|
||||
@ -131,6 +131,8 @@ return [
|
||||
'NOTICE_SMS_NOT_OPEN' => '短信未启用',
|
||||
'NOTICE_TEMPLATE_IS_NOT_EXIST' => '消息不存在',
|
||||
|
||||
'WEB_ADV_POSITION_NOT_EXIST' => '广告位不存在',
|
||||
|
||||
//会员相关
|
||||
'MOBILE_IS_EXIST' => '当前手机号已绑定账号',
|
||||
'ACCOUNT_INSUFFICIENT' => '账户余额不足',
|
||||
@ -238,6 +240,8 @@ return [
|
||||
'REFUND_HAD_APPLIED' => '订单已申请退款',
|
||||
'ORDER_UNPAID_NOT_ALLOW_APPLY_REFUND' => '订单尚未支付不能进行退款',
|
||||
|
||||
//会员套餐
|
||||
'RECHARGE_NOT_EXIST' => '充值套餐不存在',
|
||||
|
||||
// 缓存相关
|
||||
'CLEAR_MYSQL_CACHE_SUCCESS' => '数据表缓存清除成功',
|
||||
|
||||
@ -227,6 +227,11 @@ return [
|
||||
'member_verify_index' => '核销台',
|
||||
'member_contact' => '客服',
|
||||
|
||||
'system_web_index' => '系统首页',
|
||||
'auth_login' => '登录',
|
||||
'auth_register' => '注册',
|
||||
'auth_bind' => '手机号绑定',
|
||||
|
||||
'diy_page' => '自定义页面',
|
||||
'diy_link' => '自定义链接',
|
||||
'diy_jump_other_applet' => '小程序跳转',
|
||||
|
||||
70
niucloud/app/model/web/Adv.php
Normal file
70
niucloud/app/model/web/Adv.php
Normal file
@ -0,0 +1,70 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的saas管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\model\web;
|
||||
|
||||
|
||||
use app\dict\web\AdvPositionDict;
|
||||
use core\base\BaseModel;
|
||||
|
||||
/**
|
||||
* 广告管理
|
||||
* Class Adv
|
||||
* @package app\model\web
|
||||
*/
|
||||
class Adv extends BaseModel
|
||||
{
|
||||
|
||||
/**
|
||||
* 数据表主键
|
||||
* @var string
|
||||
*/
|
||||
protected $pk = 'adv_id';
|
||||
|
||||
/**
|
||||
* 模型名称
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'web_adv';
|
||||
|
||||
// 设置json类型字段
|
||||
protected $json = [ 'adv_url' ];
|
||||
// 设置JSON数据返回数组
|
||||
protected $jsonAssoc = true;
|
||||
|
||||
/**
|
||||
* 搜索器:广告位key
|
||||
* @param $value
|
||||
* @param $data
|
||||
*/
|
||||
public function searchAdvKeyAttr($query, $value, $data)
|
||||
{
|
||||
if ($value) {
|
||||
$query->where("adv_key", "=", $value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取广告位名称
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @return mixed|string
|
||||
*/
|
||||
public function getApNameAttr($value, $data)
|
||||
{
|
||||
if (empty($data[ 'adv_key' ]))
|
||||
return '';
|
||||
$adv_position = AdvPositionDict::getAdvPosition();
|
||||
$position_list = array_column($adv_position, null, 'keywords');
|
||||
return $position_list[ $data[ 'adv_key' ] ][ 'ap_name' ] ?? '';
|
||||
}
|
||||
|
||||
}
|
||||
51
niucloud/app/model/web/FriendlyLink.php
Normal file
51
niucloud/app/model/web/FriendlyLink.php
Normal file
@ -0,0 +1,51 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的多应用管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\model\web;
|
||||
|
||||
use core\base\BaseModel;
|
||||
|
||||
/**
|
||||
* 友情链接模型
|
||||
* Class FriendlyLink
|
||||
* @package app\model\web
|
||||
*/
|
||||
class FriendlyLink extends BaseModel
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* 数据表主键
|
||||
* @var string
|
||||
*/
|
||||
protected $pk = 'id';
|
||||
|
||||
/**
|
||||
* 模型名称
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'web_friendly_link';
|
||||
|
||||
|
||||
/**
|
||||
* 搜索器:友情链接标题
|
||||
* @param $value
|
||||
* @param $data
|
||||
*/
|
||||
public function searchLinkTitleAttr($query, $value, $data)
|
||||
{
|
||||
if ($value) {
|
||||
$query->where("link_title", 'like', '%' . $value . '%');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
55
niucloud/app/model/web/Nav.php
Normal file
55
niucloud/app/model/web/Nav.php
Normal file
@ -0,0 +1,55 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的saas管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\model\web;
|
||||
|
||||
|
||||
use core\base\BaseModel;
|
||||
|
||||
/**
|
||||
* 首页导航(电脑端)
|
||||
* Class Nav
|
||||
* @package app\model\web
|
||||
*/
|
||||
class Nav extends BaseModel
|
||||
{
|
||||
|
||||
/**
|
||||
* 数据表主键
|
||||
* @var string
|
||||
*/
|
||||
protected $pk = 'id';
|
||||
|
||||
/**
|
||||
* 模型名称
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'web_nav';
|
||||
|
||||
// 设置json类型字段
|
||||
protected $json = ['nav_url'];
|
||||
// 设置JSON数据返回数组
|
||||
protected $jsonAssoc = true;
|
||||
|
||||
/**
|
||||
* 关键字搜索
|
||||
* @param $query
|
||||
* @param $value
|
||||
* @param $data
|
||||
*/
|
||||
public function searchNavTitleAttr($query, $value, $data)
|
||||
{
|
||||
if ($value) {
|
||||
$query->where('nav_title', 'like', '%' . $value . '%');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -87,7 +87,7 @@ class BackupService extends UpgradeService
|
||||
$prefix = config('database.connections.' . config('database.default'))[ 'prefix' ];
|
||||
if ($this->upgrade_task[ 'upgrade' ][ 'app_key' ] == AddonDict::FRAMEWORK_KEY) {
|
||||
// 不需要备份的表
|
||||
$noot_need_backup = [ "{$prefix}sys_user_log", "{$prefix}jobs", "{$prefix}jobs_failed" ];
|
||||
$noot_need_backup = [ "{$prefix}sys_schedule_log", "{$prefix}sys_user_log", "{$prefix}jobs", "{$prefix}jobs_failed" ];
|
||||
$sys_models = ( new GenerateService() )->getModels([ 'addon' => 'system' ]);
|
||||
foreach ($sys_models as $model) {
|
||||
$name = "\\$model";
|
||||
@ -101,9 +101,14 @@ class BackupService extends UpgradeService
|
||||
$addon_models = ( new GenerateService() )->getModels([ 'addon' => $this->upgrade_task[ 'upgrade' ][ 'app_key' ] ]);
|
||||
foreach ($addon_models as $model) {
|
||||
try {
|
||||
// 不需要备份的表
|
||||
$noot_need_backup = [ "{$prefix}shop_stat", "{$prefix}shop_goods_stat", "{$prefix}shop_goods_browse" ];
|
||||
$name = "\\$model";
|
||||
$class = new $name();
|
||||
$tables[] = $class->getTable();
|
||||
|
||||
if (!in_array($class->getTable(), $noot_need_backup)) {
|
||||
$tables[] = $class->getTable();
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
}
|
||||
}
|
||||
|
||||
121
niucloud/app/service/admin/web/AdvService.php
Normal file
121
niucloud/app/service/admin/web/AdvService.php
Normal file
@ -0,0 +1,121 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的多应用管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\service\admin\web;
|
||||
|
||||
use app\dict\web\AdvPositionDict;
|
||||
use app\model\web\Adv;
|
||||
use core\base\BaseAdminService;
|
||||
use core\exception\AdminException;
|
||||
|
||||
|
||||
/**
|
||||
* 广告服务层
|
||||
*/
|
||||
class AdvService extends BaseAdminService
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->model = new Adv();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取广告列表
|
||||
* @param array $where
|
||||
* @return array
|
||||
*/
|
||||
public function getPage(array $where = [])
|
||||
{
|
||||
$field = 'adv_id, adv_key, adv_title, adv_url, adv_image, sort, background';
|
||||
$order = 'adv_id desc';
|
||||
|
||||
$search_model = $this->model->withSearch([ 'adv_key' ], $where)->field($field)->append([ 'ap_name' ])->order($order);
|
||||
$list = $this->pageQuery($search_model);
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取广告列表
|
||||
* @param array $where
|
||||
* @param string $field
|
||||
* @return array
|
||||
*/
|
||||
public function getList(array $where = [], $field = 'adv_id, adv_key, adv_title, adv_url, adv_image, sort, background')
|
||||
{
|
||||
$order = 'adv_id desc';
|
||||
return $this->model->withSearch([ 'adv_key' ], $where)->field($field)->append([ "ap_name" ])->order($order)->select()->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取广告信息
|
||||
* @param int $id
|
||||
* @return array
|
||||
*/
|
||||
public function getInfo(int $id)
|
||||
{
|
||||
$field = 'adv_id, adv_key, adv_title, adv_url, adv_image, sort, background';
|
||||
$info = $this->model->field($field)->where([ [ 'adv_id', '=', $id ] ])->append([ "ap_name" ])->findOrEmpty()->toArray();
|
||||
return $info;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加广告
|
||||
* @param array $data
|
||||
* @return mixed
|
||||
*/
|
||||
public function add(array $data)
|
||||
{
|
||||
$adv_position = AdvPositionDict::getAdvPosition();
|
||||
$position_list = array_column($adv_position, null, 'keywords');
|
||||
if (!array_key_exists($data[ 'adv_key' ], $position_list)) throw new AdminException("WEB_ADV_POSITION_NOT_EXIST");
|
||||
$res = $this->model->create($data);
|
||||
return $res->adv_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 广告编辑
|
||||
* @param int $id
|
||||
* @param array $data
|
||||
* @return bool
|
||||
*/
|
||||
public function edit(int $id, array $data)
|
||||
{
|
||||
$adv_position = AdvPositionDict::getAdvPosition();
|
||||
$position_list = array_column($adv_position, null, 'keywords');
|
||||
if (!array_key_exists($data[ 'adv_key' ], $position_list)) throw new AdminException("WEB_ADV_POSITION_NOT_EXIST");
|
||||
$this->model->where([ [ 'adv_id', '=', $id ] ])->update($data);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除广告
|
||||
* @param int $id
|
||||
* @return bool
|
||||
*/
|
||||
public function del(int $id)
|
||||
{
|
||||
$model = $this->model->where([ [ 'adv_id', '=', $id ] ])->find();
|
||||
$res = $model->delete();
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改广告位排序号
|
||||
* @param array $data
|
||||
* @return Adv|bool
|
||||
*/
|
||||
public function editSort($data)
|
||||
{
|
||||
return $this->model->where([ [ 'adv_id', '=', $data[ 'id' ] ] ])->update([ 'sort' => $data[ 'sort' ] ]);
|
||||
}
|
||||
|
||||
}
|
||||
106
niucloud/app/service/admin/web/FriendlyLinkService.php
Normal file
106
niucloud/app/service/admin/web/FriendlyLinkService.php
Normal file
@ -0,0 +1,106 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的多应用管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\service\admin\web;
|
||||
|
||||
use app\model\web\FriendlyLink;
|
||||
use core\base\BaseAdminService;
|
||||
|
||||
|
||||
/**
|
||||
* 友情链接服务层
|
||||
* Class FriendlyLinkService
|
||||
* @package app\service\admin\web
|
||||
*/
|
||||
class FriendlyLinkService extends BaseAdminService
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->model = new FriendlyLink();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取友情链接列表
|
||||
* @param array $where
|
||||
* @return array
|
||||
*/
|
||||
public function getPage(array $where = [])
|
||||
{
|
||||
$field = 'id,link_pic,link_title,link_url,sort,is_show';
|
||||
$order = 'id desc';
|
||||
|
||||
$search_model = $this->model->withSearch([ 'link_title' ], $where)->field($field)->order($order);
|
||||
$list = $this->pageQuery($search_model);
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取友情链接信息
|
||||
* @param int $id
|
||||
* @return array
|
||||
*/
|
||||
public function getInfo(int $id)
|
||||
{
|
||||
$field = 'id,link_pic,link_title,link_url,sort,is_show';
|
||||
|
||||
$info = $this->model->field($field)->where([ [ 'id', "=", $id ] ])->findOrEmpty()->toArray();
|
||||
return $info;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加友情链接
|
||||
* @param array $data
|
||||
* @return mixed
|
||||
*/
|
||||
public function add(array $data)
|
||||
{
|
||||
$res = $this->model->create($data);
|
||||
return $res->id;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 友情链接编辑
|
||||
* @param int $id
|
||||
* @param array $data
|
||||
* @return bool
|
||||
*/
|
||||
public function edit(int $id, array $data)
|
||||
{
|
||||
|
||||
$this->model->where([ [ 'id', '=', $id ] ])->update($data);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除友情链接
|
||||
* @param int $id
|
||||
* @return bool
|
||||
*/
|
||||
public function del(int $id)
|
||||
{
|
||||
$model = $this->model->where([ [ 'id', '=', $id ] ])->find();
|
||||
$res = $model->delete();
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改友情链接排序号
|
||||
* @param array $data
|
||||
* @return FriendlyLink|bool
|
||||
*/
|
||||
public function editSort($data)
|
||||
{
|
||||
return $this->model->where([ [ 'id', '=', $data[ 'id' ] ] ])->update([ 'sort' => $data[ 'sort' ] ]);
|
||||
}
|
||||
|
||||
}
|
||||
118
niucloud/app/service/admin/web/NavService.php
Normal file
118
niucloud/app/service/admin/web/NavService.php
Normal file
@ -0,0 +1,118 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的多应用管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\service\admin\web;
|
||||
|
||||
use app\model\web\Nav;
|
||||
use core\base\BaseAdminService;
|
||||
|
||||
|
||||
/**
|
||||
* 首页导航服务层
|
||||
* Class WebService
|
||||
* @package app\service\admin\web
|
||||
*/
|
||||
class NavService extends BaseAdminService
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->model = new Nav();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取首页导航列表
|
||||
* @param array $where
|
||||
* @return array
|
||||
*/
|
||||
public function getPage(array $where = [])
|
||||
{
|
||||
$field = 'id, nav_title, nav_url, sort, is_blank, create_time, update_time, is_show';
|
||||
$order = 'create_time desc';
|
||||
|
||||
$search_model = $this->model->withSearch([ "nav_title" ], $where)->field($field)->order($order);
|
||||
$list = $this->pageQuery($search_model);
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取首页导航列表
|
||||
* @param array $where
|
||||
* @param string $field
|
||||
* @return array
|
||||
*/
|
||||
public function getList(array $where = [], $field = 'id, nav_title, nav_url, sort, is_blank, create_time, update_time, is_show')
|
||||
{
|
||||
$order = "create_time desc";
|
||||
return $this->model->withSearch([ "nav_title" ], $where)->field($field)->select()->order($order)->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取首页导航信息
|
||||
* @param int $id
|
||||
* @return array
|
||||
*/
|
||||
public function getInfo(int $id)
|
||||
{
|
||||
$field = 'id, nav_title, nav_url, sort, is_blank, create_time, update_time, is_show';
|
||||
$info = $this->model->field($field)->where([ [ 'id', '=', $id ] ])->findOrEmpty()->toArray();
|
||||
return $info;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加首页导航
|
||||
* @param array $data
|
||||
* @return mixed
|
||||
*/
|
||||
public function add(array $data)
|
||||
{
|
||||
$data[ 'create_time' ] = time();
|
||||
$res = $this->model->create($data);
|
||||
return $res->id;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 首页导航编辑
|
||||
* @param int $id
|
||||
* @param array $data
|
||||
* @return bool
|
||||
*/
|
||||
public function edit(int $id, array $data)
|
||||
{
|
||||
$data[ 'update_time' ] = time();
|
||||
$this->model->where([ [ 'id', '=', $id ] ])->update($data);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除首页导航
|
||||
* @param int $id
|
||||
* @return bool
|
||||
*/
|
||||
public function del(int $id)
|
||||
{
|
||||
$model = $this->model->where([ [ 'id', '=', $id ] ])->find();
|
||||
$res = $model->delete();
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改首页导航排序号
|
||||
* @param array $data
|
||||
* @return Nav|bool
|
||||
*/
|
||||
public function editSort($data)
|
||||
{
|
||||
return $this->model->where([ [ 'id', '=', $data[ 'id' ] ] ])->update([ 'sort' => $data[ 'sort' ] ]);
|
||||
}
|
||||
}
|
||||
44
niucloud/app/service/admin/web/WebService.php
Normal file
44
niucloud/app/service/admin/web/WebService.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的多应用管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\service\admin\web;
|
||||
|
||||
use app\dict\web\WebLinkDict;
|
||||
use core\base\BaseAdminService;
|
||||
|
||||
|
||||
/**
|
||||
* web端基础服务层
|
||||
* Class WebService
|
||||
* @package app\service\admin\web
|
||||
*/
|
||||
class WebService extends BaseAdminService
|
||||
{
|
||||
/**
|
||||
* 获取web端链接配置
|
||||
* @return array
|
||||
*/
|
||||
public function getLink()
|
||||
{
|
||||
|
||||
$link = WebLinkDict::getLink();
|
||||
foreach ($link as $k => $v) {
|
||||
$link[ $k ][ 'name' ] = $k;
|
||||
if (!empty($v[ 'child_list' ])) {
|
||||
foreach ($v[ 'child_list' ] as $ck => $cv) {
|
||||
$link[ $k ][ 'child_list' ][ $ck ][ 'parent' ] = $k;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return $link;
|
||||
}
|
||||
}
|
||||
@ -61,4 +61,5 @@ class WechatConfigService extends BaseAdminService
|
||||
public function getWechatStaticInfo(){
|
||||
return (new CoreWechatConfigService())->getWechatStaticInfo();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -112,7 +112,7 @@ class MemberAccountService extends BaseApiService
|
||||
$where[ 'member_id' ] = $this->member_id;
|
||||
$where[ 'create_time' ] = $data[ 'create_time' ];
|
||||
$field = 'id, member_id, account_type, account_data, account_sum, from_type, related_id, create_time, memo';
|
||||
$search_model = $this->model->where([ [ 'id', '>', 0 ] ])->where($type_where)->withSearch([ 'member_id', 'create_time' ], $where)->field($field)->order('create_time desc')->append([ 'from_type_name', 'account_type_name' ]);
|
||||
$search_model = $this->model->where([ [ 'id', '>', 0 ] ])->where($type_where)->withSearch([ 'member_id', 'create_time' ], $where)->field($field)->order('id desc')->append([ 'from_type_name', 'account_type_name' ]);
|
||||
return $this->pageQuery($search_model);
|
||||
}
|
||||
|
||||
|
||||
48
niucloud/app/service/api/web/AdvService.php
Normal file
48
niucloud/app/service/api/web/AdvService.php
Normal file
@ -0,0 +1,48 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的saas管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\service\api\web;
|
||||
|
||||
use app\dict\web\AdvPositionDict;
|
||||
use app\model\web\Adv;
|
||||
use core\base\BaseApiService;
|
||||
use core\exception\ApiException;
|
||||
|
||||
/**
|
||||
* 广告服务层
|
||||
* Class DiyService
|
||||
* @package app\service\api\diy
|
||||
*/
|
||||
class AdvService extends BaseApiService
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->model = new Adv();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取广告信息
|
||||
* @param string $adv_key
|
||||
* @return mixed
|
||||
*/
|
||||
public function getInfo(string $adv_key)
|
||||
{
|
||||
$adv_position = AdvPositionDict::getAdvPosition();
|
||||
$position_list = array_column($adv_position, null, 'keywords');
|
||||
if (!array_key_exists($adv_key, $position_list)) throw new ApiException("WEB_ADV_POSITION_NOT_EXIST");
|
||||
$info = $position_list[ $adv_key ];
|
||||
$info[ 'adv_list' ] = $this->model->where([ [ 'adv_key', '=', $adv_key ] ])->order('sort desc')->select()->toArray();
|
||||
return $info;
|
||||
}
|
||||
|
||||
}
|
||||
44
niucloud/app/service/api/web/FriendlyLinkService.php
Normal file
44
niucloud/app/service/api/web/FriendlyLinkService.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的多应用管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\service\api\web;
|
||||
|
||||
use app\model\web\FriendlyLink;
|
||||
use core\base\BaseApiService;
|
||||
|
||||
|
||||
/**
|
||||
* 友情链接服务层
|
||||
* Class FloorService
|
||||
* @package app\service\api\web
|
||||
*/
|
||||
class FriendlyLinkService extends BaseApiService
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->model = new FriendlyLink();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取友情链接
|
||||
* @param array $where
|
||||
* @return array
|
||||
*/
|
||||
public function getList()
|
||||
{
|
||||
$field = 'id,link_title,link_url,link_pic,sort';
|
||||
$order = 'sort desc';
|
||||
$list = $this->model->field($field)->where([['is_show', '=', 1]])->order($order)->select()->toArray();
|
||||
return $list;
|
||||
}
|
||||
|
||||
}
|
||||
44
niucloud/app/service/api/web/NavService.php
Normal file
44
niucloud/app/service/api/web/NavService.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的多应用管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\service\api\web;
|
||||
|
||||
use app\model\web\Nav;
|
||||
use core\base\BaseApiService;
|
||||
|
||||
|
||||
/**
|
||||
* 导航服务层
|
||||
* Class FloorService
|
||||
* @package app\service\api\web
|
||||
*/
|
||||
class NavService extends BaseApiService
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->model = new Nav();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取导航列表
|
||||
* @param array $where
|
||||
* @return array
|
||||
*/
|
||||
public function getList()
|
||||
{
|
||||
$field = 'id,nav_title,nav_url,sort,is_blank';
|
||||
$order = 'sort desc';
|
||||
$list = $this->model->field($field)->where([ [ 'is_show', '=', 1 ] ])->order($order)->select()->toArray();
|
||||
return $list;
|
||||
}
|
||||
|
||||
}
|
||||
37
niucloud/app/service/api/wechat/WechatConfigService.php
Normal file
37
niucloud/app/service/api/wechat/WechatConfigService.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的saas管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\service\api\wechat;
|
||||
|
||||
use app\service\core\wechat\CoreWechatConfigService;
|
||||
use core\base\BaseApiService;
|
||||
|
||||
/**
|
||||
* 微信配置模型
|
||||
* Class WechatConfigService
|
||||
* @package app\service\core\wechat
|
||||
*/
|
||||
class WechatConfigService extends BaseApiService
|
||||
{
|
||||
/**
|
||||
* 检查微信公众号是否配置
|
||||
* @return bool
|
||||
*/
|
||||
public function checkWechatConfig()
|
||||
{
|
||||
$config = (new CoreWechatConfigService())->getWechatConfig();
|
||||
if ( empty($config['app_id']) ) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -75,7 +75,6 @@ class CoreMemberCashOutService extends BaseCoreService
|
||||
|
||||
/**
|
||||
* 审核通过
|
||||
|
||||
* @param MemberCashOut $cash_out
|
||||
* @param array $data
|
||||
* @return true
|
||||
@ -98,7 +97,6 @@ class CoreMemberCashOutService extends BaseCoreService
|
||||
|
||||
/**
|
||||
* 拒绝
|
||||
|
||||
* @param MemberCashOut $cash_out
|
||||
* @param array $data
|
||||
* @return true
|
||||
@ -143,7 +141,15 @@ class CoreMemberCashOutService extends BaseCoreService
|
||||
$data['transfer_account'] = $cash_out['transfer_account'];
|
||||
$transfer_type = $cash_out['transfer_type'];
|
||||
if($transfer_type == TransferDict::WECHAT){
|
||||
//根据转账方式和会员的授权信息来判断可以使用的转账方式
|
||||
$member = (new CoreMemberService())->find($cash_out['member_id']);
|
||||
if(!empty($member['wx_openid'])){
|
||||
$data['openid'] = $member['wx_openid'];
|
||||
} else if(!empty($member['weapp_openid'])){
|
||||
$data['openid'] = $member['wweapp_openid'];
|
||||
}else{
|
||||
$data['openid'] = '';
|
||||
}
|
||||
$data['openid'] = $member['wx_openid'];
|
||||
}
|
||||
}else{
|
||||
@ -263,7 +269,6 @@ class CoreMemberCashOutService extends BaseCoreService
|
||||
|
||||
/**
|
||||
* 返还用户的对应账户
|
||||
|
||||
* @param MemberCashOut $cash_out
|
||||
* @return true
|
||||
*/
|
||||
|
||||
@ -171,7 +171,7 @@ class CoreMemberService extends BaseCoreService
|
||||
*/
|
||||
public static function sendGrowth(int $member_id, string $key, array $param = []) {
|
||||
$config = (new CoreMemberConfigService())->getGrowthRuleConfig();
|
||||
if (!isset($config[$key]) || empty($config[$key]) || !$config[$key]['is_use']) return true;
|
||||
if (!isset($config[$key]) || empty($config[$key]) || empty($config[$key]['is_use'])) return true;
|
||||
|
||||
$config = $config[$key];
|
||||
|
||||
@ -204,7 +204,7 @@ class CoreMemberService extends BaseCoreService
|
||||
*/
|
||||
public static function sendPoint(int $member_id, string $key, array $param = []) {
|
||||
$config = (new CoreMemberConfigService())->getPointRuleConfig()['grant'] ?? [];
|
||||
if (!isset($config[$key]) || empty($config[$key]) || !$config[$key]['is_use']) return true;
|
||||
if (!isset($config[$key]) || empty($config[$key]) || empty($config[$key]['is_use'])) return true;
|
||||
|
||||
$config = $config[$key];
|
||||
|
||||
|
||||
@ -138,7 +138,7 @@ class CoreWechatServeService extends BaseCoreService
|
||||
}
|
||||
$scene = [ $sceneKey => $key ];
|
||||
$param = [
|
||||
'expire_seconds' => $expire_seconds,
|
||||
'expire_seconds' => $expire_seconds, // 二维码的有效时间
|
||||
'action_name' => $type,
|
||||
'action_info' => [
|
||||
'scene' => $scene
|
||||
|
||||
54
niucloud/app/upgrade/v143/Upgrade.php
Normal file
54
niucloud/app/upgrade/v143/Upgrade.php
Normal file
@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace app\upgrade\v143;
|
||||
|
||||
use app\model\diy\Diy;
|
||||
|
||||
class Upgrade
|
||||
{
|
||||
|
||||
public function handle()
|
||||
{
|
||||
$this->handleDiyData();
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理自定义数据
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
private function handleDiyData()
|
||||
{
|
||||
$diy_model = new Diy();
|
||||
$where = [
|
||||
[ 'value', '<>', '' ]
|
||||
];
|
||||
$field = 'id,name,title,template,value';
|
||||
$list = $diy_model->where($where)->field($field)->select()->toArray();
|
||||
|
||||
if (!empty($list)) {
|
||||
foreach ($list as $k => $v) {
|
||||
$diy_data = json_decode($v[ 'value' ], true);
|
||||
|
||||
foreach ($diy_data[ 'value' ] as $ck => $cv) {
|
||||
|
||||
// 图片广告 组件
|
||||
if ($cv[ 'componentName' ] == 'ImageAds') {
|
||||
|
||||
if (!isset($diy_data[ 'value' ][ $ck ][ 'isSameScreen' ])) {
|
||||
$diy_data[ 'value' ][ $ck ][ 'isSameScreen' ] = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$diy_data = json_encode($diy_data);
|
||||
$diy_model->where([ [ 'id', '=', $v[ 'id' ] ] ])->update([ 'value' => $diy_data ]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
38
niucloud/app/upgrade/v143/upgrade.sql
Normal file
38
niucloud/app/upgrade/v143/upgrade.sql
Normal file
@ -0,0 +1,38 @@
|
||||
|
||||
DROP TABLE IF EXISTS `web_nav`;
|
||||
CREATE TABLE `web_nav` (
|
||||
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`nav_title` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '导航名称',
|
||||
`nav_url` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '链接地址',
|
||||
`sort` INT(11) NOT NULL COMMENT '排序号',
|
||||
`is_blank` INT(11) DEFAULT 0 COMMENT '是否新打开',
|
||||
`create_time` INT(11) DEFAULT 0 COMMENT '创建时间',
|
||||
`update_time` INT(11) DEFAULT 0 COMMENT '修改时间',
|
||||
`is_show` SMALLINT(6) NOT NULL DEFAULT 1 COMMENT '是否显示 1显示 0不显示',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='PC导航管理';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `web_friendly_link`;
|
||||
CREATE TABLE `web_friendly_link` (
|
||||
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '索引id',
|
||||
`link_title` VARCHAR(100) NOT NULL COMMENT '标题',
|
||||
`link_url` VARCHAR(100) NOT NULL COMMENT '链接',
|
||||
`link_pic` VARCHAR(100) NOT NULL COMMENT '图片',
|
||||
`sort` INT(11) NOT NULL DEFAULT 0 COMMENT '排序号',
|
||||
`is_show` INT(11) NOT NULL DEFAULT 1 COMMENT '是否显示 1.是 2.否',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='电脑端友情链接表';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `web_adv`;
|
||||
CREATE TABLE `web_adv` (
|
||||
`adv_id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`adv_key` VARCHAR(50) NOT NULL DEFAULT '0' COMMENT '广告位key',
|
||||
`adv_title` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '广告内容描述',
|
||||
`adv_url` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '广告链接',
|
||||
`adv_image` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '广告内容图片',
|
||||
`sort` INT(11) NOT NULL DEFAULT 0 COMMENT '排序号',
|
||||
`background` VARCHAR(255) NOT NULL DEFAULT '#FFFFFF' COMMENT '背景色',
|
||||
PRIMARY KEY (`adv_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci COMMENT='广告表';
|
||||
@ -1,57 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的多应用管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\validate\article;
|
||||
|
||||
|
||||
use think\Validate;
|
||||
|
||||
/**
|
||||
* Class Article
|
||||
* @package app\validate\article
|
||||
*/
|
||||
class Article extends Validate
|
||||
{
|
||||
|
||||
//用户名或密码的规范可能是从数据库中获取的
|
||||
protected $rule = [
|
||||
'title' => 'require|max:20',
|
||||
'intro' => 'max:50',
|
||||
'summary' => 'max:50',
|
||||
'image' => 'max:100',
|
||||
'author' => 'max:20',
|
||||
'is_show' => 'number|between:0,1',
|
||||
'sort' => 'number|between:0,10000',
|
||||
'category_id' => 'number|require',
|
||||
'content' => 'require',
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
'title.require' => 'validate_article.title_require',
|
||||
'title.max' => 'validate_article.title_max',
|
||||
'intro.max' => 'validate_article.intro_max',
|
||||
'summary.max' => 'validate_article.summary_max',
|
||||
'image.max' => 'validate_article.image_max',
|
||||
'author.max' => 'validate_article.author_max',
|
||||
'is_show.number' => 'validate_article.is_show_number',
|
||||
'is_show.between' => 'validate_article.is_show_between',
|
||||
'sort.number' => 'validate_article.sort_number',
|
||||
'sort.between' => 'validate_article.sort_between',
|
||||
'category_id.require' => 'validate_article.category_id_require',
|
||||
'category_id.number' => 'validate_article.category_id_number',
|
||||
'content.require' => 'validate_article.content_require',
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'add' => ['title', 'intro', 'summary', 'image', 'author', 'is_show', 'sort', 'content', 'category_id'],
|
||||
'edit' => ['title', 'intro', 'summary', 'image', 'author', 'is_show', 'sort', 'content', 'category_id'],
|
||||
];
|
||||
}
|
||||
@ -1,45 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的多应用管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\validate\article;
|
||||
|
||||
|
||||
use think\Validate;
|
||||
|
||||
/**
|
||||
* 文章分类(栏目)验证
|
||||
* Class Article
|
||||
* @package app\validate\article
|
||||
*/
|
||||
class ArticleCategory extends Validate
|
||||
{
|
||||
|
||||
//用户名或密码的规范可能是从数据库中获取的
|
||||
protected $rule = [
|
||||
'name' => 'require|max:20',
|
||||
'is_show' => 'number|between:0,1',
|
||||
'sort' => 'number|between:0,10000'
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
'name.require' => 'validate_article.cate_name_require',
|
||||
'name.max' => 'validate_article.cate_name_max',
|
||||
'is_show.number' => 'validate_article.is_show_number',
|
||||
'is_show.between' => 'validate_article.is_show_between',
|
||||
'sort.number' => 'validate_article.sort_number',
|
||||
'sort.between' => 'validate_article.sort_between',
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'add' => ['name', 'is_show', 'sort'],
|
||||
'edit' => ['name', 'is_show', 'sort'],
|
||||
];
|
||||
}
|
||||
39
niucloud/app/validate/web/FriendlyLink.php
Normal file
39
niucloud/app/validate/web/FriendlyLink.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的多应用管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\validate\web;
|
||||
|
||||
use core\base\BaseValidate;
|
||||
|
||||
/**
|
||||
* 友情链接验证器
|
||||
* Class FriendlyLink
|
||||
* @package addon\app\validate\web
|
||||
*/
|
||||
class FriendlyLink extends BaseValidate
|
||||
{
|
||||
|
||||
protected $rule = [
|
||||
'link_title' => 'require',
|
||||
'link_url' => 'require',
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
'link_title.require' => [ 'common_validate.require', [ 'link_title' ] ],
|
||||
'link_url.require' => [ 'common_validate.require', [ 'link_url' ] ],
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
"add" => [ 'link_pic', 'link_title', 'link_url', 'is_show' ],
|
||||
"edit" => [ 'link_pic', 'link_title', 'link_url', 'is_show' ]
|
||||
];
|
||||
|
||||
}
|
||||
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'version' => '1.4.2',
|
||||
'code' => '202411210001'
|
||||
'version' => '1.4.3',
|
||||
'code' => '202412120001'
|
||||
];
|
||||
|
||||
38
niucloud/core/dict/AdvPosition.php
Normal file
38
niucloud/core/dict/AdvPosition.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的saas管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
namespace core\dict;
|
||||
|
||||
|
||||
class AdvPosition extends BaseDict
|
||||
{
|
||||
/**
|
||||
* 广告位加载
|
||||
* @param array $data
|
||||
* @return array|mixed
|
||||
*/
|
||||
public function load(array $data)
|
||||
{
|
||||
$addons = $this->getLocalAddons();
|
||||
$adv_position_files = [];
|
||||
foreach ($addons as $v) {
|
||||
$adv_position_path = $this->getAddonDictPath($v) . "web" . DIRECTORY_SEPARATOR . "adv_position.php";
|
||||
if (is_file($adv_position_path)) {
|
||||
$adv_position_files[] = $adv_position_path;
|
||||
}
|
||||
}
|
||||
$adv_position_file_data = $this->loadFiles($adv_position_files);
|
||||
$adv_position = $data;
|
||||
foreach ($adv_position_file_data as $file_data) {
|
||||
$adv_position = empty($adv_position) ? $file_data : array_merge($adv_position, $file_data);
|
||||
}
|
||||
return $adv_position;
|
||||
}
|
||||
}
|
||||
1
niucloud/core/dict/PackageGift.php
Normal file
1
niucloud/core/dict/PackageGift.php
Normal file
@ -0,0 +1 @@
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
75
niucloud/core/dict/WebLink.php
Normal file
75
niucloud/core/dict/WebLink.php
Normal file
@ -0,0 +1,75 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的saas管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
namespace core\dict;
|
||||
|
||||
|
||||
use app\service\admin\addon\AddonService;
|
||||
|
||||
class WebLink extends BaseDict
|
||||
{
|
||||
/**
|
||||
* 系统weblink页面链接
|
||||
* @param array $params
|
||||
* @return array|false|mixed|string
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function load(array $params = [])
|
||||
{
|
||||
if (!empty($params[ 'params' ][ 'addon' ])) {
|
||||
$addons = [ $params[ 'params' ][ 'addon' ] ];
|
||||
} else {
|
||||
$addons = $this->getLocalAddons();
|
||||
}
|
||||
|
||||
$link_files = [];
|
||||
|
||||
foreach ($addons as $v) {
|
||||
$link_path = $this->getAddonDictPath($v) . "web" . DIRECTORY_SEPARATOR . "web_links.php";
|
||||
if (is_file($link_path)) {
|
||||
$link_files[ $v ] = $link_path;
|
||||
}
|
||||
}
|
||||
|
||||
$addon_service = new AddonService();
|
||||
$addon_info_list = $addon_service->getAddonListByKeys(array_keys($link_files));
|
||||
|
||||
if (!empty($params[ 'params' ][ 'query' ]) && $params[ 'params' ][ 'query' ] == 'addon') {
|
||||
$list_key = array_column($addon_info_list, 'key');
|
||||
$addon_info_list = array_combine($list_key, $addon_info_list);
|
||||
return $addon_info_list;
|
||||
} else {
|
||||
|
||||
$links = $params[ 'data' ];
|
||||
|
||||
foreach ($link_files as $k => $v) {
|
||||
$addon_link = include $v;
|
||||
if (!empty($addon_link)) {
|
||||
$addon_info = [];
|
||||
foreach ($addon_info_list as $ck => $cv) {
|
||||
if ($cv[ 'key' ] == $k) {
|
||||
$addon_info = $cv;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($addon_link as $ck => $cv) {
|
||||
$addon_link[ $ck ][ 'addon_info' ] = $addon_info;
|
||||
}
|
||||
$links = array_merge($links, $addon_link);
|
||||
}
|
||||
}
|
||||
|
||||
return $links;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user