mirror of
https://gitee.com/niucloud-team/niucloud-admin.git
synced 2025-12-12 10:52:48 +00:00
niucloud
This commit is contained in:
parent
c59d011d1e
commit
05a8c49ce6
@ -41,7 +41,8 @@ class Addon extends BaseAdminController
|
||||
* @param $addon
|
||||
* @return void
|
||||
*/
|
||||
public function execute($addon) {
|
||||
public function execute($addon)
|
||||
{
|
||||
return ( new AddonService() )->executeInstall($addon);
|
||||
}
|
||||
|
||||
@ -50,7 +51,8 @@ class Addon extends BaseAdminController
|
||||
* @param $addon
|
||||
* @return mixed
|
||||
*/
|
||||
public function installCheck($addon){
|
||||
public function installCheck($addon)
|
||||
{
|
||||
return ( new AddonService() )->installCheck($addon);
|
||||
}
|
||||
|
||||
|
||||
@ -25,6 +25,4 @@ class App extends BaseAdminController
|
||||
return success(( new CoreAddonService() )->getAppList());
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -12,7 +12,6 @@
|
||||
namespace app\adminapi\controller\aliapp;
|
||||
|
||||
use app\service\admin\aliapp\AliappConfigService;
|
||||
use app\service\admin\site\WebSiteConfigService;
|
||||
use core\base\BaseAdminController;
|
||||
use think\Response;
|
||||
|
||||
|
||||
@ -12,7 +12,6 @@
|
||||
namespace app\adminapi\controller\channel;
|
||||
|
||||
use app\service\admin\channel\H5Service;
|
||||
use app\service\admin\site\WebSiteConfigService;
|
||||
use core\base\BaseAdminController;
|
||||
use think\Response;
|
||||
|
||||
|
||||
@ -13,7 +13,6 @@ namespace app\adminapi\controller\login;
|
||||
|
||||
use app\service\admin\auth\ConfigService;
|
||||
use app\service\admin\auth\LoginService;
|
||||
use app\service\core\addon\CoreAddonInstallService;
|
||||
use core\base\BaseAdminController;
|
||||
use think\Response;
|
||||
|
||||
|
||||
@ -13,10 +13,8 @@ namespace app\adminapi\controller\member;
|
||||
|
||||
use app\dict\member\MemberAccountTypeDict;
|
||||
use app\service\admin\member\MemberAccountService;
|
||||
use app\service\admin\member\MemberCashOutService;
|
||||
use app\service\admin\member\MemberService;
|
||||
use core\base\BaseAdminController;
|
||||
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
|
||||
use think\Response;
|
||||
|
||||
class Account extends BaseAdminController
|
||||
|
||||
@ -12,9 +12,7 @@
|
||||
namespace app\adminapi\controller\pay;
|
||||
|
||||
use app\dict\pay\PayDict;
|
||||
use app\model\pay\PayConfigTemplate;
|
||||
use app\service\admin\pay\PayChannelService;
|
||||
use app\service\admin\pay\PayConfigTemplateService;
|
||||
use core\base\BaseAdminController;
|
||||
use think\Response;
|
||||
|
||||
|
||||
@ -11,10 +11,10 @@
|
||||
|
||||
namespace app\adminapi\controller\upload;
|
||||
|
||||
use app\adminapi\controller\sys\AdminException;
|
||||
use app\dict\sys\StorageDict;
|
||||
use app\service\admin\file\StorageConfigService;
|
||||
use core\base\BaseAdminController;
|
||||
use core\exception\AdminException;
|
||||
use think\Response;
|
||||
|
||||
class Storage extends BaseAdminController
|
||||
@ -62,7 +62,4 @@ class Storage extends BaseAdminController
|
||||
return success('SET_SUCCESS');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -11,7 +11,6 @@
|
||||
|
||||
namespace app\adminapi\controller\upload;
|
||||
|
||||
use app\adminapi\controller\sys\AdminException;
|
||||
use app\service\admin\file\UploadConfigService;
|
||||
use app\service\admin\file\UploadService;
|
||||
use core\base\BaseAdminController;
|
||||
@ -60,8 +59,6 @@ class Upload extends BaseAdminController
|
||||
return success($upload_service->document($data['file'], $type, true));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 上传配置
|
||||
* @return void
|
||||
|
||||
@ -11,7 +11,6 @@
|
||||
|
||||
namespace app\adminapi\controller\wechat;
|
||||
|
||||
use app\service\admin\site\WebSiteConfigService;
|
||||
use app\service\admin\wechat\WechatConfigService;
|
||||
use core\base\BaseAdminController;
|
||||
use think\Response;
|
||||
|
||||
@ -13,7 +13,6 @@ namespace app\adminapi\middleware;
|
||||
|
||||
use app\Request;
|
||||
use Closure;
|
||||
use core\exception\AdminException;
|
||||
use core\exception\ServerException;
|
||||
|
||||
/**
|
||||
@ -39,9 +38,17 @@ class AllowCrossDomain
|
||||
$allow_origin = [
|
||||
rtrim(str_replace('https://','',str_replace('http://','',$request->domain())),"/"),
|
||||
];
|
||||
if(env('system.admin_domain')){
|
||||
$allow_origin[] = rtrim(str_replace('https://','',str_replace('http://','',env('system.admin_domain'))),"/");
|
||||
$admin_domain = env('system.admin_domain');
|
||||
if(!empty($admin_domain)){
|
||||
$admin_domain = explode(',', $admin_domain);
|
||||
foreach($admin_domain as $v){
|
||||
if(!trim($v)) continue;
|
||||
$allow_origin[] = rtrim(str_replace('https://','',str_replace('http://','',$v)),"/");
|
||||
}
|
||||
}
|
||||
// if(env('system.admin_domain')){
|
||||
// $allow_origin[] = rtrim(str_replace('https://','',str_replace('http://','',env('system.admin_domain'))),"/");
|
||||
// }
|
||||
$referer = $request->header('referer');
|
||||
$origin = '';
|
||||
if(!empty($referer)){
|
||||
|
||||
@ -12,9 +12,7 @@
|
||||
use think\facade\Route;
|
||||
|
||||
$is_demo = env('system.is_demo', 0);
|
||||
if($is_demo&& !\think\facade\Request::isGet())
|
||||
{
|
||||
if ($is_demo && !\think\facade\Request::isGet()) {
|
||||
//加载插件路由
|
||||
throw new \core\exception\CommonException("演示数据不能进行修改");
|
||||
}
|
||||
|
||||
throw new \core\exception\CommonException("演示数据不能进行修改");
|
||||
}
|
||||
@ -32,7 +32,7 @@ class Login extends BaseController
|
||||
//验证码验证
|
||||
$result = (new LoginService())->account($data['username'], $data['password']);
|
||||
if(!$result){
|
||||
//账号密码错误...., 重置验证码
|
||||
//账号密码错误, 重置验证码
|
||||
return fail('ACCOUNT_OR_PASSWORD_ERROR');
|
||||
}
|
||||
return success($result);
|
||||
|
||||
@ -23,22 +23,26 @@ class Config extends BaseApiController
|
||||
* 获取版权信息
|
||||
* @return Response
|
||||
*/
|
||||
public function getCopyright(){
|
||||
return success((new ConfigService())->getCopyright());
|
||||
public function getCopyright()
|
||||
{
|
||||
return success(( new ConfigService() )->getCopyright());
|
||||
}
|
||||
/**
|
||||
|
||||
/**
|
||||
* 场景域名
|
||||
* @return Response
|
||||
*/
|
||||
public function getSceneDomain(){
|
||||
return success((new ConfigService())->getSceneDomain());
|
||||
public function getSceneDomain()
|
||||
{
|
||||
return success(( new ConfigService() )->getSceneDomain());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取站点信息
|
||||
* @return Response
|
||||
*/
|
||||
public function site(){
|
||||
return success((new SiteService())->getSiteCache());
|
||||
public function site()
|
||||
{
|
||||
return success(( new SiteService() )->getSiteCache());
|
||||
}
|
||||
}
|
||||
|
||||
@ -27,8 +27,6 @@ class Weapp extends BaseApiController
|
||||
$data = $this->request->params([['code', '']]);
|
||||
$weapp_auth_service = new WeappAuthService();
|
||||
return success($weapp_auth_service->login($data['code']));
|
||||
|
||||
//todo 执行登录操作
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -25,6 +25,7 @@ class Serve extends BaseController
|
||||
* @return void
|
||||
*/
|
||||
public function serve($site_id){
|
||||
|
||||
return (new WechatServeService())->serve();
|
||||
}
|
||||
|
||||
|
||||
@ -13,7 +13,6 @@ namespace app\api\middleware;
|
||||
|
||||
use app\Request;
|
||||
use Closure;
|
||||
use core\exception\ApiException;
|
||||
use core\exception\ServerException;
|
||||
|
||||
/**
|
||||
@ -39,12 +38,29 @@ class AllowCrossDomain
|
||||
$allow_origin = [
|
||||
rtrim(str_replace('https://','',str_replace('http://','',$request->domain())),"/"),
|
||||
];
|
||||
if(env('system.wap_domain')){
|
||||
$allow_origin[] = rtrim(str_replace('https://','',str_replace('http://','',env('system.wap_domain'))),"/");
|
||||
|
||||
$wap_domain = env('system.wap_domain');
|
||||
if(!empty($wap_domain)){
|
||||
$wap_domain = explode(',', $wap_domain);
|
||||
foreach($wap_domain as $v){
|
||||
if(!trim($v)) continue;
|
||||
$allow_origin[] = rtrim(str_replace('https://','',str_replace('http://','',$v)),"/");
|
||||
}
|
||||
}
|
||||
if(env('system.web_domain')){
|
||||
$allow_origin[] = rtrim(str_replace('https://','',str_replace('http://','',env('system.web_domain'))),"/");
|
||||
$web_domain = env('system.web_domain');
|
||||
if(!empty($web_domain)){
|
||||
$web_domain = explode(',', $web_domain);
|
||||
foreach($web_domain as $v){
|
||||
if(!trim($v)) continue;
|
||||
$allow_origin[] = rtrim(str_replace('https://','',str_replace('http://','',$v)),"/");
|
||||
}
|
||||
}
|
||||
// if(env('system.wap_domain')){
|
||||
// $allow_origin[] = rtrim(str_replace('https://','',str_replace('http://','',env('system.wap_domain'))),"/");
|
||||
// }
|
||||
// if(env('system.web_domain')){
|
||||
// $allow_origin[] = rtrim(str_replace('https://','',str_replace('http://','',env('system.web_domain'))),"/");
|
||||
// }
|
||||
$referer = $request->header('referer');
|
||||
$origin = '';
|
||||
if(!empty($referer)){
|
||||
@ -52,7 +68,6 @@ class AllowCrossDomain
|
||||
$referer = $referer['host'] ?? '';
|
||||
$origin = rtrim(str_replace('https://','',str_replace('http://','',$referer)),"/");
|
||||
}
|
||||
|
||||
if(env('app_debug') || ($origin && in_array($origin, $allow_origin))){
|
||||
header('Access-Control-Allow-Origin: *');
|
||||
}else{
|
||||
|
||||
@ -14,29 +14,31 @@ namespace app\api\middleware;
|
||||
use app\Request;
|
||||
use Closure;
|
||||
use Exception;
|
||||
use think\facade\Log;
|
||||
|
||||
|
||||
/**
|
||||
* api渠道处理, 各种渠道的请求不叫特殊, 会在这儿将渠道的公共数据处理好
|
||||
* Class ApiCheckToken
|
||||
* @package app\api\middleware
|
||||
*/
|
||||
class ApiChannel
|
||||
{
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param Closure $next
|
||||
* @param bool $exception 是否把错误抛出
|
||||
* @return mixed
|
||||
* @throws Exception
|
||||
*/
|
||||
public function handle(Request $request, Closure $next)
|
||||
{
|
||||
//微信或支付宝
|
||||
if (preg_match('~micromessenger~i', $request->header('user-agent')) || preg_match('~alipay~i', $request->header('user-agent'))) {
|
||||
$channel_rules = [
|
||||
'wechat/serve/<site_id>',
|
||||
'pay/notify/<site_id>/<channel>/<type>/<action>'
|
||||
];
|
||||
if (in_array($request->rule()->getRule(), $channel_rules)) {
|
||||
$site_id = $request->param('site_id', -1);
|
||||
if ($site_id != -1) {
|
||||
$request->pushHeader([ system_name('api_site_id_name') => $request->param('site_id') ]);
|
||||
$request->pushHeader([ system_name('api_site_id_name') => $site_id ]);
|
||||
}
|
||||
}
|
||||
return $next($request);
|
||||
|
||||
@ -14,8 +14,8 @@ use app\api\middleware\ApiCheckToken;
|
||||
use app\api\middleware\ApiLog;
|
||||
use think\facade\Route;
|
||||
use app\api\middleware\AllowCrossDomain;
|
||||
//公众号消息推送
|
||||
|
||||
//公众号消息推送
|
||||
Route::any('wechat/serve/:site_id', 'wechat.Serve/serve')
|
||||
->middleware(ApiChannel::class)
|
||||
->middleware(ApiCheckToken::class)
|
||||
@ -25,12 +25,10 @@ Route::any('wechat/serve/:site_id', 'wechat.Serve/serve')
|
||||
/**
|
||||
* 路由
|
||||
*/
|
||||
Route::group(function () {
|
||||
Route::group(function() {
|
||||
//获取授权地址
|
||||
Route::get('wechat/codeurl', 'wechat.Wechat/getCodeUrl');
|
||||
|
||||
//公众号消息推送
|
||||
Route::any('wechat/serve/:site_id', 'wechat.Serve/serve');
|
||||
//公众号通过code登录
|
||||
Route::post('wechat/login', 'wechat.Wechat/login');
|
||||
//公众号通过code注册
|
||||
@ -77,7 +75,7 @@ Route::group(function () {
|
||||
Route::get('scene_domain', 'sys.Config/getSceneDomain');
|
||||
})->middleware(AllowCrossDomain::class)
|
||||
->middleware(ApiChannel::class)
|
||||
->middleware(ApiCheckToken::class)
|
||||
->middleware(ApiLog::class);
|
||||
->middleware(ApiCheckToken::class)
|
||||
->middleware(ApiLog::class);
|
||||
//加载插件路由
|
||||
(new \core\dict\DictLoader("Route"))->load(['app_type' => 'api']);
|
||||
( new \core\dict\DictLoader("Route") )->load([ 'app_type' => 'api' ]);
|
||||
@ -2,12 +2,10 @@
|
||||
|
||||
namespace app\command;
|
||||
|
||||
use app\job\schedule\OrderClose;
|
||||
use app\service\core\schedule\CoreScheduleService;
|
||||
use schedule\console\Command;
|
||||
use think\console\Input;
|
||||
use think\console\Output;
|
||||
use think\facade\Log;
|
||||
use think\helper\Str;
|
||||
use DateTimeZone;
|
||||
use Workerman\Crontab\Crontab;
|
||||
|
||||
@ -11,8 +11,6 @@
|
||||
|
||||
namespace app\dict\common;
|
||||
|
||||
use app\dict\pay\PayDict;
|
||||
use core\exception\PayException;
|
||||
|
||||
/**
|
||||
* 渠道枚举类
|
||||
|
||||
@ -472,7 +472,10 @@ class PagesDict
|
||||
[
|
||||
"title" => "个人资料",
|
||||
"link" => [
|
||||
"name" => ""
|
||||
"parent" => "MEMBER_LINK",
|
||||
"name" => "MEMBER_PERSONAL",
|
||||
"title" => "个人资料",
|
||||
"url" => "/pages/member/personal"
|
||||
],
|
||||
"imageUrl" => "static/resource/images/diy/vert_m_personal.png",
|
||||
"label" => [
|
||||
@ -489,7 +492,10 @@ class PagesDict
|
||||
[
|
||||
"title" => "我的余额",
|
||||
"link" => [
|
||||
"name" => ""
|
||||
"parent" => "MEMBER_LINK",
|
||||
"name" => "MEMBER_BALANCE",
|
||||
"title" => "我的余额",
|
||||
"url" => "/pages/member/balance"
|
||||
],
|
||||
"imageUrl" => "static/resource/images/diy/vert_m_balance.png",
|
||||
"label" => [
|
||||
@ -506,7 +512,10 @@ class PagesDict
|
||||
[
|
||||
"title" => "我的积分",
|
||||
"link" => [
|
||||
"name" => ""
|
||||
"parent" => "MEMBER_LINK",
|
||||
"name" => "MEMBER_POINT",
|
||||
"title" => "我的积分",
|
||||
"url" => "/pages/member/point"
|
||||
],
|
||||
"imageUrl" => "static/resource/images/diy/vert_m_point.png",
|
||||
"label" => [
|
||||
@ -786,7 +795,10 @@ class PagesDict
|
||||
[
|
||||
"title" => "个人资料",
|
||||
"link" => [
|
||||
"name" => ""
|
||||
"parent" => "MEMBER_LINK",
|
||||
"name" => "MEMBER_PERSONAL",
|
||||
"title" => "个人资料",
|
||||
"url" => "/pages/member/personal"
|
||||
],
|
||||
"imageUrl" => "static/resource/images/diy/vert_m_personal.png",
|
||||
"label" => [
|
||||
@ -803,7 +815,10 @@ class PagesDict
|
||||
[
|
||||
"title" => "我的余额",
|
||||
"link" => [
|
||||
"name" => ""
|
||||
"parent" => "MEMBER_LINK",
|
||||
"name" => "MEMBER_BALANCE",
|
||||
"title" => "我的余额",
|
||||
"url" => "/pages/member/balance"
|
||||
],
|
||||
"imageUrl" => "static/resource/images/diy/vert_m_balance.png",
|
||||
"label" => [
|
||||
@ -820,7 +835,10 @@ class PagesDict
|
||||
[
|
||||
"title" => "我的积分",
|
||||
"link" => [
|
||||
"name" => ""
|
||||
"parent" => "MEMBER_LINK",
|
||||
"name" => "MEMBER_POINT",
|
||||
"title" => "我的积分",
|
||||
"url" => "/pages/member/point"
|
||||
],
|
||||
"imageUrl" => "static/resource/images/diy/vert_m_point.png",
|
||||
"label" => [
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
return
|
||||
[
|
||||
[
|
||||
|
||||
@ -10,7 +10,9 @@
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\dict\notice;
|
||||
|
||||
use core\dict\DictLoader;
|
||||
|
||||
/**
|
||||
* 消息类
|
||||
* Class NoticeDict
|
||||
@ -22,31 +24,29 @@ class NoticeDict
|
||||
* 获取消息
|
||||
* @return array
|
||||
*/
|
||||
public static function getNotice(string $key = ''){
|
||||
public static function getNotice(string $key = '')
|
||||
{
|
||||
$addon_load = new DictLoader('Notice');
|
||||
$notice = $addon_load->load(['type' => 'notice']);
|
||||
$notice = $addon_load->load([ 'type' => 'notice' ]);
|
||||
$notice_type = NoticeTypeDict::getType();
|
||||
foreach($notice_type as $k => $v){
|
||||
$var_name = $k.'_notice';
|
||||
$$var_name = $addon_load->load(['type' => $k]);
|
||||
foreach ($notice_type as $k => $v) {
|
||||
$var_name = $k . '_notice';
|
||||
$$var_name = $addon_load->load([ 'type' => $k ]);
|
||||
}
|
||||
|
||||
foreach ($notice as $k => $v)
|
||||
{
|
||||
foreach ($notice as $k => $v) {
|
||||
$support_type = [];
|
||||
foreach($notice_type as $notice_type_k => $notice_type_v){
|
||||
$var_name = $notice_type_k.'_notice';
|
||||
if(array_key_exists($k, $$var_name))
|
||||
{
|
||||
$notice[$k][$notice_type_k] = $$var_name[$k];
|
||||
foreach ($notice_type as $notice_type_k => $notice_type_v) {
|
||||
$var_name = $notice_type_k . '_notice';
|
||||
if (array_key_exists($k, $$var_name)) {
|
||||
$notice[ $k ][ $notice_type_k ] = $$var_name[ $k ];
|
||||
$support_type[] = $notice_type_k;
|
||||
}
|
||||
}
|
||||
$notice[$k]['support_type'] = $support_type;
|
||||
$notice[ $k ][ 'support_type' ] = $support_type;
|
||||
}
|
||||
if(!empty($key))
|
||||
{
|
||||
return $notice[$key] ?? [];
|
||||
if (!empty($key)) {
|
||||
return $notice[ $key ] ?? [];
|
||||
}
|
||||
return $notice;
|
||||
}
|
||||
|
||||
@ -57,7 +57,7 @@ class RechargeOrderDict
|
||||
{
|
||||
return [
|
||||
'type' => 'recharge',
|
||||
'name' => get_lang('dict_order.order_type_recharge')
|
||||
'name' => get_lang('dict_order.order_type_recharge')
|
||||
];
|
||||
}
|
||||
|
||||
@ -108,15 +108,16 @@ class RechargeOrderDict
|
||||
if ($status == '') {
|
||||
return $data;
|
||||
}
|
||||
return $data[$status] ?? '';
|
||||
return $data[ $status ] ?? '';
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取退款状态
|
||||
* @param int|string $status
|
||||
* @param string $status
|
||||
* @return array|array[]|string
|
||||
*/
|
||||
public static function getRefundStatus(int|string $status = '') {
|
||||
public static function getRefundStatus(string $status = '')
|
||||
{
|
||||
$data = [
|
||||
self::REFUNDING => [
|
||||
'name' => get_lang('dict_order_refund.refunding'),
|
||||
@ -135,7 +136,7 @@ class RechargeOrderDict
|
||||
if ($status == '') {
|
||||
return $data;
|
||||
}
|
||||
return $data[$status] ?? '';
|
||||
return $data[ $status ] ?? '';
|
||||
}
|
||||
|
||||
}
|
||||
@ -52,7 +52,6 @@
|
||||
<div id="line1" class="bar">
|
||||
<div id="point1" class="c-step"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="processBar">
|
||||
<div class="text" style="margin: 10px -30px;"><span class='poetry'>3.参数配置</span></div>
|
||||
|
||||
@ -15,36 +15,36 @@
|
||||
</p>
|
||||
<p>
|
||||
<strong>二、协议许可权利 </strong>
|
||||
<ol>
|
||||
<li>1、用户接受并承诺遵守本协议才可登录niucloud-admin官网订购应用,如果用户不同意,那么不允许在niucloud-admin官网注册账号并登录体验。</li>
|
||||
<li>2、用户必须是具有独立民事责任行为能力的自然人、法人或其他组织个人。若用户不具备前述资格,那么该用户及其监护人应承担导致的一切后果。并且官方有权利对其账号进行冻结,对官方造成的利益损害有权进行申诉索赔。</li>
|
||||
<li>3、用户可登录niucloud-admin官网下载并安装免费版应用。</li>
|
||||
<li>4、若需要安装付费版应用,用户需要登录niucloud-admin官网付费并订购付费版应用后才可下载安装。</li>
|
||||
<li>5、在更新niucloud-admin框架到最新版时,请务必对原整站内容进行备份,否则niucloud官方对升级过程中造成的数据丢失等问题不承担任何责任。</li>
|
||||
<li>6、niucloud官方下架应用造成的无法更新,官方不承担任何责任。</li>
|
||||
<li>7、niucloud官方因商业需求,暂停应用的更新,官方不承担任何责任。</li>
|
||||
<li>8、niucloud官网有权根据需要不时地制订、修改本协议或各类规则,并以公示的方式进行公告,不再单独通知用户。变更后的协议和规则一经公布后,立即自动生效。如用户不同意相关变更,应当立即停止使用niucloud-admin付费应用。如果用户继续订阅、使用niucloud-admin付费应用,即表示用户接受经修订的协议。</li>
|
||||
</ol>
|
||||
<ol>
|
||||
<li>1、用户接受并承诺遵守本协议才可登录niucloud-admin官网订购应用,如果用户不同意,那么不允许在niucloud-admin官网注册账号并登录体验。</li>
|
||||
<li>2、用户必须是具有独立民事责任行为能力的自然人、法人或其他组织个人。若用户不具备前述资格,那么该用户及其监护人应承担导致的一切后果。并且官方有权利对其账号进行冻结,对官方造成的利益损害有权进行申诉索赔。</li>
|
||||
<li>3、用户可登录niucloud-admin官网下载并安装免费版应用。</li>
|
||||
<li>4、若需要安装付费版应用,用户需要登录niucloud-admin官网付费并订购付费版应用后才可下载安装。</li>
|
||||
<li>5、在更新niucloud-admin框架到最新版时,请务必对原整站内容进行备份,否则niucloud官方对升级过程中造成的数据丢失等问题不承担任何责任。</li>
|
||||
<li>6、niucloud官方下架应用造成的无法更新,官方不承担任何责任。</li>
|
||||
<li>7、niucloud官方因商业需求,暂停应用的更新,官方不承担任何责任。</li>
|
||||
<li>8、niucloud官网有权根据需要不时地制订、修改本协议或各类规则,并以公示的方式进行公告,不再单独通知用户。变更后的协议和规则一经公布后,立即自动生效。如用户不同意相关变更,应当立即停止使用niucloud-admin付费应用。如果用户继续订阅、使用niucloud-admin付费应用,即表示用户接受经修订的协议。</li>
|
||||
</ol>
|
||||
</p>
|
||||
<p>
|
||||
<strong>三、协议规定的约束和限制</strong>
|
||||
<ol>
|
||||
<li>1、请尊重开发人员劳动成果,严禁对本框架进行转卖、销售或二次开发后转卖、销售等商业行为。</li>
|
||||
<li>2、任何企业和个人不允许对程序代码以任何形式任何目的再发布。</li>
|
||||
<li>3、基于niucloud-admin应用从事的任何商业行为,都与niucloud官方无关。</li>
|
||||
<li>4、授权niucloud-admin付费应用时,必须要确保授权信息主体录入的准确性,否则出现的法律纠纷与niucloud官方无关,需要自行解决。</li>
|
||||
<li>5、应用金额以最终结算价格为准,已售出的应用不做任何差价补偿。</li>
|
||||
<li>6、如果用户利用特殊手段以低价或者免费获得付费应用,niucloud官方有权对应用进行回收。</li>
|
||||
<li>7、niucloud-admin付费应用一旦完成交易下载源码,不得以任何形式和理由进行退款,请在购买前仔细阅读本协议。</li>
|
||||
<li>8、基于niucloud-admin框架进行应用的开发,必须保留框架版权信息。</li>
|
||||
</ol>
|
||||
<ol>
|
||||
<li>1、请尊重开发人员劳动成果,严禁对本框架进行转卖、销售或二次开发后转卖、销售等商业行为。</li>
|
||||
<li>2、任何企业和个人不允许对程序代码以任何形式任何目的再发布。</li>
|
||||
<li>3、基于niucloud-admin应用从事的任何商业行为,都与niucloud官方无关。</li>
|
||||
<li>4、授权niucloud-admin付费应用时,必须要确保授权信息主体录入的准确性,否则出现的法律纠纷与niucloud官方无关,需要自行解决。</li>
|
||||
<li>5、应用金额以最终结算价格为准,已售出的应用不做任何差价补偿。</li>
|
||||
<li>6、如果用户利用特殊手段以低价或者免费获得付费应用,niucloud官方有权对应用进行回收。</li>
|
||||
<li>7、niucloud-admin付费应用一旦完成交易下载源码,不得以任何形式和理由进行退款,请在购买前仔细阅读本协议。</li>
|
||||
<li>8、基于niucloud-admin框架进行应用的开发,必须保留框架版权信息。</li>
|
||||
</ol>
|
||||
</p>
|
||||
<p>
|
||||
<strong>四、知识产权声明</strong>
|
||||
<ol>
|
||||
<li>1、niucloud-admin框架应用源代码所有权和著作权归niucloud官方所有,基于niucloud-admin框架开发的应用,所有权和著作权归应用开发商所有。</li>
|
||||
<li>2、niucloud-admin框架所依托的代码、文字、图片等著作权、专利权及其他知识产权均归niucloud官方所有,除另外有特别声明。</li>
|
||||
</ol>
|
||||
<ol>
|
||||
<li>1、niucloud-admin框架应用源代码所有权和著作权归niucloud官方所有,基于niucloud-admin框架开发的应用,所有权和著作权归应用开发商所有。</li>
|
||||
<li>2、niucloud-admin框架所依托的代码、文字、图片等著作权、专利权及其他知识产权均归niucloud官方所有,除另外有特别声明。</li>
|
||||
</ol>
|
||||
</p>
|
||||
|
||||
<p><strong>五、有限担保和免责声明</strong></p>
|
||||
|
||||
@ -83,31 +83,41 @@
|
||||
<table border="0" align="center" cellpadding="0" cellspacing="0" class="twbox">
|
||||
<tr>
|
||||
<td class="onetd"><span class="required">*</span><span>网站标题:</span></td>
|
||||
<td><input name="admin_name" id="admin_name" type="text" value="" class="input-txt" lay-verify="empty" placeholder="请输入网站标题"/>
|
||||
<small id="mess_admin_name">网站标题 必填</small></td>
|
||||
<td>
|
||||
<input name="admin_name" id="admin_name" type="text" value="" class="input-txt" lay-verify="empty" placeholder="请输入网站标题"/>
|
||||
<small id="mess_admin_name">网站标题 必填</small>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="onetd"><span class="required">*</span><span>管理员用户名:</span></td>
|
||||
<td><input name="username" id="username" type="text" value="" class="input-txt" lay-verify="empty" placeholder="请输入平台用户名"/>
|
||||
<small id="mess_username">管理员用户名 必填</small></td>
|
||||
<td>
|
||||
<input name="username" id="username" type="text" value="" class="input-txt" lay-verify="empty" placeholder="请输入平台用户名"/>
|
||||
<small id="mess_username">管理员用户名 必填</small>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="onetd"><span class="required">*</span><span>管理员密码:</span></td>
|
||||
<td><input name="password" id="password" type="password" value="" class="input-txt" lay-verify="empty" placeholder="请输入平台密码"/>
|
||||
<small id="mess_password">密码 必填</small></td>
|
||||
<td>
|
||||
<input name="password" id="password" type="password" value="" class="input-txt" lay-verify="empty" placeholder="请输入平台密码"/>
|
||||
<small id="mess_password">密码 必填</small>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="onetd"><span class="required">*</span><span>确认密码:</span></td>
|
||||
<td><input name="password2" id="password2" type="password" value="" class="input-txt" lay-verify="empty" placeholder="请输入平台确认密码"/>
|
||||
<small id="mess_password2">确认密码 必填</small></td>
|
||||
<td>
|
||||
<input name="password2" id="password2" type="password" value="" class="input-txt" lay-verify="empty" placeholder="请输入平台确认密码"/>
|
||||
<small id="mess_password2">确认密码 必填</small>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h3>默认站点</h3>
|
||||
<table border="0" align="center" cellpadding="0" cellspacing="0" class="twbox">
|
||||
<tr>
|
||||
<td class="onetd"><span class="required">*</span><span>站点名称:</span></td>
|
||||
<td><input name="site_name" id="site_name" type="text" value="" class="input-txt" lay-verify="empty" placeholder="请输入站点用户名"/>
|
||||
<small id="mess_site_name">站点名称 必填</small></td>
|
||||
<td>
|
||||
<input name="site_name" id="site_name" type="text" value="" class="input-txt" lay-verify="empty" placeholder="请输入站点用户名"/>
|
||||
<small id="mess_site_name">站点名称 必填</small>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="onetd"><span class="required">*</span><span>站点管理员:</span></td>
|
||||
@ -122,13 +132,17 @@
|
||||
</div>
|
||||
<tr>
|
||||
<td class="onetd"><span class="required">*</span><span>管理员密码:</span></td>
|
||||
<td><input name="site_password" id="site_password" type="password" value="" class="input-txt" lay-verify="empty" placeholder="请输入站点密码"/>
|
||||
<small id="mess_site_password">管理员密码 必填</small></td>
|
||||
<td>
|
||||
<input name="site_password" id="site_password" type="password" value="" class="input-txt" lay-verify="empty" placeholder="请输入站点密码"/>
|
||||
<small id="mess_site_password">管理员密码 必填</small>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="onetd"><span class="required">*</span><span>确认密码:</span></td>
|
||||
<td><input name="site_password2" id="site_password2" type="password" value="" class="input-txt" lay-verify="empty" placeholder="请输入站点确认密码"/>
|
||||
<small id="mess_site_password2">确认密码 必填</small></td>
|
||||
<td>
|
||||
<input name="site_password2" id="site_password2" type="password" value="" class="input-txt" lay-verify="empty" placeholder="请输入站点确认密码"/>
|
||||
<small id="mess_site_password2">确认密码 必填</small>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
@ -193,7 +207,6 @@
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
//数据库连接测试
|
||||
|
||||
@ -11,8 +11,6 @@
|
||||
|
||||
namespace app\job\notice;
|
||||
|
||||
use app\model\system\Cron;
|
||||
use app\service\core\notice\CoreNoticeEventService;
|
||||
use core\base\BaseJob;
|
||||
use core\exception\NoticeException;
|
||||
|
||||
|
||||
@ -11,7 +11,6 @@
|
||||
|
||||
namespace app\job\pay;
|
||||
|
||||
use app\model\system\Cron;
|
||||
use app\service\core\pay\CorePayService;
|
||||
use core\base\BaseJob;
|
||||
use think\facade\Log;
|
||||
|
||||
@ -11,13 +11,8 @@
|
||||
|
||||
namespace app\job\schedule;
|
||||
|
||||
use app\model\system\Cron;
|
||||
use app\service\core\schedule\CoreCronService;
|
||||
use core\base\BaseJob;
|
||||
use core\exception\NoticeException;
|
||||
use core\util\Schedule;
|
||||
use think\facade\Log;
|
||||
use think\queue\Job;
|
||||
|
||||
/**
|
||||
* 队列异步调用定时任务
|
||||
|
||||
@ -11,14 +11,8 @@
|
||||
|
||||
namespace app\job\schedule;
|
||||
|
||||
use app\model\system\Cron;
|
||||
use app\service\core\schedule\CoreCronService;
|
||||
use app\service\core\site\CoreSiteService;
|
||||
use core\base\BaseJob;
|
||||
use core\exception\NoticeException;
|
||||
use core\util\Schedule;
|
||||
use think\facade\Log;
|
||||
use think\queue\Job;
|
||||
|
||||
/**
|
||||
* 站点到期自动关闭
|
||||
|
||||
@ -11,10 +11,7 @@
|
||||
|
||||
namespace app\job\sys;
|
||||
|
||||
use app\model\system\Cron;
|
||||
use app\service\core\schedule\CoreCronService;
|
||||
use core\base\BaseJob;
|
||||
use think\queue\Job;
|
||||
|
||||
/**
|
||||
* 校验文件删除是否在正常运行
|
||||
|
||||
@ -11,10 +11,7 @@
|
||||
|
||||
namespace app\job\sys;
|
||||
|
||||
use app\model\system\Cron;
|
||||
use app\service\core\schedule\CoreCronService;
|
||||
use core\base\BaseJob;
|
||||
use think\queue\Job;
|
||||
|
||||
/**
|
||||
* 校验队列是否在正常运行
|
||||
|
||||
@ -3,7 +3,6 @@
|
||||
namespace app\listener\notice;
|
||||
|
||||
use app\dict\notice\NoticeTypeDict;
|
||||
use app\dict\sys\MessageTypeDict;
|
||||
use app\service\core\member\CoreMemberService;
|
||||
use app\service\core\notice\CoreNoticeLogService;
|
||||
use core\exception\NoticeException;
|
||||
|
||||
@ -3,7 +3,6 @@
|
||||
namespace app\listener\notice;
|
||||
|
||||
use app\dict\notice\NoticeTypeDict;
|
||||
use app\dict\sys\MessageTypeDict;
|
||||
use app\service\core\member\CoreMemberService;
|
||||
use app\service\core\notice\CoreNoticeLogService;
|
||||
use core\exception\NoticeException;
|
||||
|
||||
@ -3,9 +3,7 @@
|
||||
namespace app\listener\notice_template;
|
||||
|
||||
use app\service\core\member\CoreMemberService;
|
||||
use app\service\core\order\CoreOrderRefundService;
|
||||
use app\service\core\order\CoreOrderService;
|
||||
use core\exception\NoticeException;
|
||||
|
||||
class RechargeSuccess extends BaseNoticeTemplate
|
||||
{
|
||||
|
||||
@ -13,7 +13,6 @@ namespace app\listener\scan;
|
||||
|
||||
use app\dict\scan\ScanDict;
|
||||
use app\service\api\wechat\WechatAuthService;
|
||||
use app\service\core\order\recharge\CoreRechargeOrderService;
|
||||
|
||||
/**
|
||||
* 支付异步回调事件
|
||||
|
||||
@ -22,7 +22,7 @@ use core\base\BaseModel;
|
||||
class Addon extends BaseModel
|
||||
{
|
||||
protected $type = [
|
||||
'install_time' => 'timestamp',
|
||||
'install_time' => 'timestamp',
|
||||
];
|
||||
/**
|
||||
* 数据表主键
|
||||
@ -47,6 +47,7 @@ class Addon extends BaseModel
|
||||
{
|
||||
return AddonDict::getStatus()[ $data[ 'status' ] ?? '' ] ?? '';
|
||||
}
|
||||
|
||||
/**
|
||||
* 插件名称搜索器
|
||||
* @param $value
|
||||
@ -55,11 +56,8 @@ class Addon extends BaseModel
|
||||
public function searchTitleAttr($query, $value, $data)
|
||||
{
|
||||
if ($value) {
|
||||
$query->whereLike('title', '%'.$value.'%');
|
||||
$query->whereLike('title', '%' . $value . '%');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -193,6 +193,22 @@ class Member extends BaseModel
|
||||
* @param $value
|
||||
*/
|
||||
public function searchCreateTimeAttr(Query $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('create_time', $start_time, $end_time);
|
||||
} else if ($start_time > 0 && $end_time == 0) {
|
||||
$query->where([ [ 'create_time', '>=', $start_time ] ]);
|
||||
} else if ($start_time == 0 && $end_time > 0) {
|
||||
$query->where([ [ 'create_time', '<=', $end_time ] ]);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 创建时间搜索器
|
||||
* @param $value
|
||||
*/
|
||||
public function searchJoinCreateTimeAttr(Query $query, $value, $data)
|
||||
{
|
||||
$start_time = empty($value[ 0 ]) ? 0 : strtotime($value[ 0 ]);
|
||||
$end_time = empty($value[ 1 ]) ? 0 : strtotime($value[ 1 ]);
|
||||
|
||||
@ -64,7 +64,7 @@ class MemberAccountLog extends BaseModel
|
||||
*/
|
||||
public function member()
|
||||
{
|
||||
return $this->hasOne( Member::class, 'member_id', 'member_id')->withField('member_id, member_no, username, mobile, nickname, headimg')->joinType('left');
|
||||
return $this->hasOne( Member::class, 'member_id', 'member_id')->withField('member_id, member_no, username, mobile, nickname, headimg')->joinType('inner');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -120,6 +120,18 @@ class MemberAccountLog extends BaseModel
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员搜索(用于关联表查询)
|
||||
* @param $value
|
||||
* @param $data
|
||||
*/
|
||||
public function searchJoinMemberIdAttr($query, $value, $data)
|
||||
{
|
||||
if ($value) {
|
||||
$query->where('member_account_log.member_id', $value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 类型搜索
|
||||
* @param $value
|
||||
@ -147,6 +159,23 @@ class MemberAccountLog extends BaseModel
|
||||
* @param $value
|
||||
*/
|
||||
public function searchCreateTimeAttr($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('create_time', $start_time, $end_time);
|
||||
}else if($start_time > 0 && $end_time == 0){
|
||||
$query->where([['create_time', '>=', $start_time]]);
|
||||
}else if($start_time == 0 && $end_time > 0){
|
||||
$query->where([['create_time', '<=', $end_time]]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建关联表时间搜索器
|
||||
* @param $value
|
||||
*/
|
||||
public function searchJoinCreateTimeAttr($query, $value, $data)
|
||||
{
|
||||
$start_time = empty($value[0]) ? 0 : strtotime($value[0]) ;
|
||||
$end_time = empty($value[1]) ? 0 : strtotime($value[1]) ;
|
||||
|
||||
@ -172,6 +172,23 @@ class MemberCashOut extends BaseModel
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建时间搜索器
|
||||
* @param $value
|
||||
*/
|
||||
public function searchJoinCreateTimeAttr($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('member_cash_out.create_time', $start_time, $end_time);
|
||||
}else if($start_time > 0 && $end_time == 0){
|
||||
$query->where([['member_cash_out.create_time', '>=', $start_time]]);
|
||||
}else if($start_time == 0 && $end_time > 0){
|
||||
$query->where([['member_cash_out.create_time', '<=', $end_time]]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核时间搜索器
|
||||
* @param $value
|
||||
|
||||
@ -11,7 +11,6 @@
|
||||
|
||||
namespace app\model\order;
|
||||
|
||||
use app\dict\pay\PayRefundDict;
|
||||
use app\model\member\Member;
|
||||
use app\model\pay\Refund;
|
||||
use core\base\BaseModel;
|
||||
@ -100,6 +99,19 @@ class OrderItemRefund extends BaseModel
|
||||
* @param $data
|
||||
*/
|
||||
public function searchOrderNoAttr($query, $value, $data)
|
||||
{
|
||||
if ($value) {
|
||||
$query->where('order_no', '=', $value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单号搜索(用于关联)
|
||||
* @param $query
|
||||
* @param $value
|
||||
* @param $data
|
||||
*/
|
||||
public function searchJoinOrderNoAttr($query, $value, $data)
|
||||
{
|
||||
if ($value) {
|
||||
$query->where('order_item_refund.order_no', '=', $value);
|
||||
@ -113,6 +125,19 @@ class OrderItemRefund extends BaseModel
|
||||
* @param $data
|
||||
*/
|
||||
public function searchMemberIdAttr($query, $value, $data)
|
||||
{
|
||||
if ($value) {
|
||||
$query->where('member_id', '=', $value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员id搜索
|
||||
* @param $query
|
||||
* @param $value
|
||||
* @param $data
|
||||
*/
|
||||
public function searchJoinMemberIdAttr($query, $value, $data)
|
||||
{
|
||||
if ($value) {
|
||||
$query->where('order_item_refund.member_id', '=', $value);
|
||||
@ -126,6 +151,19 @@ class OrderItemRefund extends BaseModel
|
||||
* @param $data
|
||||
*/
|
||||
public function searchStatusAttr($query, $value, $data)
|
||||
{
|
||||
if ($value != '') {
|
||||
$query->where('status', '=', $value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 退款状态
|
||||
* @param $query
|
||||
* @param $value
|
||||
* @param $data
|
||||
*/
|
||||
public function searchJoinStatusAttr($query, $value, $data)
|
||||
{
|
||||
if ($value != '') {
|
||||
$query->where('order_item_refund.status', '=', $value);
|
||||
@ -137,6 +175,23 @@ class OrderItemRefund extends BaseModel
|
||||
* @param $value
|
||||
*/
|
||||
public function searchCreateTimeAttr($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('create_time', $start_time, $end_time);
|
||||
}else if($start_time > 0 && $end_time == 0){
|
||||
$query->where([['create_time', '>=', $start_time]]);
|
||||
}else if($start_time == 0 && $end_time > 0){
|
||||
$query->where([['create_time', '<=', $end_time]]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建时间搜索器
|
||||
* @param $value
|
||||
*/
|
||||
public function searchJoinCreateTimeAttr($query, $value, $data)
|
||||
{
|
||||
$start_time = empty($value[0]) ? 0 : strtotime($value[0]) ;
|
||||
$end_time = empty($value[1]) ? 0 : strtotime($value[1]) ;
|
||||
|
||||
@ -11,9 +11,6 @@
|
||||
|
||||
namespace app\model\pay;
|
||||
|
||||
use app\dict\order\OrderTypeDict;
|
||||
use app\dict\pay\PayDict;
|
||||
use app\dict\pay\PayRefundDict;
|
||||
use app\dict\pay\RefundDict;
|
||||
use core\base\BaseModel;
|
||||
|
||||
|
||||
@ -13,7 +13,6 @@ namespace app\service\admin\generator;
|
||||
|
||||
use think\App;
|
||||
use ZipArchive;
|
||||
|
||||
use app\service\admin\generator\core\ControllerGenerator;
|
||||
use app\service\admin\generator\core\ServiceGenerator;
|
||||
use app\service\admin\generator\core\AdminApiRouteGenerator;
|
||||
|
||||
@ -42,14 +42,13 @@ class MemberAccountService extends BaseAdminService
|
||||
|
||||
$field = 'member_account_log.id, member_account_log.member_id, member_account_log.site_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", '=', $where['keywords']];
|
||||
if (!empty($where[ 'keywords' ])) {
|
||||
$member_where[] = [ "member.member_no|member.nickname|member.mobile", 'like', '%' . $where[ 'keywords' ] . '%' ];
|
||||
}
|
||||
$search_model = $this->model->where([['member_account_log.site_id', '=', $this->site_id]])->withSearch(['member_id','account_type', 'from_type', 'create_time'],$where)->withJoin(['member' => function($query){
|
||||
$search_model = $this->model->where([ [ 'member_account_log.site_id', '=', $this->site_id ] ])->withSearch([ 'join_member_id' => 'member_id', 'account_type', 'from_type', 'join_create_time' => 'create_time' ], $where)->withJoin([ 'member' => function($query) {
|
||||
$query->field("member.nickname, member.headimg, member.mobile, member.member_id, member.member_no");
|
||||
}
|
||||
])->where($member_where)->field($field)->order('create_time desc')->append(['from_type_name', 'account_type_name']);
|
||||
])->where($member_where)->field($field)->order('create_time desc')->append([ 'from_type_name', 'account_type_name' ]);
|
||||
$list = $this->pageQuery($search_model);
|
||||
return $list;
|
||||
}
|
||||
@ -62,7 +61,7 @@ class MemberAccountService extends BaseAdminService
|
||||
public function getInfo(int $id)
|
||||
{
|
||||
$field = 'id, member_id, site_id, account_type, account_data, from_type, related_id, create_time, memo';
|
||||
return $this->model->where([['id', '=', $id], ['site_id', '=', $this->site_id]])->with('memberInfo')->field($field)->findOrEmpty()->append(['from_type_name', 'account_type_name'])->toArray();
|
||||
return $this->model->where([ [ 'id', '=', $id ], [ 'site_id', '=', $this->site_id ] ])->with('memberInfo')->field($field)->findOrEmpty()->append([ 'from_type_name', 'account_type_name' ])->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -72,7 +71,7 @@ class MemberAccountService extends BaseAdminService
|
||||
*/
|
||||
public function adjustPoint(array $data)
|
||||
{
|
||||
$res = (new CoreMemberAccountService())->addLog($this->site_id, $data['member_id'], 'point', $data['account_data'], 'adjust', $data['memo'], 0);
|
||||
$res = ( new CoreMemberAccountService() )->addLog($this->site_id, $data[ 'member_id' ], 'point', $data[ 'account_data' ], 'adjust', $data[ 'memo' ], 0);
|
||||
return $res;
|
||||
}
|
||||
|
||||
@ -83,15 +82,16 @@ class MemberAccountService extends BaseAdminService
|
||||
*/
|
||||
public function adjustBalance(array $data)
|
||||
{
|
||||
$res = (new CoreMemberAccountService())->addLog($this->site_id, $data['member_id'], 'balance', $data['account_data'], 'adjust', $data['memo'], 0);
|
||||
$res = ( new CoreMemberAccountService() )->addLog($this->site_id, $data[ 'member_id' ], 'balance', $data[ 'account_data' ], 'adjust', $data[ 'memo' ], 0);
|
||||
return $res;
|
||||
}
|
||||
|
||||
public function adjustMoney(array $data)
|
||||
{
|
||||
$res = (new CoreMemberAccountService())->addLog($this->site_id, $data['member_id'], MemberAccountTypeDict::MONEY, $data['account_data'], 'adjust', $data['memo'], 0);
|
||||
$res = ( new CoreMemberAccountService() )->addLog($this->site_id, $data[ 'member_id' ], MemberAccountTypeDict::MONEY, $data[ 'account_data' ], 'adjust', $data[ 'memo' ], 0);
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取账户类型的变动方式
|
||||
* @param $account_type
|
||||
@ -99,20 +99,21 @@ class MemberAccountService extends BaseAdminService
|
||||
*/
|
||||
public function getFromType($account_type)
|
||||
{
|
||||
if(!array_key_exists($account_type, MemberAccountTypeDict::getType())) throw new AdminException('MEMBER_TYPE_NOT_EXIST');
|
||||
if (!array_key_exists($account_type, MemberAccountTypeDict::getType())) throw new AdminException('MEMBER_TYPE_NOT_EXIST');
|
||||
$res = MemberAccountChangeTypeDict::getType($account_type);
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取账户数据和
|
||||
* @param string $account_type (注意查询对应账户)
|
||||
* @param string $account_type (注意查询对应账户)
|
||||
*/
|
||||
public function getSumAccount(string $account_type)
|
||||
{
|
||||
$sum = $this->model->where([['site_id', '=', $this->site_id], ['account_type', '=', $account_type]])->sum('account_data');
|
||||
$sum = $this->model->where([ [ 'site_id', '=', $this->site_id ], [ 'account_type', '=', $account_type ] ])->sum('account_data');
|
||||
return $sum;
|
||||
}
|
||||
|
||||
/**
|
||||
* 会员账户详情
|
||||
* @param int $member_id
|
||||
@ -121,7 +122,7 @@ class MemberAccountService extends BaseAdminService
|
||||
public function getMemberAccountInfo(int $member_id)
|
||||
{
|
||||
$field = 'point, point_get, balance, balance_get, growth, growth_get, money, money_get, commission, commission_get';
|
||||
return (new Member())->where([['member_id', '=', $member_id], ['site_id', '=', $this->site_id]])->field($field)->findOrEmpty()->toArray();
|
||||
return ( new Member() )->where([ [ 'member_id', '=', $member_id ], [ 'site_id', '=', $this->site_id ] ])->field($field)->findOrEmpty()->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -131,11 +132,11 @@ class MemberAccountService extends BaseAdminService
|
||||
public function getWithdrawnCommission(int $member_id = 0)
|
||||
{
|
||||
$condition = [
|
||||
['site_id', '=', $this->site_id],
|
||||
['account_type', '=', MemberAccountTypeDict::COMMISSION],
|
||||
['from_type', '=', 'cash_out']
|
||||
[ 'site_id', '=', $this->site_id ],
|
||||
[ 'account_type', '=', MemberAccountTypeDict::COMMISSION ],
|
||||
[ 'from_type', '=', 'cash_out' ]
|
||||
];
|
||||
if(!empty($member_id)) $condition[] = ['member_id', '=', $member_id];
|
||||
if (!empty($member_id)) $condition[] = [ 'member_id', '=', $member_id ];
|
||||
|
||||
$sum = $this->model->where($condition)->sum('account_data');
|
||||
return $sum;
|
||||
@ -148,11 +149,11 @@ class MemberAccountService extends BaseAdminService
|
||||
public function getExpensesSumAccount(string $account_type, int $member_id = 0)
|
||||
{
|
||||
$condition = [
|
||||
['site_id', '=', $this->site_id],
|
||||
['account_type', '=', $account_type],
|
||||
['account_data', '<', '0']
|
||||
[ 'site_id', '=', $this->site_id ],
|
||||
[ 'account_type', '=', $account_type ],
|
||||
[ 'account_data', '<', '0' ]
|
||||
];
|
||||
if(!empty($member_id)) $condition[] = ['member_id', '=', $member_id];
|
||||
if (!empty($member_id)) $condition[] = [ 'member_id', '=', $member_id ];
|
||||
|
||||
$sum = $this->model->where($condition)->sum('account_data');
|
||||
return $sum;
|
||||
|
||||
@ -41,7 +41,7 @@ class MemberCashOutService extends BaseAdminService
|
||||
{
|
||||
$member_where = [['member.member_no|member.nickname|member.mobile', '=', $where['keywords']]];
|
||||
}
|
||||
$search_model = $this->model->where([['member_cash_out.site_id', '=', $this->site_id]])->withSearch(['member_id','status', 'create_time', 'audit_time', 'transfer_time', 'transfer_type', 'cash_out_no'],$where)->with(['transfer'])->withJoin(["member" => function($query){
|
||||
$search_model = $this->model->where([['member_cash_out.site_id', '=', $this->site_id]])->withSearch(['member_id','status', 'join_create_time' => 'create_time', 'audit_time', 'transfer_time', 'transfer_type', 'cash_out_no'],$where)->with(['transfer'])->withJoin(["member" => function($query){
|
||||
$query->field("member.nickname, member.headimg, member.mobile, member.member_id, member.member_no");
|
||||
}])->where($member_where)->field($field)->order('create_time desc')->append(['status_name', 'transfer_status_name', 'transfer_type_name', 'account_type_name']);
|
||||
$list = $this->pageQuery($search_model);
|
||||
|
||||
@ -13,7 +13,6 @@ namespace app\service\admin\notice;
|
||||
|
||||
use app\dict\sys\SmsDict;
|
||||
use app\service\core\sys\CoreConfigService;
|
||||
use app\service\core\sys\CoreMessage;
|
||||
use core\base\BaseAdminService;
|
||||
use core\exception\AdminException;
|
||||
use think\Response;
|
||||
|
||||
@ -12,7 +12,6 @@
|
||||
namespace app\service\admin\order;
|
||||
|
||||
use app\dict\order\OrderRefundDict;
|
||||
use app\dict\pay\OnlineRefundDict;
|
||||
use app\model\order\OrderItemRefund;
|
||||
use core\base\BaseAdminService;
|
||||
|
||||
@ -44,7 +43,7 @@ class RefundService extends BaseAdminService
|
||||
}
|
||||
$search_model = $this->model->where([['order_item_refund.site_id', '=', $this->site_id]])->with(['item' => function($query) {
|
||||
$query->with('orderNo')->field('order_id, order_item_id, item_name, item_image');
|
||||
}])->withSearch(['order_no', 'status', 'member_id', 'refund_no', 'create_time'],$where)->withJoin(['member' => function($query){
|
||||
}])->withSearch(['join_order_no' => 'order_no', 'join_status' => 'status', 'join_member_id' => 'member_id', 'refund_no' => 'refund_no', 'join_create_time' => 'create_time'],$where)->withJoin(['member' => function($query){
|
||||
$query->field("member.nickname, member.headimg, member.mobile, member.member_id");
|
||||
}
|
||||
])->where($member_where)->field($field)->order('create_time desc')->append(['status_name', 'payrefund.type_name']);
|
||||
|
||||
@ -16,7 +16,6 @@ use app\dict\pay\PayChannelDict;
|
||||
use app\dict\pay\PayDict;
|
||||
use app\model\pay\PayChannel;
|
||||
use app\service\core\pay\CorePayChannelService;
|
||||
use app\service\core\pay\CorePayConfigTemplateService;
|
||||
use core\base\BaseAdminService;
|
||||
use core\exception\PayException;
|
||||
|
||||
|
||||
@ -13,8 +13,6 @@ namespace app\service\admin\site;
|
||||
|
||||
use app\dict\sys\AppTypeDict;
|
||||
use app\model\site\Site;
|
||||
use app\service\admin\install\InstallArticleService;
|
||||
use app\service\admin\install\InstallDiyService;
|
||||
use app\service\admin\sys\MenuService;
|
||||
use app\service\admin\user\UserService;
|
||||
use core\base\BaseAdminService;
|
||||
|
||||
@ -11,7 +11,6 @@
|
||||
|
||||
namespace app\service\admin\stat;
|
||||
|
||||
use app\dict\order\RechargeOrderDict;
|
||||
use app\model\order\Order;
|
||||
use app\service\admin\member\MemberService;
|
||||
use app\service\admin\site\SiteService;
|
||||
|
||||
@ -14,7 +14,6 @@ namespace app\service\admin\sys;
|
||||
use app\dict\sys\RoleStatusDict;
|
||||
use app\model\sys\SysRole;
|
||||
use app\model\sys\SysUserRole;
|
||||
use app\service\admin\site\SiteGroupService;
|
||||
use app\service\admin\site\SiteService;
|
||||
use core\base\BaseAdminService;
|
||||
use core\exception\AdminException;
|
||||
|
||||
@ -12,9 +12,7 @@
|
||||
namespace app\service\admin\sys;
|
||||
|
||||
use app\job\sys\CheckJob;
|
||||
use app\service\admin\install\InstallSystemService;
|
||||
use core\base\BaseAdminService;
|
||||
use core\exception\CommonException;
|
||||
use think\facade\Db;
|
||||
|
||||
/**
|
||||
@ -49,7 +47,7 @@ class SystemService extends BaseAdminService
|
||||
*/
|
||||
public function getUrl()
|
||||
{
|
||||
$site_tag = $this->site_id == 31 ? '' : '/s' . $this->site_id;
|
||||
$site_tag = $this->site_id == 1 ? '' : '/s' . $this->site_id;
|
||||
$data = [
|
||||
'wap_url' => ( !empty(env("system.wap_domain")) ? env("system.wap_domain") : request()->domain() ) . "/wap" . $site_tag,
|
||||
'web_url' => ( !empty(env("system.web_domain")) ? env("system.web_domain") : request()->domain() ) . "/web" . $site_tag,
|
||||
|
||||
@ -12,15 +12,11 @@
|
||||
namespace app\service\admin\user;
|
||||
|
||||
|
||||
use app\dict\site\SiteDict;
|
||||
use app\dict\sys\AppTypeDict;
|
||||
use app\model\sys\SysRole;
|
||||
use app\model\sys\SysUserRole;
|
||||
use app\service\admin\site\SiteService;
|
||||
use app\service\admin\sys\RoleService;
|
||||
use core\base\BaseAdminService;
|
||||
use core\exception\AdminException;
|
||||
use core\exception\AuthException;
|
||||
use think\facade\Cache;
|
||||
|
||||
/**
|
||||
|
||||
@ -14,7 +14,6 @@ namespace app\service\admin\wechat;
|
||||
use app\dict\notice\NoticeTypeDict;
|
||||
use app\service\admin\notice\NoticeService;
|
||||
use app\service\core\notice\CoreNoticeService;
|
||||
use app\service\core\wechat\CoreWechatTemplateService;
|
||||
use core\base\BaseAdminService;
|
||||
use core\exception\NoticeException;
|
||||
use core\template\TemplateLoader;
|
||||
|
||||
@ -62,10 +62,10 @@ class AuthService extends BaseApiService
|
||||
}
|
||||
/**
|
||||
* 绑定手机号
|
||||
* @param string|int $mobile
|
||||
* @param string $mobile
|
||||
* @return void
|
||||
*/
|
||||
public function bindMobile(string|int $mobile, string $mobile_code){
|
||||
public function bindMobile(string $mobile, string $mobile_code){
|
||||
|
||||
if(empty($mobile)){
|
||||
$result = (new CoreWeappAuthService())->getUserPhoneNumber($this->site_id, $mobile_code);
|
||||
|
||||
@ -97,10 +97,10 @@ class LoginService extends BaseApiService
|
||||
|
||||
/**
|
||||
* 手机号登录
|
||||
* @param string|int $mobile
|
||||
* @param string $mobile
|
||||
* @return array
|
||||
*/
|
||||
public function mobile(string|int $mobile){
|
||||
public function mobile(string $mobile){
|
||||
//校验手机验证码
|
||||
$this->checkMobileCode($mobile);
|
||||
//登录注册配置
|
||||
@ -212,7 +212,7 @@ class LoginService extends BaseApiService
|
||||
* @param $member_key
|
||||
* @return void
|
||||
*/
|
||||
public function checkMobileCode(string|int $mobile){
|
||||
public function checkMobileCode(string $mobile){
|
||||
if(empty($mobile)) throw new AuthException('MOBILE_NEEDED');
|
||||
$mobile_key = request()->param('mobile_key', '');
|
||||
$mobile_code = request()->param('mobile_code', '');
|
||||
@ -268,11 +268,11 @@ class LoginService extends BaseApiService
|
||||
|
||||
/**
|
||||
* 重置密码
|
||||
* @param string|int $mobile
|
||||
* @param int|string $password
|
||||
* @param string $mobile
|
||||
* @param string $password
|
||||
* @return null
|
||||
*/
|
||||
public function resetPassword(string|int $mobile, int|string $password){
|
||||
public function resetPassword(string $mobile, string $password){
|
||||
$member_service = new MemberService();
|
||||
//校验手机验证码
|
||||
$this->checkMobileCode($mobile);
|
||||
|
||||
@ -100,21 +100,22 @@ class RegisterService extends BaseApiService
|
||||
* @param string $password
|
||||
* @return void
|
||||
*/
|
||||
public function account(string $username, string $password, string|int $mobile){
|
||||
public function account(string $username, string $password, $mobile)
|
||||
{
|
||||
//todo 校验验证码 可以加try catch 后续
|
||||
(new CaptchaService())->check();
|
||||
( new CaptchaService() )->check();
|
||||
|
||||
//登录注册配置
|
||||
$config = (new MemberConfigService())->getLoginConfig();
|
||||
$is_username = $config['is_username'];
|
||||
$config = ( new MemberConfigService() )->getLoginConfig();
|
||||
$is_username = $config[ 'is_username' ];
|
||||
//未开启账号密码登录注册
|
||||
if($is_username != 1) throw new AuthException('MEMBER_USERNAME_LOGIN_NOT_OPEN');
|
||||
if ($is_username != 1) throw new AuthException('MEMBER_USERNAME_LOGIN_NOT_OPEN');
|
||||
$member_service = new MemberService();
|
||||
$member_info = $member_service->findMemberInfo(['username' => $username, 'site_id' => $this->site_id]);
|
||||
$member_info = $member_service->findMemberInfo([ 'username' => $username, 'site_id' => $this->site_id ]);
|
||||
if (!$member_info->isEmpty()) throw new AuthException('MEMBER_IS_EXIST');//账号已存在
|
||||
|
||||
$password_hash = create_password($password);
|
||||
$data = array(
|
||||
$data = array (
|
||||
'username' => $username,
|
||||
'password' => $password_hash,
|
||||
);
|
||||
@ -122,58 +123,56 @@ class RegisterService extends BaseApiService
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 手机号注册
|
||||
* @param $mobile
|
||||
* @return Member|array|mixed|\think\Model
|
||||
*/
|
||||
public
|
||||
function mobile($mobile)
|
||||
{
|
||||
//登录注册配置
|
||||
$config = ( new MemberConfigService() )->getLoginConfig();
|
||||
$is_mobile = $config[ 'is_mobile' ];
|
||||
//未开启账号密码登录注册
|
||||
if ($is_mobile != 1) throw new AuthException('MEMBER_USERNAME_LOGIN_NOT_OPEN');
|
||||
$member_service = new MemberService();
|
||||
$member_info = $member_service->findMemberInfo([ 'mobile' => $mobile, 'site_id' => $this->site_id ]);
|
||||
if (!$member_info->isEmpty()) throw new AuthException('MEMBER_IS_EXIST');//账号已存在
|
||||
/**
|
||||
* 手机号注册
|
||||
* @param $mobile
|
||||
* @return Member|array|mixed|\think\Model
|
||||
*/
|
||||
public function mobile($mobile)
|
||||
{
|
||||
//登录注册配置
|
||||
$config = ( new MemberConfigService() )->getLoginConfig();
|
||||
$is_mobile = $config[ 'is_mobile' ];
|
||||
//未开启账号密码登录注册
|
||||
if ($is_mobile != 1) throw new AuthException('MEMBER_USERNAME_LOGIN_NOT_OPEN');
|
||||
$member_service = new MemberService();
|
||||
$member_info = $member_service->findMemberInfo([ 'mobile' => $mobile, 'site_id' => $this->site_id ]);
|
||||
if (!$member_info->isEmpty()) throw new AuthException('MEMBER_IS_EXIST');//账号已存在
|
||||
|
||||
$data = array (
|
||||
'mobile' => $mobile,
|
||||
);
|
||||
$result = $this->register($mobile, $data, MemberRegisterTypeDict::MOBILE);
|
||||
return $result;
|
||||
}
|
||||
$data = array (
|
||||
'mobile' => $mobile,
|
||||
);
|
||||
$result = $this->register($mobile, $data, MemberRegisterTypeDict::MOBILE);
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验是否启用第三方登录注册
|
||||
* @return true
|
||||
*/
|
||||
public
|
||||
function checkAuth()
|
||||
{
|
||||
$config = ( new MemberConfigService() )->getLoginConfig();
|
||||
$is_auth_register = $config[ 'is_auth_register' ];
|
||||
if ($is_auth_register != 1) throw new AuthException('AUTH_LOGIN_NOT_OPEN');//手机号已存在
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* 校验是否启用第三方登录注册
|
||||
* @return true
|
||||
*/
|
||||
public function checkAuth()
|
||||
{
|
||||
$config = ( new MemberConfigService() )->getLoginConfig();
|
||||
$is_auth_register = $config[ 'is_auth_register' ];
|
||||
if ($is_auth_register != 1) throw new AuthException('AUTH_LOGIN_NOT_OPEN');//手机号已存在
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过手机号尝试绑定已存在会员,没有就绑定数据(todo 仅限注册使用)
|
||||
* @param string|int $mobile
|
||||
* @param array $data
|
||||
* @param string $type
|
||||
* @param bool $is_verify
|
||||
* @return array|mixed
|
||||
*/
|
||||
public
|
||||
function bindByMobile(string|int $mobile, array $data, string $type, bool $is_verify = true){
|
||||
$config = ( new MemberConfigService() )->getLoginConfig();
|
||||
$is_bind_mobile = $config[ 'is_bind_mobile' ];
|
||||
/**
|
||||
* 通过手机号尝试绑定已存在会员,没有就绑定数据(todo 仅限注册使用)
|
||||
* @param string $mobile
|
||||
* @param array $data
|
||||
* @param string $type
|
||||
* @param bool $is_verify
|
||||
* @return array|mixed
|
||||
*/
|
||||
public function bindByMobile($mobile, array $data, string $type, bool $is_verify = true)
|
||||
{
|
||||
$config = ( new MemberConfigService() )->getLoginConfig();
|
||||
$is_bind_mobile = $config[ 'is_bind_mobile' ];
|
||||
|
||||
$with_field = match($type){
|
||||
MemberLoginTypeDict::USERNAME => 'username',
|
||||
$with_field = match($type){
|
||||
MemberLoginTypeDict::USERNAME => 'username',
|
||||
MemberLoginTypeDict::MOBILE => 'mobile',
|
||||
MemberLoginTypeDict::WECHAT => 'wx_openid',
|
||||
MemberLoginTypeDict::WEAPP => 'weapp_openid',
|
||||
|
||||
@ -92,7 +92,7 @@ class MemberCashOutService extends BaseApiService
|
||||
'status' => MemberCashOutDict::CANCEL
|
||||
]
|
||||
);
|
||||
(new CoreMemberConfigService())->returnMember($this->site_id, $cash_out);
|
||||
(new CoreMemberCashOutService())->giveback($this->site_id, $cash_out);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -11,7 +11,6 @@
|
||||
|
||||
namespace app\service\api\notice;
|
||||
|
||||
use app\service\core\notice\CoreNoticeService;
|
||||
use core\base\BaseApiService;
|
||||
|
||||
/**
|
||||
|
||||
@ -109,11 +109,11 @@ class WeappAuthService extends BaseApiService
|
||||
/**
|
||||
* 注册
|
||||
* @param string|array $data
|
||||
* @param string|int $mobile
|
||||
* @param string $mobile
|
||||
* @return \app\model\member\Member|array|mixed|\think\Model
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
public function register(string $openid, string|int $mobile, string $mobile_code){
|
||||
public function register(string $openid, string $mobile, string $mobile_code){
|
||||
|
||||
if(empty($openid)) throw new AuthException('AUTH_LOGIN_TAG_NOT_EXIST');
|
||||
//todo openid可能还需要合法性验证
|
||||
|
||||
@ -146,7 +146,7 @@ class WechatAuthService extends BaseApiService
|
||||
* @return void
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
public function register(string $openid, string|int $mobile = '', string $nickname = '', string $avatar = '')
|
||||
public function register(string $openid, string $mobile = '', string $nickname = '', string $avatar = '')
|
||||
{
|
||||
$member_service = new MemberService();
|
||||
$member_info = $member_service->findMemberInfo(['wx_openid' => $openid, 'site_id' => $this->site_id]);
|
||||
|
||||
@ -135,6 +135,8 @@ trait WapTrait
|
||||
*/
|
||||
public function installPageCode($compile_path)
|
||||
{
|
||||
if (!file_exists($this->geAddonPackagePath($this->addon) . 'uni-app-pages.php')) return;
|
||||
|
||||
$uniapp_pages = require $this->geAddonPackagePath($this->addon) . 'uni-app-pages.php';
|
||||
|
||||
if (empty($uniapp_pages[ 'pages' ])) {
|
||||
@ -145,6 +147,7 @@ trait WapTrait
|
||||
|
||||
$content = @file_get_contents($compile_path . "pages.json");
|
||||
|
||||
|
||||
$page_begin = $addon . '_PAGE_BEGIN';
|
||||
$page_end = $addon . '_PAGE_END';
|
||||
|
||||
@ -182,6 +185,8 @@ trait WapTrait
|
||||
*/
|
||||
public function uninstallPageCode($compile_path)
|
||||
{
|
||||
if (!file_exists($this->geAddonPackagePath($this->addon) . 'uni-app-pages.php')) return;
|
||||
|
||||
$uniapp_pages = require $this->geAddonPackagePath($this->addon) . 'uni-app-pages.php';
|
||||
|
||||
if (empty($uniapp_pages[ 'pages' ])) {
|
||||
|
||||
@ -105,7 +105,7 @@ class CoreMemberCashOutService extends BaseCoreService
|
||||
'status' => MemberCashOutDict::REFUSE,
|
||||
'refuse_reason' => $data['refuse_reason']
|
||||
]);
|
||||
$this->returnMember($site_id, $cash_out);
|
||||
$this->giveback($site_id, $cash_out);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -264,7 +264,7 @@ class CoreMemberCashOutService extends BaseCoreService
|
||||
* @param MemberCashOut $cash_out
|
||||
* @return true
|
||||
*/
|
||||
public function returnMember(int $site_id, MemberCashOut $cash_out){
|
||||
public function giveback(int $site_id, MemberCashOut $cash_out){
|
||||
$core_member_account_service = new CoreMemberAccountService();
|
||||
|
||||
$core_member_account_service->addLog($site_id, $cash_out->member_id, $cash_out->account_type, $cash_out->apply_money, 'cash_out', get_lang('CASHOUT_IS_REFUSE'), $cash_out->id);
|
||||
|
||||
@ -60,7 +60,7 @@ class CorePayChannelService extends BaseCoreService
|
||||
$allow_pay_type_list[] = $pay_type_list[$v['type']];
|
||||
}
|
||||
}
|
||||
return $allow_pay_type ?? [];
|
||||
return $allow_pay_type_list ?? [];
|
||||
|
||||
}
|
||||
|
||||
@ -73,7 +73,12 @@ class CorePayChannelService extends BaseCoreService
|
||||
*/
|
||||
public function getConfigByChannelAndType(int $site_id, string $channel, string $type){
|
||||
$pay_channel = $this->model->where([['site_id', '=', $site_id], ['channel', '=', $channel], ['type', '=', $type]])->field('config')->findOrEmpty();
|
||||
if(!$pay_channel->isEmpty()) return $pay_channel->config;
|
||||
if(!$pay_channel->isEmpty()){
|
||||
if($type == PayDict::WECHATPAY){
|
||||
$pay_channel->config = array_merge($pay_channel->config, (new CorePayConfigService())->getWechatPayFullConfig($site_id));
|
||||
}
|
||||
return $pay_channel->config;
|
||||
}
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@ -39,7 +39,7 @@ class CorePayService extends BaseCoreService
|
||||
/**
|
||||
* 创建支付单据
|
||||
* @param $site_id
|
||||
* @param string|int $main
|
||||
* @param string $main
|
||||
* @param float $money
|
||||
* @param string $trade_type
|
||||
* @param string $body
|
||||
@ -115,7 +115,7 @@ class CorePayService extends BaseCoreService
|
||||
if(!in_array($type, $allow_type)){
|
||||
throw new PayException('PAYMENT_METHOD_NOT_SUPPORT');//业务不支持
|
||||
}
|
||||
if(!in_array($type, array_keys((new CorePayChannelService())->getAllowPayTypeByCahnnel($site_id, $channel)))) throw new PayException('PAYMENT_METHOD_NOT_SCENE');//场景不支持
|
||||
if(!in_array($type, array_column((new CorePayChannelService())->getAllowPayTypeByCahnnel($site_id, $channel), 'key'))) throw new PayException('PAYMENT_METHOD_NOT_SCENE');//场景不支持
|
||||
$pay_result = $this->pay_event->init($site_id, $channel, $type)->pay($out_trade_no, $money, $body, $return_url, $quit_url, $buyer_id, $openid ?? '');
|
||||
//todo 特殊支付方式会直接返回支付状态,状态如果为已支付会直接支付
|
||||
if(!empty($pay_result['status']) && $pay_result['status'] == PayDict::STATUS_ED){
|
||||
|
||||
@ -11,8 +11,6 @@
|
||||
|
||||
namespace core\base;
|
||||
|
||||
use app\model\system\Cron;
|
||||
use app\service\core\schedule\CoreCronService;
|
||||
use core\job\Dispatch;
|
||||
use think\queue\Job;
|
||||
|
||||
|
||||
@ -14,6 +14,7 @@ namespace core\dict;
|
||||
use core\loader\Storage;
|
||||
use think\facade\Cache;
|
||||
use think\facade\Db;
|
||||
use think\facade\Log;
|
||||
|
||||
/**
|
||||
* Class BaseAddon
|
||||
@ -46,7 +47,15 @@ abstract class BaseDict extends Storage
|
||||
if(empty($addons))
|
||||
{
|
||||
$addons = Db::name("addon")->column("key");
|
||||
Cache::set("local_install_addons", $addons);
|
||||
if(empty($addons))
|
||||
{
|
||||
Cache::set("local_install_addons", -1);
|
||||
}else
|
||||
Cache::set("local_install_addons", $addons);
|
||||
}
|
||||
if($addons == -1)
|
||||
{
|
||||
$addons = [];
|
||||
}
|
||||
return $addons;
|
||||
}
|
||||
|
||||
@ -178,7 +178,7 @@ class Alipay extends BasePay
|
||||
* @param $out_trade_no
|
||||
* @return void
|
||||
*/
|
||||
public function close(string|int $out_trade_no){
|
||||
public function close(string $out_trade_no){
|
||||
$result = $this->returnFormat(Pay::alipay()->close([
|
||||
'out_trade_no' => $out_trade_no,
|
||||
]));
|
||||
|
||||
@ -240,7 +240,7 @@ class Wechatpay extends BasePay
|
||||
* @param $out_trade_no
|
||||
* @return void
|
||||
*/
|
||||
public function close(string|int $out_trade_no){
|
||||
public function close(string $out_trade_no){
|
||||
$result = Pay::wechat()->close([
|
||||
'out_trade_no' => $out_trade_no,
|
||||
]);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user