This commit is contained in:
全栈小学生 2024-11-22 15:08:42 +08:00
parent 154a6b5e02
commit ad6298a9a9
53 changed files with 914 additions and 274 deletions

View File

@ -25,16 +25,16 @@ class AddonDevelop extends BaseAdminController
public function lists() public function lists()
{ {
$data = $this->request->params([ $data = $this->request->params([
['search', ''] [ 'search', '' ]
]); ]);
return success((new AddonDevelopService())->getList($data['search'])); return success(( new AddonDevelopService() )->getList($data[ 'search' ]));
} }
public function info($key) public function info($key)
{ {
return success((new AddonDevelopService())->getInfo($key)); return success(( new AddonDevelopService() )->getInfo($key));
} }
/** /**
* 开发插件新增 * 开发插件新增
* @return Response * @return Response
@ -42,19 +42,19 @@ class AddonDevelop extends BaseAdminController
public function add(string $key) public function add(string $key)
{ {
$data = $this->request->params([ $data = $this->request->params([
['title', ''], [ 'title', '' ],
['desc', ''], [ 'desc', '' ],
['icon', ''], [ 'icon', '' ],
['cover', ''], [ 'cover', '' ],
['key', ''], [ 'key', '' ],
['author', ''], [ 'author', '' ],
['version', ''], [ 'version', '' ],
['type', ''], [ 'type', '' ],
['support_app', ''], [ 'support_app', '' ],
], false); ], false);
$data['key'] = $key; $data[ 'key' ] = $key;
$this->validate($data, 'app\validate\addon\AddonDevelop.add'); $this->validate($data, 'app\validate\addon\AddonDevelop.add');
(new AddonDevelopService())->add($key, $data); ( new AddonDevelopService() )->add($key, $data);
return success('ADD_SUCCESS'); return success('ADD_SUCCESS');
} }
@ -66,19 +66,19 @@ class AddonDevelop extends BaseAdminController
public function edit(string $key) public function edit(string $key)
{ {
$data = $this->request->params([ $data = $this->request->params([
['title', ''], [ 'title', '' ],
['desc', ''], [ 'desc', '' ],
['icon', ''], [ 'icon', '' ],
['cover', ''], [ 'cover', '' ],
['key', ''], [ 'key', '' ],
['author', ''], [ 'author', '' ],
['version', ''], [ 'version', '' ],
['type', ''], [ 'type', '' ],
['support_app', ''], [ 'support_app', '' ],
], false); ], false);
$data['key'] = $key; $data[ 'key' ] = $key;
$this->validate($data, 'app\validate\addon\AddonDevelop.edit'); $this->validate($data, 'app\validate\addon\AddonDevelop.edit');
(new AddonDevelopService())->edit($key, $data); ( new AddonDevelopService() )->edit($key, $data);
return success('EDIT_SUCCESS'); return success('EDIT_SUCCESS');
} }
@ -90,7 +90,7 @@ class AddonDevelop extends BaseAdminController
*/ */
public function del(string $key) public function del(string $key)
{ {
(new AddonDevelopService())->del($key); ( new AddonDevelopService() )->del($key);
return success('DELETE_SUCCESS'); return success('DELETE_SUCCESS');
} }
@ -99,8 +99,9 @@ class AddonDevelop extends BaseAdminController
* @param $key * @param $key
* @return void * @return void
*/ */
public function checkKey($key){ public function checkKey($key)
return success(data:(new AddonDevelopService())->checkKey($key)); {
return success(data:( new AddonDevelopService() )->checkKey($key));
} }
/** /**
@ -108,8 +109,9 @@ class AddonDevelop extends BaseAdminController
* @param $key * @param $key
* @return Response * @return Response
*/ */
public function build($key){ public function build($key)
(new AddonDevelopService())->build($key); {
( new AddonDevelopService() )->build($key);
return success(); return success();
} }
@ -118,16 +120,18 @@ class AddonDevelop extends BaseAdminController
* @param $key * @param $key
* @return Response * @return Response
*/ */
public function download($key){ public function download($key)
{
return success(data:(new AddonDevelopService())->download($key)); return success(data:( new AddonDevelopService() )->download($key));
} }
/** /**
* *
* @return Response * @return Response
*/ */
public function keyBlackList() { public function keyBlackList()
{
return success(AddonDict::ADDON_KEY_BLACK_LIST); return success(AddonDict::ADDON_KEY_BLACK_LIST);
} }
} }

View File

@ -22,8 +22,9 @@ class Upgrade extends BaseAdminController
* @param $app_key * @param $app_key
* @return Response * @return Response
*/ */
public function upgrade($addon = ''){ public function upgrade($addon = '')
return success(data:(new UpgradeService())->upgrade($addon)); {
return success(data:( new UpgradeService() )->upgrade($addon));
} }
/** /**
@ -31,8 +32,9 @@ class Upgrade extends BaseAdminController
* @param $app_key * @param $app_key
* @return Response * @return Response
*/ */
public function execute($addon = ''){ public function execute($addon = '')
return success(data:(new UpgradeService())->execute()); {
return success(data:( new UpgradeService() )->execute());
} }
/** /**
@ -40,16 +42,18 @@ class Upgrade extends BaseAdminController
* @param $addon * @param $addon
* @return Response * @return Response
*/ */
public function getUpgradeContent($addon = '') { public function getUpgradeContent($addon = '')
return success(data:(new UpgradeService())->getUpgradeContent($addon)); {
return success(data:( new UpgradeService() )->getUpgradeContent($addon));
} }
/** /**
* 获取正在进行的升级任务 * 获取正在进行的升级任务
* @return Response * @return Response
*/ */
public function getUpgradeTask() { public function getUpgradeTask()
return success(data:(new UpgradeService())->getUpgradeTask()); {
return success(data:( new UpgradeService() )->getUpgradeTask());
} }
/** /**
@ -57,15 +61,17 @@ class Upgrade extends BaseAdminController
* @param $addon * @param $addon
* @return Response * @return Response
*/ */
public function upgradePreCheck($addon = '') { public function upgradePreCheck($addon = '')
return success(data:(new UpgradeService())->upgradePreCheck($addon)); {
return success(data:( new UpgradeService() )->upgradePreCheck($addon));
} }
/** /**
* 清除 * 清除
* @return Response * @return Response
*/ */
public function clearUpgradeTask() { public function clearUpgradeTask()
return success(data:(new UpgradeService())->clearUpgradeTask()); {
return success(data:( new UpgradeService() )->clearUpgradeTask());
} }
} }

View File

@ -26,13 +26,13 @@ class Account extends BaseAdminController
public function point() public function point()
{ {
$data = $this->request->params([ $data = $this->request->params([
['member_id', ''], [ 'member_id', '' ],
['from_type', ''], [ 'from_type', '' ],
['create_time', []], [ 'create_time', [] ],
['keywords', ''], [ 'keywords', '' ],
]); ]);
$data['account_type'] = 'point'; $data[ 'account_type' ] = 'point';
return success((new MemberAccountService())->getPage($data)); return success(( new MemberAccountService() )->getPage($data));
} }
/** /**
@ -41,22 +41,22 @@ class Account extends BaseAdminController
public function sumPoint() public function sumPoint()
{ {
$data = $this->request->params([ $data = $this->request->params([
['member_id', ''], [ 'member_id', '' ],
]); ]);
$member_account_service = new MemberAccountService(); $member_account_service = new MemberAccountService();
$member_service = new MemberService(); $member_service = new MemberService();
if (empty($data['member_id'])) { if (empty($data[ 'member_id' ])) {
$commission_data = [ $commission_data = [
'point_get' => $member_service->getSum('point_get'),//累计 'point_get' => $member_service->getSum('point_get'),//累计
'point_use' => abs($member_account_service->getExpensesSumAccount(MemberAccountTypeDict::POINT)), 'point_use' => abs($member_account_service->getExpensesSumAccount(MemberAccountTypeDict::POINT)),
]; ];
return success($commission_data); return success($commission_data);
} else { } else {
$info = $member_account_service->getMemberAccountInfo($data['member_id']); $info = $member_account_service->getMemberAccountInfo($data[ 'member_id' ]);
$commission_data = [ $commission_data = [
'point_get' => $info['point_get'], 'point_get' => $info[ 'point_get' ],
'point_use' => abs($member_account_service->getExpensesSumAccount(MemberAccountTypeDict::POINT, $data['member_id'])), 'point_use' => abs($member_account_service->getExpensesSumAccount(MemberAccountTypeDict::POINT, $data[ 'member_id' ])),
]; ];
return success($commission_data); return success($commission_data);
} }
@ -69,13 +69,13 @@ class Account extends BaseAdminController
public function balance() public function balance()
{ {
$data = $this->request->params([ $data = $this->request->params([
['member_id', ''], [ 'member_id', '' ],
['from_type', ''], [ 'from_type', '' ],
['create_time', []], [ 'create_time', [] ],
['keywords', ''], [ 'keywords', '' ],
]); ]);
$data['account_type'] = 'balance'; $data[ 'account_type' ] = 'balance';
return success((new MemberAccountService())->getPage($data)); return success(( new MemberAccountService() )->getPage($data));
} }
/** /**
@ -85,28 +85,29 @@ class Account extends BaseAdminController
public function money() public function money()
{ {
$data = $this->request->params([ $data = $this->request->params([
['member_id', ''], [ 'member_id', '' ],
['from_type', ''], [ 'from_type', '' ],
['create_time', []], [ 'create_time', [] ],
['keywords', ''], [ 'keywords', '' ],
]); ]);
$data['account_type'] = 'money'; $data[ 'account_type' ] = 'money';
return success((new MemberAccountService())->getPage($data)); return success(( new MemberAccountService() )->getPage($data));
} }
/** /**
* 查询成长值 * 查询成长值
* @return Response * @return Response
*/ */
public function growth() { public function growth()
{
$data = $this->request->params([ $data = $this->request->params([
['member_id', ''], [ 'member_id', '' ],
['from_type', ''], [ 'from_type', '' ],
['create_time', []], [ 'create_time', [] ],
['keywords', ''], [ 'keywords', '' ],
]); ]);
$data['account_type'] = 'growth'; $data[ 'account_type' ] = 'growth';
return success((new MemberAccountService())->getPage($data)); return success(( new MemberAccountService() )->getPage($data));
} }
/** /**
@ -115,12 +116,12 @@ class Account extends BaseAdminController
public function adjustPoint() public function adjustPoint()
{ {
$data = $this->request->params([ $data = $this->request->params([
['member_id', ''], [ 'member_id', '' ],
['account_data', 0], [ 'account_data', 0 ],
['memo', ''], [ 'memo', '' ],
]); ]);
$res = (new MemberAccountService())->adjustPoint($data); $res = ( new MemberAccountService() )->adjustPoint($data);
return success('SUCCESS', ['id' => $res]); return success('SUCCESS', [ 'id' => $res ]);
} }
/** /**
@ -129,12 +130,12 @@ class Account extends BaseAdminController
public function adjustBalance() public function adjustBalance()
{ {
$data = $this->request->params([ $data = $this->request->params([
['member_id', ''], [ 'member_id', '' ],
['account_data', 0], [ 'account_data', 0 ],
['memo', ''], [ 'memo', '' ],
]); ]);
$res = (new MemberAccountService())->adjustBalance($data); $res = ( new MemberAccountService() )->adjustBalance($data);
return success('SUCCESS', ['id' => $res]); return success('SUCCESS', [ 'id' => $res ]);
} }
/** /**
@ -144,12 +145,12 @@ class Account extends BaseAdminController
public function adjustMoney() public function adjustMoney()
{ {
$data = $this->request->params([ $data = $this->request->params([
['member_id', ''], [ 'member_id', '' ],
['account_data', 0], [ 'account_data', 0 ],
['memo', ''], [ 'memo', '' ],
]); ]);
$res = (new MemberAccountService())->adjustMoney($data); $res = ( new MemberAccountService() )->adjustMoney($data);
return success('SUCCESS', ['id' => $res]); return success('SUCCESS', [ 'id' => $res ]);
} }
/** /**
@ -159,13 +160,13 @@ class Account extends BaseAdminController
public function commission() public function commission()
{ {
$data = $this->request->params([ $data = $this->request->params([
['member_id', ''], [ 'member_id', '' ],
['from_type', ''], [ 'from_type', '' ],
['create_time', []], [ 'create_time', [] ],
['keywords', ''], [ 'keywords', '' ],
]); ]);
$data['account_type'] = 'commission'; $data[ 'account_type' ] = 'commission';
return success((new MemberAccountService())->getPage($data)); return success(( new MemberAccountService() )->getPage($data));
} }
/** /**
@ -174,12 +175,12 @@ class Account extends BaseAdminController
public function sumCommission() public function sumCommission()
{ {
$data = $this->request->params([ $data = $this->request->params([
['member_id', ''], [ 'member_id', '' ],
]); ]);
$member_account_service = new MemberAccountService(); $member_account_service = new MemberAccountService();
$member_service = new MemberService(); $member_service = new MemberService();
if (empty($data['member_id'])) { if (empty($data[ 'member_id' ])) {
$commission_data = [ $commission_data = [
'total_commission' => $member_service->getSum('commission_get'),//累计 'total_commission' => $member_service->getSum('commission_get'),//累计
'commission' => $member_service->getSum('commission'),//未提现 'commission' => $member_service->getSum('commission'),//未提现
@ -188,12 +189,12 @@ class Account extends BaseAdminController
]; ];
return success($commission_data); return success($commission_data);
} else { } else {
$info = $member_account_service->getMemberAccountInfo($data['member_id']); $info = $member_account_service->getMemberAccountInfo($data[ 'member_id' ]);
$commission_data = [ $commission_data = [
'commission' => $info['commission'], 'commission' => $info[ 'commission' ],
'commission_cash_outing' => $info['commission_cash_outing'], 'commission_cash_outing' => $info[ 'commission_cash_outing' ],
'withdrawn_commission' => $member_account_service->getWithdrawnCommission($data['member_id']),//已提现 'withdrawn_commission' => $member_account_service->getWithdrawnCommission($data[ 'member_id' ]),//已提现
'total_commission' => $info['commission_get'], 'total_commission' => $info[ 'commission_get' ],
]; ];
return success($commission_data); return success($commission_data);
} }
@ -205,10 +206,10 @@ class Account extends BaseAdminController
public function sumBalance() public function sumBalance()
{ {
$data = $this->request->params([ $data = $this->request->params([
['member_id', ''], [ 'member_id', '' ],
]); ]);
$member_account_service = new MemberAccountService(); $member_account_service = new MemberAccountService();
if (empty($data['member_id'])) { if (empty($data[ 'member_id' ])) {
$balance_data = [ $balance_data = [
MemberAccountTypeDict::BALANCE => number_format($member_account_service->getSumAccount(MemberAccountTypeDict::BALANCE), 2, '.', ''), MemberAccountTypeDict::BALANCE => number_format($member_account_service->getSumAccount(MemberAccountTypeDict::BALANCE), 2, '.', ''),
@ -216,7 +217,7 @@ class Account extends BaseAdminController
]; ];
return success($balance_data); return success($balance_data);
} else { } else {
return success($member_account_service->getMemberAccountInfo($data['member_id'])); return success($member_account_service->getMemberAccountInfo($data[ 'member_id' ]));
} }
} }
@ -227,7 +228,7 @@ class Account extends BaseAdminController
*/ */
public function changeType(string $account_type) public function changeType(string $account_type)
{ {
$res = (new MemberAccountService())->getFromType($account_type); $res = ( new MemberAccountService() )->getFromType($account_type);
return success($res); return success($res);
} }
@ -239,5 +240,4 @@ class Account extends BaseAdminController
return success(MemberAccountTypeDict::getType()); return success(MemberAccountTypeDict::getType());
} }
} }

View File

@ -37,6 +37,7 @@ class Config extends BaseAdminController
[ 'is_username', 1 ], [ 'is_username', 1 ],
[ 'is_mobile', 0 ], [ 'is_mobile', 0 ],
[ 'is_auth_register', 1 ], [ 'is_auth_register', 1 ],
[ 'is_force_access_user_info', 0 ],
[ 'is_bind_mobile', 0 ], [ 'is_bind_mobile', 0 ],
[ 'agreement_show', 0 ], [ 'agreement_show', 0 ],
[ 'bg_url', '' ], [ 'bg_url', '' ],

View File

@ -32,18 +32,6 @@ class MemberLevel extends BaseAdminController
return success(( new MemberLevelService() )->getPage($data)); return success(( new MemberLevelService() )->getPage($data));
} }
/**
* 会员等级列表
* @return Response
*/
public function lists()
{
$data = $this->request->params([
[ 'level_name', '' ],
]);
return success(( new MemberLevelService() )->getList($data));
}
/** /**
* 会员等级详情 * 会员等级详情
* @param int $id * @param int $id

View File

@ -1,6 +1,6 @@
<?php <?php
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Niucloud-admin 企业快速开发的多应用管理平台 // | Niucloud-admin 企业快速开发的saas管理平台
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | 官方网址https://www.niucloud.com // | 官方网址https://www.niucloud.com
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
@ -36,4 +36,30 @@ class ScheduleLog extends BaseAdminController
} }
/**
* 删除计划任务执行记录
* @return Response
*/
public function del()
{
$data = $this->request->params([
[ 'ids', '' ],
]);
(new ScheduleLogService())->del($data[ 'ids' ]);
return success('DELETE_SUCCESS');
}
/**
* 清空计划任务执行记录
* @return Response
*/
public function clear()
{
$data = $this->request->params([
[ 'schedule_id', '' ],
]);
(new ScheduleLogService())->clear($data);
return success('SUCCESS');
}
} }

View File

@ -34,8 +34,8 @@ class Reply extends BaseAdminController
public function getKeywordLists() public function getKeywordLists()
{ {
$data = $this->request->params([ $data = $this->request->params([
['keyword', ''], [ 'keyword', '' ],
['name', ''] [ 'name', '' ]
]); ]);
$wechat_reply_service = new WechatReplyService(); $wechat_reply_service = new WechatReplyService();
return success($wechat_reply_service->getKeywordPage($data)); return success($wechat_reply_service->getKeywordPage($data));
@ -49,12 +49,12 @@ class Reply extends BaseAdminController
{ {
$wechat_reply_service = new WechatReplyService(); $wechat_reply_service = new WechatReplyService();
$data = $this->request->params([ $data = $this->request->params([
['name', ''], [ 'name', '' ],
['keyword', ''], [ 'keyword', '' ],
['matching_type', '', false], [ 'matching_type', '', false ],
['reply_method', ''], [ 'reply_method', '' ],
['content', ''], [ 'content', '' ],
['sort', ''], [ 'sort', '' ],
]); ]);
$wechat_reply_service->addKeyword($data); $wechat_reply_service->addKeyword($data);
return success('ADD_SUCCESS'); return success('ADD_SUCCESS');
@ -68,12 +68,12 @@ class Reply extends BaseAdminController
{ {
$wechat_reply_service = new WechatReplyService(); $wechat_reply_service = new WechatReplyService();
$data = $this->request->params([ $data = $this->request->params([
['name', ''], [ 'name', '' ],
['keyword', ''], [ 'keyword', '' ],
['matching_type', '', false], [ 'matching_type', '', false ],
['reply_method', ''], [ 'reply_method', '' ],
['content', ''], [ 'content', '' ],
['sort', ''], [ 'sort', '' ],
]); ]);
$wechat_reply_service->editKeyword($id, $data); $wechat_reply_service->editKeyword($id, $data);
return success('EDIT_SUCCESS'); return success('EDIT_SUCCESS');
@ -107,7 +107,7 @@ class Reply extends BaseAdminController
public function editDefault() public function editDefault()
{ {
$data = $this->request->params([ $data = $this->request->params([
['content', ''], [ 'content', '' ],
]); ]);
$wechat_reply_service = new WechatReplyService(); $wechat_reply_service = new WechatReplyService();
$wechat_reply_service->editDefault($data); $wechat_reply_service->editDefault($data);
@ -131,12 +131,11 @@ class Reply extends BaseAdminController
public function editSubscribe() public function editSubscribe()
{ {
$data = $this->request->params([ $data = $this->request->params([
['content', ''], [ 'content', '' ],
]); ]);
$wechat_reply_service = new WechatReplyService(); $wechat_reply_service = new WechatReplyService();
$wechat_reply_service->editSubscribe($data); $wechat_reply_service->editSubscribe($data);
return success('SET_SUCCESS'); return success('SET_SUCCESS');
} }
} }

View File

@ -28,10 +28,10 @@ class Template extends BaseAdminController
public function sync() public function sync()
{ {
$data = $this->request->params([ $data = $this->request->params([
['keys', []] [ 'keys', [] ]
]); ]);
$wechat_template_service = new WechatTemplateService(); $wechat_template_service = new WechatTemplateService();
return success(data:$wechat_template_service->syncAll($data['keys'])); return success(data:$wechat_template_service->syncAll($data[ 'keys' ]));
} }
/** /**
@ -44,5 +44,4 @@ class Template extends BaseAdminController
return success($wechat_template_service->getList()); return success($wechat_template_service->getList());
} }
} }

View File

@ -131,8 +131,6 @@ Route::group('member', function() {
/***************************************************** 会员等级 ****************************************************/ /***************************************************** 会员等级 ****************************************************/
//会员等级分页列表 //会员等级分页列表
Route::get('level', 'member.MemberLevel/pages'); Route::get('level', 'member.MemberLevel/pages');
//会员等级列表
Route::get('level/list', 'member.MemberLevel/lists');
//会员等级详情 //会员等级详情
Route::get('level/:id', 'member.MemberLevel/info'); Route::get('level/:id', 'member.MemberLevel/info');
//会员等级添加 //会员等级添加

View File

@ -191,6 +191,10 @@ Route::group('sys', function() {
//任务执行记录列表 //任务执行记录列表
Route::get('schedule/log/list', 'sys.ScheduleLog/lists'); Route::get('schedule/log/list', 'sys.ScheduleLog/lists');
//删除执行记录
Route::put('schedule/log/delete', 'sys.ScheduleLog/del');
//清空执行记录
Route::put('schedule/log/clear', 'sys.ScheduleLog/clear');
/***************************************************** 应用管理 ****************************************************/ /***************************************************** 应用管理 ****************************************************/
Route::get('applist', 'sys.App/getAppList'); Route::get('applist', 'sys.App/getAppList');

View File

@ -23,9 +23,10 @@ class Config extends BaseController
*/ */
public function getLoginConfig() public function getLoginConfig()
{ {
$data = $this->request->params([
return success((new MemberConfigService())->getLoginConfig()); [ 'url', '' ],
]);
return success(( new MemberConfigService() )->getLoginConfig($data[ 'url' ]));
} }
} }

View File

@ -14,7 +14,10 @@ namespace app\api\controller\sys;
use app\service\api\diy\DiyConfigService; use app\service\api\diy\DiyConfigService;
use app\service\api\member\MemberConfigService; use app\service\api\member\MemberConfigService;
use app\service\api\member\MemberLevelService; 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\sys\ConfigService;
use app\service\api\wechat\WechatAuthService;
use core\base\BaseApiController; use core\base\BaseApiController;
use think\Response; use think\Response;
@ -75,13 +78,18 @@ class Config extends BaseApiController
*/ */
public function init() public function init()
{ {
$data = $this->request->params([
[ 'url', '' ],
]);
$res = []; $res = [];
$res[ 'tabbar_list' ] = ( new DiyConfigService() )->getBottomList(); $res[ 'tabbar_list' ] = ( new DiyConfigService() )->getBottomList();
$res[ 'map_config' ] = ( new ConfigService() )->getMap(); $res[ 'map_config' ] = ( new ConfigService() )->getMap();
$res[ 'site_info' ] = ( new ConfigService() )->getWebSite(); $res[ 'site_info' ] = ( new ConfigService() )->getWebSite();
$res[ 'member_level' ] = ( new MemberLevelService() )->getList(); $res[ 'member_level' ] = ( new MemberLevelService() )->getList();
$res[ 'login_config' ] = ( new MemberConfigService() )->getLoginConfig(); $res[ 'login_config' ] = ( new MemberConfigService() )->getLoginConfig($data[ 'url' ]);
( new MemberService() )->initMemberData();
return success($res); return success($res);
} }
} }

View File

@ -224,6 +224,21 @@ function get_start_and_end_time_by_day($day = '')
return [ $day_start_time, $day_end_time ]; return [ $day_start_time, $day_end_time ];
} }
/**
* 获取本周的 开始、结束时间
* @param data 日期
*/
function get_weekinfo_by_time($date)
{
$idx = strftime("%u", strtotime($date));
$mon_idx = $idx - 1;
$sun_idx = $idx - 7;
return array(
'week_start_day' => strftime('%Y-%m-%d', strtotime($date) - $mon_idx * 86400),
'week_end_day' => strftime('%Y-%m-%d', strtotime($date) - $sun_idx * 86400),
);
}
/** /**
* 路径转链接 * 路径转链接
* @param $path * @param $path

View File

@ -190,6 +190,20 @@ class ComponentDict
] ]
] ]
], ],
// 轮播图设置
'swiper' => [
'indicatorColor' => 'rgba(0, 0, 0, 0.3)', // 未选中颜色
"indicatorActiveColor" => '#FF0E0E',
'indicatorStyle' => 'style-1',
'indicatorAlign' => 'center'
],
'template' => [
"margin" => [
"top" => 10, // 上边距
"bottom" => 10, // 下边距
"both" => 0 // 左右边距
],
],
] ]
], ],
'RubikCube' => [ 'RubikCube' => [
@ -261,7 +275,28 @@ class ComponentDict
'value' => [ 'value' => [
"style" => "style-1", "style" => "style-1",
"styleName" => "风格1" "styleName" => "风格1"
], ],// 组件属性
'template' => [
"textColor" => "#303133", // 文字颜色
'pageStartBgColor' => '', // 底部背景颜色(开始)
'pageEndBgColor' => '', // 底部背景颜色(结束)
'pageGradientAngle' => 'to bottom', // 渐变角度从上到下to bottom、从左到右to right
'componentBgUrl' => '', // 组件背景图片
'componentBgAlpha' => 2, // 组件背景图片的透明度0~10
"componentStartBgColor" => '', // 组件背景颜色(开始)
"componentEndBgColor" => '', // 组件背景颜色(结束)
"componentGradientAngle" => 'to bottom', // 渐变角度上下to bottom、左右to right
"topRounded" => 12, // 组件上圆角
"bottomRounded" => 0, // 组件下圆角
"elementBgColor" => '', // 元素背景颜色
"topElementRounded" => 0,// 元素上圆角
"bottomElementRounded" => 0, // 元素下圆角
"margin" => [
"top" => 0, // 上边距
"bottom" => 0, // 下边距
"both" => 10 // 左右边距
]
]
], ],
'Notice' => [ 'Notice' => [
'title' => '公告', 'title' => '公告',
@ -314,6 +349,7 @@ class ComponentDict
'value' => 'style-1' 'value' => 'style-1'
], ],
'text' => '超值爆款', 'text' => '超值爆款',
'textImg' => 'static/resource/images/diy/active_cube/active_cube_text1.png',
"textLink" => [ "textLink" => [
"name" => "" "name" => ""
], ],
@ -330,7 +366,8 @@ class ComponentDict
"blockStyle" => [ "blockStyle" => [
'title' => '风格1', 'title' => '风格1',
'value' => 'style-1', 'value' => 'style-1',
'fontWeight' => 'normal' 'fontWeight' => 'normal',
'btnText' => 'normal'
], ],
'list' => [ 'list' => [
[ [
@ -350,8 +387,8 @@ class ComponentDict
"endColor" => "#FE1E00", "endColor" => "#FE1E00",
], ],
"listFrame" => [ "listFrame" => [
"startColor" => "#FEA715", "startColor" => "#FFFAF5",
"endColor" => "#FE1E00", "endColor" => "#FFFFFF"
], ],
"link" => [ "link" => [
"name" => "" "name" => ""
@ -375,8 +412,8 @@ class ComponentDict
"endColor" => "#FF9E03", "endColor" => "#FF9E03",
], ],
"listFrame" => [ "listFrame" => [
"startColor" => "#FFBF50", "startColor" => "#FFFAF5",
"endColor" => "#FF9E03", "endColor" => "#FFFFFF"
], ],
"link" => [ "link" => [
"name" => "" "name" => ""
@ -400,8 +437,8 @@ class ComponentDict
"endColor" => "#49CD2D", "endColor" => "#49CD2D",
], ],
"listFrame" => [ "listFrame" => [
"startColor" => "#A2E792", "startColor" => "#FFFAF5",
"endColor" => "#49CD2D", "endColor" => "#FFFFFF"
], ],
"link" => [ "link" => [
"name" => "" "name" => ""
@ -425,8 +462,8 @@ class ComponentDict
"endColor" => "#1D7CFF", "endColor" => "#1D7CFF",
], ],
"listFrame" => [ "listFrame" => [
"startColor" => "#4AC1FF", "startColor" => "#FFFAF5",
"endColor" => "#1D7CFF", "endColor" => "#FFFFFF"
], ],
"link" => [ "link" => [
"name" => "" "name" => ""
@ -474,13 +511,26 @@ class ComponentDict
'search' => [ 'search' => [
'logo' => '', 'logo' => '',
'text' => '请输入搜索关键词', 'text' => '请输入搜索关键词',
"link" => [ 'link' => [
"name" => "" 'name' => ''
], ],
'style' => 'style-1',
'styleName' => '风格一',
"subTitle" => [
"text" => "本地好价·优选生活",
"textColor" => "#000000",
"startColor" => "rgba(255,255,255,0.7)",
"endColor" => "",
],
'positionColor' => '#ffffff',
'hotWord' => [ 'hotWord' => [
"interval" => 3, "interval" => 3,
'list' => [] 'list' => []
] ],
'color' => '#999999',
'btnColor' => '#ffffff',
'bgColor' => '#ffffff',
'btnBgColor' => '#ff3434'
], ],
// 选项卡设置 // 选项卡设置
'tab' => [ 'tab' => [
@ -590,7 +640,115 @@ class ComponentDict
'borderStyle' => 'solid' 'borderStyle' => 'solid'
], ],
], ],
'PictureShow' => [
'title' => '图片展播',
'icon' => 'iconfont icona-tupianzhanbopc302',
'path' => 'edit-picture-show',
'support_page' => [],
'uses' => 0,
'sort' => 10017,
'value' => [
'moduleOne' => [
'head' => [
"textImg" => "static/resource/images/diy/picture_show/picture_show_head_text3.png",
"subText" => "最高补1200元",
"subTextColor" => "#666666"
],
'list' => [
[
"btnTitle" => [
"text" => "全网低价",
"color" => "#ffffff",
"startColor" => "#F5443E",
"endColor" => "#F5443E"
],
"link" => [
"name" => ""
],
"imageUrl" => "static/resource/images/diy/picture_show/picture_05.png"
],
[
"btnTitle" => [
"text" => "大牌特惠",
"color" => "#ffffff",
"startColor" => "#F5443E",
"endColor" => "#F5443E"
],
"link" => [
"name" => ""
],
"imageUrl" => "static/resource/images/diy/picture_show/picture_06.png"
]
],
"listFrame" => [
"startColor" => "#D4EFFF",
"endColor" => "#EBF4FA"
]
],
'moduleTwo' => [
'head' => [
"textImg" => "static/resource/images/diy/picture_show/picture_show_head_text4.png",
"subText" => "每日上新",
"subTextColor" => "#666666"
],
'list' => [
[
"btnTitle" => [
"text" => "人气爆款",
"color" => "#ffffff",
"startColor" => "#F5443E",
"endColor" => "#F5443E"
],
"link" => [
"name" => ""
],
"imageUrl" => "static/resource/images/diy/picture_show/picture_07.png"
],
[
"btnTitle" => [
"text" => "官方正品",
"color" => "#ffffff",
"startColor" => "#F5443E",
"endColor" => "#F5443E"
],
"link" => [
"name" => ""
],
"imageUrl" => "static/resource/images/diy/picture_show/picture_08.png"
]
],
"listFrame" => [
"startColor" => "#FFF1D4",
"endColor" => "#F9F2E5"
]
],
"moduleRounded" => [
"topRounded" => 10,
"bottomRounded" => 10
],
],// 组件属性
'template' => [
"textColor" => "#303133", // 文字颜色
'pageStartBgColor' => '', // 底部背景颜色(开始)
'pageEndBgColor' => '', // 底部背景颜色(结束)
'pageGradientAngle' => 'to bottom', // 渐变角度从上到下to bottom、从左到右to right
'componentBgUrl' => '', // 组件背景图片
'componentBgAlpha' => 2, // 组件背景图片的透明度0~10
"componentStartBgColor" => '', // 组件背景颜色(开始)
"componentEndBgColor" => '', // 组件背景颜色(结束)
"componentGradientAngle" => 'to bottom', // 渐变角度上下to bottom、左右to right
"topRounded" => 0, // 组件上圆角
"bottomRounded" => 0, // 组件下圆角
"elementBgColor" => '', // 元素背景颜色
"topElementRounded" => 0,// 元素上圆角
"bottomElementRounded" => 0, // 元素下圆角
"margin" => [
"top" => 0, // 上边距
"bottom" => 0, // 下边距
"both" => 10 // 左右边距
],
]
]
], ],
], ],
]; ];

View File

@ -65,7 +65,14 @@ class PagesDict
"both" => 10 "both" => 10
], ],
"ignore" => [], "ignore" => [],
"list" => [] "list" => [],
// 轮播图设置
'swiper' => [
'indicatorColor' => 'rgba(0, 0, 0, 0.3)', // 未选中颜色
"indicatorActiveColor" => '#FF0E0E',
'indicatorStyle' => 'style-1',
'indicatorAlign' => 'center'
]
]; ];
$wap_index_list = ( new ConfigService() )->getWapIndexList(); $wap_index_list = ( new ConfigService() )->getWapIndexList();
@ -487,6 +494,13 @@ class PagesDict
"imgWidth" => 100, "imgWidth" => 100,
"imgHeight" => 100 "imgHeight" => 100
] ]
],
// 轮播图设置
'swiper' => [
'indicatorColor' => 'rgba(0, 0, 0, 0.3)', // 未选中颜色
"indicatorActiveColor" => '#FF0E0E',
'indicatorStyle' => 'style-1',
'indicatorAlign' => 'center'
] ]
], ],
[ [
@ -612,6 +626,13 @@ class PagesDict
] ]
] ]
], ],
// 轮播图设置
'swiper' => [
'indicatorColor' => 'rgba(0, 0, 0, 0.3)', // 未选中颜色
"indicatorActiveColor" => '#FF0E0E',
'indicatorStyle' => 'style-1',
'indicatorAlign' => 'center'
],
'pageStartBgColor' => '', 'pageStartBgColor' => '',
'pageEndBgColor' => '', 'pageEndBgColor' => '',
'pageGradientAngle' => 'to bottom', 'pageGradientAngle' => 'to bottom',
@ -938,6 +959,13 @@ class PagesDict
"imgWidth" => 100, "imgWidth" => 100,
"imgHeight" => 100 "imgHeight" => 100
] ]
],
// 轮播图设置
'swiper' => [
'indicatorColor' => 'rgba(0, 0, 0, 0.3)', // 未选中颜色
"indicatorActiveColor" => '#FF0E0E',
'indicatorStyle' => 'style-1',
'indicatorAlign' => 'center'
] ]
], ],
[ [
@ -1063,6 +1091,13 @@ class PagesDict
] ]
] ]
], ],
// 轮播图设置
'swiper' => [
'indicatorColor' => 'rgba(0, 0, 0, 0.3)', // 未选中颜色
"indicatorActiveColor" => '#FF0E0E',
'indicatorStyle' => 'style-1',
'indicatorAlign' => 'center'
],
'pageStartBgColor' => '', 'pageStartBgColor' => '',
'pageEndBgColor' => '', 'pageEndBgColor' => '',
'pageGradientAngle' => 'to bottom', 'pageGradientAngle' => 'to bottom',

View File

@ -58,7 +58,7 @@ class PayDict
'key' => self::WECHATPAY, 'key' => self::WECHATPAY,
'icon' => self::WECHATPAY_ICON, 'icon' => self::WECHATPAY_ICON,
'setting_component' => '/src/app/views/setting/components/pay-wechatpay.vue', 'setting_component' => '/src/app/views/setting/components/pay-wechatpay.vue',
'encrypt_params' => ['mch_public_cert_path', 'mch_secret_cert', 'mch_secret_key'], 'encrypt_params' => ['mch_public_cert_path', 'mch_secret_cert', 'mch_secret_key', 'wechat_public_cert_path'],
],//微信支付 ],//微信支付
self::ALIPAY => [ self::ALIPAY => [
'name' => get_lang('dict_pay.type_alipay'), 'name' => get_lang('dict_pay.type_alipay'),

View File

@ -422,7 +422,7 @@ CREATE TABLE `pay_refund` (
`main_id` int NOT NULL DEFAULT 0 COMMENT '操作人', `main_id` int NOT NULL DEFAULT 0 COMMENT '操作人',
`pay_refund_no` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '外部支付方式的退款单号', `pay_refund_no` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '外部支付方式的退款单号',
PRIMARY KEY (`id`) USING BTREE PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '退款记录表' ROW_FORMAT = Dynamic; ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '支付退款记录表' ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `pay_transfer`; DROP TABLE IF EXISTS `pay_transfer`;
@ -827,7 +827,7 @@ CREATE TABLE `sys_user` (
`create_time` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '添加时间', `create_time` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '添加时间',
`login_count` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '登录次数', `login_count` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '登录次数',
`is_del` tinyint(3) UNSIGNED NOT NULL DEFAULT 0, `is_del` tinyint(3) UNSIGNED NOT NULL DEFAULT 0,
`delete_time` tinyint(4) NOT NULL DEFAULT 0 COMMENT '删除时间', `delete_time` int(11) NOT NULL DEFAULT 0 COMMENT '删除时间',
`update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间', `update_time` int(11) NOT NULL DEFAULT 0 COMMENT '更新时间',
`status` tinyint(3) UNSIGNED NOT NULL DEFAULT 1 COMMENT '后台管理员状态 1有效0无效', `status` tinyint(3) UNSIGNED NOT NULL DEFAULT 1 COMMENT '后台管理员状态 1有效0无效',
`role_ids` varchar(255) NOT NULL DEFAULT '' COMMENT '权限组', `role_ids` varchar(255) NOT NULL DEFAULT '' COMMENT '权限组',

View File

@ -114,7 +114,7 @@
content: ` content: `
<div class="pop-link-wrap"> <div class="pop-link-wrap">
<p class="link-text">首次运行,请配置伪静态,才能正常使用。</p> <p class="link-text">首次运行,请配置伪静态,才能正常使用。</p>
<p class="link-text">伪静态如何配置请<a href="https://www.kancloud.cn/niushop/niucloud-admin-app/3199831" class="other-links-text" target="_blank">参考手册</a></p> <p class="link-text">伪静态如何配置请<a href="https://www.kancloud.cn/niushop/niushop_v6/3226724" class="other-links-text" target="_blank">参考手册</a></p>
<p class="link-btn"> <p class="link-btn">
<button onclick="pageToLink('${type}')" class="layui-btn visit-btn layui-border">确定</button> <button onclick="pageToLink('${type}')" class="layui-btn visit-btn layui-border">确定</button>
<button onclick="pageToLink('${type}', ${true})" class="layui-btn visit-btn layui-border">已配置,不需要在提示</button> <button onclick="pageToLink('${type}', ${true})" class="layui-btn visit-btn layui-border">已配置,不需要在提示</button>
@ -131,7 +131,7 @@
} }
if(type == 'admin'){ if(type == 'admin'){
layer.closeAll() layer.closeAll()
window.open('{$root_url}/admin/login') window.open('{$root_url}/admin/')
}else if(type == 'web'){ }else if(type == 'web'){
layer.closeAll() layer.closeAll()
window.open('{$root_url}/web/') window.open('{$root_url}/web/')

View File

@ -75,6 +75,8 @@ return [
'is_mobile_between' => 'is_mobile must be 0 or 1', 'is_mobile_between' => 'is_mobile must be 0 or 1',
'is_auth_register_number' => 'is_auth_register must be a number', 'is_auth_register_number' => 'is_auth_register must be a number',
'is_auth_register_between' => 'is_auth_register must be 0 or 1', 'is_auth_register_between' => 'is_auth_register must be 0 or 1',
'is_force_access_user_info_number' => 'is_force_access_user_info must be a number',
'is_force_access_user_info_between' => 'is_force_access_user_info must be 0 or 1',
'is_bind_mobile_number' => 'is_bind_mobile must be a number', 'is_bind_mobile_number' => 'is_bind_mobile must be a number',
'is_bind_mobile_between' => 'is_bind_mobile must be 0 or 1', 'is_bind_mobile_between' => 'is_bind_mobile must be 0 or 1',
'username_cannot_pure_number' => 'The account cannot be a pure number' 'username_cannot_pure_number' => 'The account cannot be a pure number'

View File

@ -282,6 +282,7 @@ return [
'SIGN_AWARD' => '签到奖励', 'SIGN_AWARD' => '签到奖励',
'GET_AWARD' => '恭喜您获得以下奖励', 'GET_AWARD' => '恭喜您获得以下奖励',
'WILL_GET_AWARD' => '您将获得以下奖励', 'WILL_GET_AWARD' => '您将获得以下奖励',
'SIGN_PERIOD_GREATER_THAN' => '签到周期必须大于0天',
//导出相关 //导出相关
'EXPORT_SUCCESS' => '导出成功', 'EXPORT_SUCCESS' => '导出成功',

View File

@ -78,6 +78,8 @@ return [
'is_mobile_between' => '手机验证码登录参数必须是0或1', 'is_mobile_between' => '手机验证码登录参数必须是0或1',
'is_auth_register_number' => '第三方自动注册参数必须是整数', 'is_auth_register_number' => '第三方自动注册参数必须是整数',
'is_auth_register_between' => '第三方自动注册参数必须是0或1', 'is_auth_register_between' => '第三方自动注册参数必须是0或1',
'is_force_access_user_info_number' => '强制获取用户信息参数必须是整数',
'is_force_access_user_info_between' => '强制获取用户信息参数必须是0或1',
'is_bind_mobile_number' => '强制绑定手机参数必须是整数', 'is_bind_mobile_number' => '强制绑定手机参数必须是整数',
'is_bind_mobile_between' => '强制绑定手机参数必须是0或1', 'is_bind_mobile_between' => '强制绑定手机参数必须是0或1',
'cash_out_is_open_in' => '是否启用必须是0或者1', 'cash_out_is_open_in' => '是否启用必须是0或者1',

View File

@ -12,8 +12,8 @@
namespace app\listener\member; namespace app\listener\member;
/** /**
* 会员登录时间 * 会员登录事件
* Class MemberLogin * Class MemberLoginListener
* @package app\listener\member * @package app\listener\member
*/ */
class MemberLoginListener class MemberLoginListener
@ -24,6 +24,8 @@ class MemberLoginListener
*/ */
public function handle(object $member) public function handle(object $member)
{ {
// 新人专享活动
event("MemberLoginAfter", [ 'member_id' => $member[ 'member_id' ] ]);
return; return;
} }

View File

@ -15,7 +15,7 @@ use app\service\core\member\CoreMemberService;
/** /**
* 会员注册成功事件 * 会员注册成功事件
* Class MemberRegister * Class MemberRegisterListener
* @package app\listener\member * @package app\listener\member
*/ */
class MemberRegisterListener class MemberRegisterListener
@ -27,9 +27,11 @@ class MemberRegisterListener
public function handle($member) public function handle($member)
{ {
// 注册发放成长值 // 注册发放成长值
CoreMemberService::sendGrowth($member['member_id'], 'member_register', ['from_type' => 'member_register']); CoreMemberService::sendGrowth($member[ 'member_id' ], 'member_register', [ 'from_type' => 'member_register' ]);
// 注册发放积分 // 注册发放积分
CoreMemberService::sendPoint($member['member_id'], 'member_register', ['from_type' => 'member_register']); CoreMemberService::sendPoint($member[ 'member_id' ], 'member_register', [ 'from_type' => 'member_register' ]);
// 新人专享活动
event("MemberLoginAfter", [ 'member_id' => $member[ 'member_id' ] ]);
return; return;
} }
} }

View File

@ -1,6 +1,6 @@
<?php <?php
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Niucloud-admin 企业快速开发的多应用管理平台 // | Niucloud-admin 企业快速开发的saas管理平台
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | 官方网址https://www.niucloud.com // | 官方网址https://www.niucloud.com
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------

View File

@ -29,6 +29,7 @@ class BottomNavigationListener
$addon_info = [ $addon_info = [
'title' => '系统', 'title' => '系统',
'type' => 'app'
]; ];
return [ return [
'key' => $key, 'key' => $key,

View File

@ -11,7 +11,6 @@
namespace app\model\wechat; namespace app\model\wechat;
use app\dict\channel\ReplyDict;
use core\base\BaseModel; use core\base\BaseModel;
/** /**

View File

@ -187,7 +187,7 @@ class GenerateService extends BaseAdminService
$table_info = $tables[0] ?? []; $table_info = $tables[0] ?? [];
if(empty($table_info)) throw new AdminException('DATA_NOT_EXIST'); if(empty($table_info)) throw new AdminException('DATA_NOT_EXIST');
$table_name = str_replace($tablePrefix, '', $table_info['Name']); $table_name = preg_replace("/^{$tablePrefix}/", '', $table_info['Name'], 1);
$fields = Db::name($table_name)->getFields(); $fields = Db::name($table_name)->getFields();
$add_table_data = [ $add_table_data = [
@ -556,7 +556,7 @@ class GenerateService extends BaseAdminService
$tables = Db::query($sql); $tables = Db::query($sql);
$table_info = $tables[0] ?? []; $table_info = $tables[0] ?? [];
if(empty($table_info)) throw new AdminException('DATA_NOT_EXIST'); if(empty($table_info)) throw new AdminException('DATA_NOT_EXIST');
$table_name = str_replace($tablePrefix, '', $table_info['Name']); $table_name = preg_replace("/^{$tablePrefix}/", '', $table_info['Name'], 1);
return Db::name($table_name)->getFields(); return Db::name($table_name)->getFields();
} }

View File

@ -331,7 +331,7 @@ abstract class BaseGenerator
public function getTableName() public function getTableName()
{ {
$tablePrefix = config('database.connections.mysql.prefix'); $tablePrefix = config('database.connections.mysql.prefix');
return str_replace($tablePrefix, '', $this->table['table_name']); return preg_replace("/^{$tablePrefix}/", '', $this->table['table_name'], 1);
} }

View File

@ -372,7 +372,7 @@ class ServiceGenerator extends BaseGenerator
{ {
foreach ($col as $v) foreach ($col as $v)
{ {
$content.= PHP_EOL.' $info['."'".$v."'".'] = strval($info['."'".$v."'])"; $content.= PHP_EOL.' $info['."'".$v."'".'] = strval($info['."'".$v."']);";
} }
} }
@ -381,7 +381,7 @@ class ServiceGenerator extends BaseGenerator
/** /**
* 关联表方法 * 关联表方法
* @return void * @return string
*/ */
public function getWithAllFunction() public function getWithAllFunction()
{ {

View File

@ -164,6 +164,8 @@ class PayChannelService extends BaseAdminService
'mch_secret_key' => $data[ 'mch_secret_key' ] ?? '',//商户秘钥 现在默认认为是v3版 'mch_secret_key' => $data[ 'mch_secret_key' ] ?? '',//商户秘钥 现在默认认为是v3版
'mch_secret_cert' => $data[ 'mch_secret_cert' ] ?? '',//商户私钥 字符串或路径 'mch_secret_cert' => $data[ 'mch_secret_cert' ] ?? '',//商户私钥 字符串或路径
'mch_public_cert_path' => $data[ 'mch_public_cert_path' ] ?? '',//商户公钥证书路径 'mch_public_cert_path' => $data[ 'mch_public_cert_path' ] ?? '',//商户公钥证书路径
'wechat_public_cert_path' => $data['wechat_public_cert_path'] ?? '', // 微信支付公钥
'wechat_public_cert_id' => $data['wechat_public_cert_id'] ?? '' // 微信支付公钥id
]; ];
break; break;
case PayDict::ALIPAY: case PayDict::ALIPAY:

View File

@ -51,4 +51,24 @@ class ScheduleLogService extends BaseAdminService
} }
/**
* 删除计划任务执行记录
* @param $ids
* @return bool
*/
public function del($ids)
{
return (new CoreScheduleLogService())->del($ids);
}
/**
* 清空计划任务执行记录
* @param $data
* @return bool
*/
public function clear($data)
{
return (new CoreScheduleLogService())->clear($data);
}
} }

View File

@ -68,7 +68,7 @@ class AttachmentService extends BaseAdminService
*/ */
public function modifyCategory($att_id, $cate_id) public function modifyCategory($att_id, $cate_id)
{ {
$where = array ( $where = array(
[ 'att_id', '=', $att_id ], [ 'att_id', '=', $att_id ],
); );
$this->model->where($where)->update([ 'cate_id' => $cate_id, 'update_time' => time() ]); $this->model->where($where)->update([ 'cate_id' => $cate_id, 'update_time' => time() ]);
@ -84,7 +84,7 @@ class AttachmentService extends BaseAdminService
public function batchModifyCategory($att_ids, $cate_id) public function batchModifyCategory($att_ids, $cate_id)
{ {
$where = array ( $where = array(
[ 'att_id', 'in', is_string($att_ids) ? explode($att_ids) : $att_ids ], [ 'att_id', 'in', is_string($att_ids) ? explode($att_ids) : $att_ids ],
); );
$this->model->where($where)->update([ 'cate_id' => $cate_id, 'update_time' => time() ]); $this->model->where($where)->update([ 'cate_id' => $cate_id, 'update_time' => time() ]);
@ -118,7 +118,7 @@ class AttachmentService extends BaseAdminService
*/ */
public function getPage(array $data) public function getPage(array $data)
{ {
$where = array (); $where = array();
if (!empty($data[ 'att_type' ])) { if (!empty($data[ 'att_type' ])) {
$where[] = [ 'att_type', '=', $data[ 'att_type' ] ]; $where[] = [ 'att_type', '=', $data[ 'att_type' ] ];
} }
@ -145,7 +145,7 @@ class AttachmentService extends BaseAdminService
$attachment = $category_model->create($data); $attachment = $category_model->create($data);
if (!$attachment->id) if (!$attachment->id)
throw new AdminException('ADD_FAIL');//创建失败 throw new AdminException('ADD_FAIL');//创建失败
return $attachment->att_id; return $attachment->id;
} }
/** /**
@ -155,7 +155,7 @@ class AttachmentService extends BaseAdminService
*/ */
public function findCategory(int $id) public function findCategory(int $id)
{ {
$where = array ( $where = array(
[ 'id', '=', $id ] [ 'id', '=', $id ]
); );
$category_model = new SysAttachmentCategory(); $category_model = new SysAttachmentCategory();
@ -173,7 +173,7 @@ class AttachmentService extends BaseAdminService
*/ */
public function editCategory(int $id, array $data) public function editCategory(int $id, array $data)
{ {
$where = array ( $where = array(
[ 'id', '=', $id ] [ 'id', '=', $id ]
); );
$category_model = new SysAttachmentCategory(); $category_model = new SysAttachmentCategory();
@ -206,7 +206,7 @@ class AttachmentService extends BaseAdminService
*/ */
public function getCategoryPage(array $data) public function getCategoryPage(array $data)
{ {
$where = array (); $where = array();
if (!empty($data[ 'type' ])) { if (!empty($data[ 'type' ])) {
$where[] = [ 'type', '=', $data[ 'type' ] ]; $where[] = [ 'type', '=', $data[ 'type' ] ];
} }
@ -226,7 +226,7 @@ class AttachmentService extends BaseAdminService
*/ */
public function getCategoryList(array $data) public function getCategoryList(array $data)
{ {
$where = array (); $where = array();
if (!empty($data[ 'type' ])) { if (!empty($data[ 'type' ])) {
$where[] = [ 'type', '=', $data[ 'type' ] ]; $where[] = [ 'type', '=', $data[ 'type' ] ];
} }
@ -246,7 +246,7 @@ class AttachmentService extends BaseAdminService
$icon_list = IconDict::getIcon(); $icon_list = IconDict::getIcon();
foreach ($icon_list as $k => $v) { foreach ($icon_list as $k => $v) {
unset($icon_list[ $k ][ 'glyphs' ]); unset($icon_list[ $k ][ 'glyphs' ]);
if (isset($data[ 'name' ]) && $data[ 'name' ] !='' && !str_contains($v['name'], $data['name'])) { if (isset($data[ 'name' ]) && $data[ 'name' ] != '' && !str_contains($v[ 'name' ], $data[ 'name' ])) {
unset($icon_list[ $k ]); unset($icon_list[ $k ]);
} }
} }
@ -282,7 +282,7 @@ class AttachmentService extends BaseAdminService
$icon[ $ck ][ 'real_name' ] = $cv[ 'name' ]; $icon[ $ck ][ 'real_name' ] = $cv[ 'name' ];
// 查询名称 // 查询名称
if (!empty($data[ 'real_name' ]) && !str_contains($cv['name'], $data['real_name'])) { if (!empty($data[ 'real_name' ]) && !str_contains($cv[ 'name' ], $data[ 'real_name' ])) {
unset($icon[ $ck ]); unset($icon[ $ck ]);
} }
} }

View File

@ -25,28 +25,29 @@ class BackupService extends UpgradeService
* 备份代码 * 备份代码
* @return void * @return void
*/ */
public function backupCode() { public function backupCode()
$backup_dir = $this->upgrade_dir .$this->upgrade_task['key'] . DIRECTORY_SEPARATOR . 'backup' . DIRECTORY_SEPARATOR . 'code' . DIRECTORY_SEPARATOR; {
$backup_dir = $this->upgrade_dir . $this->upgrade_task[ 'key' ] . DIRECTORY_SEPARATOR . 'backup' . DIRECTORY_SEPARATOR . 'code' . DIRECTORY_SEPARATOR;
// 创建目录 // 创建目录
dir_mkdir($backup_dir); dir_mkdir($backup_dir);
// 备份admin // 备份admin
dir_copy($this->root_path . 'admin', $backup_dir . 'admin', exclude_dirs:[ '.vscode', 'node_modules', 'dist']); dir_copy($this->root_path . 'admin', $backup_dir . 'admin', exclude_dirs:[ '.vscode', 'node_modules', 'dist' ]);
// 备份uni-app // 备份uni-app
dir_copy($this->root_path . 'uni-app', $backup_dir . 'uni-app', exclude_dirs:['node_modules', 'dist']); dir_copy($this->root_path . 'uni-app', $backup_dir . 'uni-app', exclude_dirs:[ 'node_modules', 'dist' ]);
// 备份web // 备份web
dir_copy($this->root_path . 'web', $backup_dir . 'web', exclude_dirs:['node_modules', '.nuxt', '.output']); dir_copy($this->root_path . 'web', $backup_dir . 'web', exclude_dirs:[ 'node_modules', '.nuxt', '.output' ]);
// 备份niucloud // 备份niucloud
$niucloud_dir = $backup_dir . 'niucloud' . DIRECTORY_SEPARATOR; $niucloud_dir = $backup_dir . 'niucloud' . DIRECTORY_SEPARATOR;
if ($this->upgrade_task['upgrade']['app_key'] == AddonDict::FRAMEWORK_KEY) { if ($this->upgrade_task[ 'upgrade' ][ 'app_key' ] == AddonDict::FRAMEWORK_KEY) {
dir_copy($this->root_path . 'niucloud', $niucloud_dir, exclude_dirs:['addon', 'config', 'public', 'vendor', 'runtime']); dir_copy($this->root_path . 'niucloud', $niucloud_dir, exclude_dirs:[ 'addon', 'config', 'public', 'vendor', 'runtime' ]);
// 备份版本文件 // 备份版本文件
$version_file = $this->root_path . 'niucloud' .DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'version.php'; $version_file = $this->root_path . 'niucloud' . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'version.php';
$to_version_file = $niucloud_dir . 'config' . DIRECTORY_SEPARATOR . 'version.php'; $to_version_file = $niucloud_dir . 'config' . DIRECTORY_SEPARATOR . 'version.php';
file_copy($version_file, $to_version_file); file_copy($version_file, $to_version_file);
} else { } else {
$addon = $this->upgrade_task['upgrade']['app_key']; $addon = $this->upgrade_task[ 'upgrade' ][ 'app_key' ];
$addon_dir = $this->root_path . 'niucloud' . DIRECTORY_SEPARATOR . 'addon' . DIRECTORY_SEPARATOR . $addon; $addon_dir = $this->root_path . 'niucloud' . DIRECTORY_SEPARATOR . 'addon' . DIRECTORY_SEPARATOR . $addon;
$to_addon_dir = $niucloud_dir . 'addon' . DIRECTORY_SEPARATOR . $addon; $to_addon_dir = $niucloud_dir . 'addon' . DIRECTORY_SEPARATOR . $addon;
dir_copy($addon_dir, $to_addon_dir); dir_copy($addon_dir, $to_addon_dir);
@ -69,8 +70,9 @@ class BackupService extends UpgradeService
* 备份数据库 * 备份数据库
* @return void * @return void
*/ */
public function backupSql() { public function backupSql()
$backup_dir = $this->upgrade_dir .$this->upgrade_task['key'] . DIRECTORY_SEPARATOR . 'backup' . DIRECTORY_SEPARATOR . 'sql' . DIRECTORY_SEPARATOR; {
$backup_dir = $this->upgrade_dir . $this->upgrade_task[ 'key' ] . DIRECTORY_SEPARATOR . 'backup' . DIRECTORY_SEPARATOR . 'sql' . DIRECTORY_SEPARATOR;
// 创建目录 // 创建目录
dir_mkdir($backup_dir); dir_mkdir($backup_dir);
@ -82,11 +84,11 @@ class BackupService extends UpgradeService
]); ]);
$tables = []; $tables = [];
$prefix = config('database.connections.'.config('database.default'))['prefix']; $prefix = config('database.connections.' . config('database.default'))[ 'prefix' ];
if ($this->upgrade_task['upgrade']['app_key'] == AddonDict::FRAMEWORK_KEY) { 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_user_log", "{$prefix}jobs", "{$prefix}jobs_failed" ];
$sys_models = (new GenerateService())->getModels(['addon' => 'system']); $sys_models = ( new GenerateService() )->getModels([ 'addon' => 'system' ]);
foreach ($sys_models as $model) { foreach ($sys_models as $model) {
$name = "\\$model"; $name = "\\$model";
$class = new $name(); $class = new $name();
@ -96,11 +98,14 @@ class BackupService extends UpgradeService
} }
} }
} else { } else {
$addon_models = (new GenerateService())->getModels(['addon' => $this->upgrade_task['upgrade']['app_key']]); $addon_models = ( new GenerateService() )->getModels([ 'addon' => $this->upgrade_task[ 'upgrade' ][ 'app_key' ] ]);
foreach ($addon_models as $model) { foreach ($addon_models as $model) {
try {
$name = "\\$model"; $name = "\\$model";
$class = new $name(); $class = new $name();
$tables[] = $class->getTable(); $tables[] = $class->getTable();
} catch (\Exception $e) {
}
} }
} }

View File

@ -28,9 +28,9 @@ class RestoreService extends UpgradeService
$backup_dir = $this->upgrade_dir .$this->upgrade_task['key'] . DIRECTORY_SEPARATOR . 'backup' . DIRECTORY_SEPARATOR . 'code' . DIRECTORY_SEPARATOR; $backup_dir = $this->upgrade_dir .$this->upgrade_task['key'] . DIRECTORY_SEPARATOR . 'backup' . DIRECTORY_SEPARATOR . 'code' . DIRECTORY_SEPARATOR;
if (is_dir($backup_dir)) { if (is_dir($backup_dir)) {
// 删除前端文件 // 删除前端文件
if (is_dir(public_path() . 'admin')) del_target_dir(public_path() . 'admin', true); // if (is_dir(public_path() . 'admin')) del_target_dir(public_path() . 'admin', true);
if (is_dir(public_path() . 'wap')) del_target_dir(public_path() . 'wap', true); // if (is_dir(public_path() . 'wap')) del_target_dir(public_path() . 'wap', true);
if (is_dir(public_path() . 'web')) del_target_dir(public_path() . 'web', true); // if (is_dir(public_path() . 'web')) del_target_dir(public_path() . 'web', true);
dir_copy($backup_dir, rtrim($this->root_path, DIRECTORY_SEPARATOR)); dir_copy($backup_dir, rtrim($this->root_path, DIRECTORY_SEPARATOR));
} }

View File

@ -252,7 +252,7 @@ class UpgradeService extends BaseAdminService
$version_item = $version_list[$index]; $version_item = $version_list[$index];
$version_no = $version_item['version_no']; $version_no = $version_item['version_no'];
$to_dir = $addon == AddonDict::FRAMEWORK_KEY ? $this->root_path : $this->root_path . 'niucloud' . DIRECTORY_SEPARATOR . 'addon' . DIRECTORY_SEPARATOR . $addon; $to_dir = $addon == AddonDict::FRAMEWORK_KEY ? rtrim($this->root_path, DIRECTORY_SEPARATOR) : $this->root_path . 'niucloud' . DIRECTORY_SEPARATOR . 'addon' . DIRECTORY_SEPARATOR . $addon;
// 获取文件变更记录 // 获取文件变更记录
if (file_exists($code_dir . $version_no . '.txt')) { if (file_exists($code_dir . $version_no . '.txt')) {

View File

@ -11,6 +11,7 @@
namespace app\service\api\member; namespace app\service\api\member;
use app\service\api\wechat\WechatAuthService;
use app\service\core\member\CoreMemberConfigService; use app\service\core\member\CoreMemberConfigService;
use core\base\BaseApiService; use core\base\BaseApiService;
@ -23,10 +24,22 @@ class MemberConfigService extends BaseApiService
{ {
/** /**
* 获取注册与登录设置 * 获取注册与登录设置
* @param $url
* @return array
*/ */
public function getLoginConfig(){ public function getLoginConfig($url = '')
{
return (new CoreMemberConfigService())->getLoginConfig(); $res = ( new CoreMemberConfigService() )->getLoginConfig();
if (!empty($url)) {
try {
// 检测公众号配置是否成功
$wechat_auth = ( new WechatAuthService() )->jssdkConfig($url);
} catch (\Exception $e) {
$res[ 'is_auth_register' ] = 0;
$res[ 'is_force_access_user_info' ] = 0;
}
}
return $res;
} }
} }

View File

@ -139,4 +139,13 @@ class MemberService extends BaseApiService
$detail['verify_code_barcode'] = image_to_base64($barcode_path); $detail['verify_code_barcode'] = image_to_base64($barcode_path);
return $detail; return $detail;
} }
/**
* 初始化会员数据
*/
public function initMemberData(){
if ($this->member_id) {
event("MemberLoginAfter", ['member_id' => $this->member_id]);
}
}
} }

View File

@ -1,6 +1,6 @@
<?php <?php
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Niucloud-admin 企业快速开发的多应用管理平台 // | Niucloud-admin 企业快速开发的saas管理平台
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | 官方网址https://www.niucloud.com // | 官方网址https://www.niucloud.com
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
@ -11,6 +11,7 @@
namespace app\service\api\member; namespace app\service\api\member;
use app\job\member\MemberGiftGrantJob;
use app\model\member\MemberSign; use app\model\member\MemberSign;
use app\service\core\member\CoreMemberService; use app\service\core\member\CoreMemberService;
use app\service\core\sys\CoreConfigService; use app\service\core\sys\CoreConfigService;
@ -109,19 +110,18 @@ class MemberSignService extends BaseApiService
$res = $this->model->create($data); $res = $this->model->create($data);
if ($res) { if ($res) {
//日签奖励发放 //日签奖励发放
$param = [ MemberGiftGrantJob::dispatch([
'member_id' => $this->member_id,
'gift' => $sign_config['day_award'],
'param' => [
'from_type' => 'day_sign_award', 'from_type' => 'day_sign_award',
'memo' => '日签奖励' 'memo' => '日签奖励'
]; ]
(new CoreMemberService())->memberGiftGrant($this->member_id, $sign_config['day_award'], $param); ]);
$awards['day_award'] = $sign_config['day_award']; $awards['day_award'] = $sign_config['day_award'];
//签到成功后判断连签天数是否满足连签奖励发放条件 //签到成功后判断连签天数是否满足连签奖励发放条件
if (!empty($sign_config['continue_award'])) { if (!empty($sign_config['continue_award'])) {
$param = [
'from_type' => 'continue_sign_award',
'memo' => '连签奖励'
];
foreach ($sign_config['continue_award'] as $key => $value) { foreach ($sign_config['continue_award'] as $key => $value) {
$continue_sign = intval($value['continue_sign']);//连续签到天数要求 $continue_sign = intval($value['continue_sign']);//连续签到天数要求
//如果连签天数满足配置条件,发放连签奖励 //如果连签天数满足配置条件,发放连签奖励
@ -142,7 +142,14 @@ class MemberSignService extends BaseApiService
->whereBetweenTime('create_time', $period_start_time, $period_end_time)->count('sign_id'); ->whereBetweenTime('create_time', $period_start_time, $period_end_time)->count('sign_id');
if ($receive_count < $value['receive_num']) { if ($receive_count < $value['receive_num']) {
//连签奖励发放 //连签奖励发放
(new CoreMemberService())->memberGiftGrant($this->member_id, $gifts, $param); MemberGiftGrantJob::dispatch([
'member_id' => $this->member_id,
'gift' => $gifts,
'param' => [
'from_type' => 'continue_sign_award',
'memo' => '连签奖励'
]
]);
$awards['continue_award'] = $gifts; $awards['continue_award'] = $gifts;
$continue_text = get_lang('CONTINUE_SIGN').$res->days.get_lang('DAYS'); $continue_text = get_lang('CONTINUE_SIGN').$res->days.get_lang('DAYS');
//更新连签发放记录 //更新连签发放记录
@ -150,7 +157,14 @@ class MemberSignService extends BaseApiService
} }
} else { //不限制 } else { //不限制
//连签奖励发放 //连签奖励发放
(new CoreMemberService())->memberGiftGrant($this->member_id, $gifts, $param); MemberGiftGrantJob::dispatch([
'member_id' => $this->member_id,
'gift' => $gifts,
'param' => [
'from_type' => 'continue_sign_award',
'memo' => '连签奖励'
]
]);
$awards['continue_award'] = $gifts; $awards['continue_award'] = $gifts;
$continue_text = get_lang('CONTINUE_SIGN').$res->days.get_lang('DAYS'); $continue_text = get_lang('CONTINUE_SIGN').$res->days.get_lang('DAYS');
//更新连签发放记录 //更新连签发放记录
@ -407,6 +421,15 @@ class MemberSignService extends BaseApiService
$is_use_point = ($is_use_point_day || $is_use_point_continue) ? 1 : 0; $is_use_point = ($is_use_point_day || $is_use_point_continue) ? 1 : 0;
$is_use_balance = ($is_use_balance_day || $is_use_balance_continue) ? 1 : 0; $is_use_balance = ($is_use_balance_day || $is_use_balance_continue) ? 1 : 0;
$is_use_coupon = ($is_use_coupon_day || $is_use_coupon_continue) ? 1 : 0; $is_use_coupon = ($is_use_coupon_day || $is_use_coupon_continue) ? 1 : 0;
$coupon_check_data = array_filter(event('CouponCheck', ['is_use_coupon' => $is_use_coupon, 'coupon_id' => $coupon_id, 'coupon_list' => $coupon_list]))[0] ?? [];
if (empty($coupon_check_data)) {
$is_use_coupon = false;
$coupon_check_data = [
'coupon_id' => [],
'coupon_list' => []
];
}
$is_use_coupon = empty($coupon_check_data['coupon_id']) ? false : $is_use_coupon;
//相同奖励合并 //相同奖励合并
$awards_total = [ $awards_total = [
'point' => [ 'point' => [
@ -419,8 +442,8 @@ class MemberSignService extends BaseApiService
], ],
'shop_coupon' => [ 'shop_coupon' => [
'is_use' => $is_use_coupon, 'is_use' => $is_use_coupon,
'coupon_id' => $coupon_id, 'coupon_id' => $coupon_check_data['coupon_id'],
'coupon_list' => $coupon_list, 'coupon_list' => $coupon_check_data['coupon_list'],
] ]
]; ];
return (new CoreMemberService())->getGiftContent($awards_total, 'member_sign'); return (new CoreMemberService())->getGiftContent($awards_total, 'member_sign');

View File

@ -110,10 +110,10 @@ class AreaService extends BaseApiService
$url = 'https://apis.map.qq.com/ws/geocoder/v1/'; $url = 'https://apis.map.qq.com/ws/geocoder/v1/';
$map = ( new ConfigService() )->getMap(); $map = ( new ConfigService() )->getMap();
$get_data = array ( $get_data = array(
'location' => $params[ 'latlng' ],
'key' => $map[ 'key' ], 'key' => $map[ 'key' ],
'get_poi' => 0,//是否返回周边POI列表1.返回0不返回(默认) 'location' => $params[ 'latlng' ],
'get_poi' => 0, // 是否返回周边POI列表1.返回0不返回(默认)
); );
$url = $url . '?' . http_build_query($get_data); $url = $url . '?' . http_build_query($get_data);
@ -131,12 +131,32 @@ class AreaService extends BaseApiService
curl_close($curl); curl_close($curl);
if ($res[ 'status' ] == 0) { if ($res[ 'status' ] == 0) {
$return_array = $res[ 'result' ][ 'address_component' ] ?? []; $return_array = $res[ 'result' ][ 'address_component' ] ?? []; // 地址部件address不满足需求时可自行拼接
$address_data = array ( $address_reference = $res[ 'result' ][ 'address_reference' ] ?? [];
'province' => $return_array[ 'province' ] ?? '', $address = $return_array[ 'street_number' ] ?? ''; // 门牌,可能为空字串
'city' => $return_array[ 'city' ] ?? '', if (empty($address)) {
'district' => $return_array[ 'district' ] ?? '', $address = $return_array[ 'street' ] ?? ''; // 道路,可能为空字串
'address' => $return_array[ 'street_number' ] ?? '', }
$town = $address_reference[ 'town' ] ?? [];
$landmark_l1 = $address_reference[ 'landmark_l1' ] ?? [];
$landmark_l2 = $address_reference[ 'landmark_l2' ] ?? [];
$community = '';
if (!empty($landmark_l2[ 'title' ])) {
$community = $landmark_l2[ 'title' ]; // 二级地标,较一级地标更为精确,规模更小
} elseif (!empty($landmark_l1[ 'title' ])) {
$community = $landmark_l1[ 'title' ]; // 一级地标,可识别性较强、规模较大的地点、小区等
} elseif (!empty($town[ 'title' ])) {
$community = $town[ 'title' ]; // 乡镇/街道(四级行政区划)
}
$address_data = array(
'province' => $return_array[ 'province' ] ?? '', // 省
'city' => $return_array[ 'city' ] ?? '', // 市
'district' => $return_array[ 'district' ] ?? '', // 区
'community' => $community,
'address' => $address,
'full_address' => $res[ 'result' ][ 'address' ] ?? '', 'full_address' => $res[ 'result' ][ 'address' ] ?? '',
'formatted_addresses' => $res[ 'result' ][ 'formatted_addresses' ] ?? [] 'formatted_addresses' => $res[ 'result' ][ 'formatted_addresses' ] ?? []
); );
@ -146,19 +166,20 @@ class AreaService extends BaseApiService
$province = str_replace('省', '', $address_data[ 'province' ]); $province = str_replace('省', '', $address_data[ 'province' ]);
$province = str_replace('市', '', $province); $province = str_replace('市', '', $province);
} }
$city = $address_data[ 'city' ] ?? ''; $city = $address_data[ 'city' ] ?? '';
$district = $address_data[ 'district' ] ?? ''; $district = $address_data[ 'district' ] ?? '';
$province_info = $this->model->where([ [ 'name', 'like', '%' . $province . '%' ], [ 'level', '=', 1 ] ])->field('id,name')->select()->toArray()[ 0 ] ?? []; $province_info = $this->model->where([ [ 'name', 'like', '%' . $province . '%' ], [ 'level', '=', 1 ] ])->field('id,name')->select()->toArray()[ 0 ] ?? [];
$province_id = 0; $province_id = 0;
$province_name = ''; $province_name = $address_data[ 'province' ];
$city_id = 0; $city_id = 0;
$city_name = ''; $city_name = $address_data[ 'city' ];
$district_id = 0; $district_id = 0;
$district_name = ''; $district_name = $address_data[ 'district' ];
if (!empty($province_info)) { if (!empty($province_info)) {
$province_id = $province_info[ 'id' ]; $province_id = $province_info[ 'id' ];
@ -193,9 +214,10 @@ class AreaService extends BaseApiService
'district_id' => $district_id, 'district_id' => $district_id,
'district' => $district_name, 'district' => $district_name,
'community' => $address_data[ 'community' ],
'full_address' => $address_data[ 'full_address' ], 'full_address' => $address_data[ 'full_address' ],
'formatted_addresses' => $address_data[ 'formatted_addresses' ] 'formatted_addresses' => $address_data[ 'formatted_addresses' ]
]; ];
} else { } else {
throw new ApiException($res[ 'message' ]); throw new ApiException($res[ 'message' ]);

View File

@ -99,7 +99,7 @@ class WeappAuthService extends BaseApiService
} }
} }
if ($member_info->isEmpty()) { if ($member_info->isEmpty()) {
$config = ( new MemberConfigService() )->getLoginConfig(); // $config = ( new MemberConfigService() )->getLoginConfig();
// $is_auth_register = $config[ 'is_auth_register' ]; // $is_auth_register = $config[ 'is_auth_register' ];
// 去掉强制绑定手机号判断,否则开启强制绑定的情况下小程序第三方注册无法注册 // 去掉强制绑定手机号判断,否则开启强制绑定的情况下小程序第三方注册无法注册
// 现在不需要控制自动注册,分为两种情况,一种自动注册,另一种手动点击授权登录注册 // 现在不需要控制自动注册,分为两种情况,一种自动注册,另一种手动点击授权登录注册

View File

@ -122,7 +122,7 @@ class WechatAuthService extends BaseApiService
} }
} }
if ($member_info->isEmpty()) { if ($member_info->isEmpty()) {
$config = ( new MemberConfigService() )->getLoginConfig(); // $config = ( new MemberConfigService() )->getLoginConfig();
// $is_auth_register = $config[ 'is_auth_register' ]; // $is_auth_register = $config[ 'is_auth_register' ];
// 去掉强制绑定手机号判断,否则开启强制绑定的情况下公众号第三方注册无法注册 // 去掉强制绑定手机号判断,否则开启强制绑定的情况下公众号第三方注册无法注册
// 现在不需要控制自动注册,分为两种情况,一种自动注册,另一种手动点击授权登录注册 // 现在不需要控制自动注册,分为两种情况,一种自动注册,另一种手动点击授权登录注册
@ -134,6 +134,11 @@ class WechatAuthService extends BaseApiService
} else { } else {
//可能会更新用户和粉丝表 //可能会更新用户和粉丝表
$login_service = new LoginService(); $login_service = new LoginService();
// 若用户头像为空,那么从微信获取头像和昵称,然后进行更新
if (empty($member_info->headimg)) {
$member_info->headimg = $avatar;
$member_info->nickname = $nickname;
}
return $login_service->login($member_info, MemberLoginTypeDict::WECHAT); return $login_service->login($member_info, MemberLoginTypeDict::WECHAT);
} }
} }

View File

@ -35,6 +35,7 @@ class CoreMemberConfigService extends BaseCoreService
'is_username' => $info[ 'is_username' ] ?? 1, // 是否用户名密码登录 'is_username' => $info[ 'is_username' ] ?? 1, // 是否用户名密码登录
'is_mobile' => $info[ 'is_mobile' ] ?? 0, // 是否手机验证码登录 'is_mobile' => $info[ 'is_mobile' ] ?? 0, // 是否手机验证码登录
'is_auth_register' => $info[ 'is_auth_register' ] ?? 1, // 是否第三方自动注册 'is_auth_register' => $info[ 'is_auth_register' ] ?? 1, // 是否第三方自动注册
'is_force_access_user_info' => $info[ 'is_force_access_user_info' ] ?? 0, // 是否强制获取用户信息
'is_bind_mobile' => $info[ 'is_bind_mobile' ] ?? 0, // 是否强制绑定手机 'is_bind_mobile' => $info[ 'is_bind_mobile' ] ?? 0, // 是否强制绑定手机
'agreement_show' => $info[ 'agreement_show' ] ?? 0, // 政策协议是否展示 'agreement_show' => $info[ 'agreement_show' ] ?? 0, // 政策协议是否展示
'bg_url' => $info[ 'bg_url' ] ?? '', // 背景图片 'bg_url' => $info[ 'bg_url' ] ?? '', // 背景图片
@ -50,10 +51,11 @@ class CoreMemberConfigService extends BaseCoreService
public function setLoginConfig(array $data) public function setLoginConfig(array $data)
{ {
$config = [ $config = [
'is_username' => $data[ 'is_username' ] ?? 1,//是否用户名密码登录 'is_username' => $data[ 'is_username' ] ?? 1,// 是否用户名密码登录
'is_mobile' => $data[ 'is_mobile' ] ?? 0,//是否手机验证码登录 'is_mobile' => $data[ 'is_mobile' ] ?? 0, // 是否手机验证码登录
'is_auth_register' => $data[ 'is_auth_register' ] ?? 1,//是否第三方自动注册 'is_auth_register' => $data[ 'is_auth_register' ] ?? 1,// 是否第三方自动注册
'is_bind_mobile' => $data[ 'is_bind_mobile' ] ?? 0,//是否强制绑定手机 'is_force_access_user_info' => $data[ 'is_force_access_user_info' ] ?? 0, // 是否强制获取用户信息
'is_bind_mobile' => $data[ 'is_bind_mobile' ] ?? 0, // 是否强制绑定手机
'agreement_show' => $data[ 'agreement_show' ] ?? 0, // 政策协议是否展示 'agreement_show' => $data[ 'agreement_show' ] ?? 0, // 政策协议是否展示
'bg_url' => $data[ 'bg_url' ] ?? '', // 背景图片 'bg_url' => $data[ 'bg_url' ] ?? '', // 背景图片
'desc' => $data[ 'desc' ] ?? '' // 描述 'desc' => $data[ 'desc' ] ?? '' // 描述

View File

@ -16,6 +16,7 @@ use app\model\member\Member;
use app\service\core\sys\CoreConfigService; use app\service\core\sys\CoreConfigService;
use core\base\BaseCoreService; use core\base\BaseCoreService;
use core\dict\DictLoader; use core\dict\DictLoader;
use core\exception\CommonException;
use think\db\exception\DataNotFoundException; use think\db\exception\DataNotFoundException;
use think\db\exception\DbException; use think\db\exception\DbException;
use think\db\exception\ModelNotFoundException; use think\db\exception\ModelNotFoundException;
@ -239,16 +240,19 @@ class CoreMemberService extends BaseCoreService
foreach ($gifts as $key => $item) { foreach ($gifts as $key => $item) {
if (!$item['is_use'] || !isset($dict[$key]) || !isset($dict[$key]['grant']) || empty($dict[$key]['grant'])) continue; if (!$item['is_use'] || !isset($dict[$key]) || !isset($dict[$key]['grant']) || empty($dict[$key]['grant'])) continue;
try {
$grant = $dict[$key]['grant']; $grant = $dict[$key]['grant'];
if ($grant instanceof \Closure) { if ($grant instanceof \Closure) {
$grant($member_id, $item, $param); $grant($member_id, $item, $param);
} else if (class_exists($grant)) { } else if (class_exists($grant)) {
(new $grant())->handle($member_id, $item, $param); (new $grant())->handle($member_id, $item, $param);
} }
} catch (CommonException $e) {
Log::write('会员礼包'.$key.'发放失败,错误原因:'. $e->getMessage().$e->getFile().$e->getLine());
}
} }
return true; return true;
} catch (\Exception $e) { } catch (CommonException $e) {
Log::write('会员礼包发放失败,错误原因:'. $e->getMessage().$e->getFile().$e->getLine()); Log::write('会员礼包发放失败,错误原因:'. $e->getMessage().$e->getFile().$e->getLine());
Log::write('参数:'. json_encode([ Log::write('参数:'. json_encode([
'member_id' => $member_id, 'member_id' => $member_id,

View File

@ -60,6 +60,7 @@ class CoreOfflineService extends BaseCoreService
$refund_no = $params['refund_no'];//交易流水号 $refund_no = $params['refund_no'];//交易流水号
$voucher = $params['voucher'] ?? ''; $voucher = $params['voucher'] ?? '';
//线下退款凭证校验
if (empty($voucher)) throw new CommonException('VOUCHER_NOT_EMPTY'); if (empty($voucher)) throw new CommonException('VOUCHER_NOT_EMPTY');
$pay = (new CoreRefundService())->findByRefundNo($refund_no); $pay = (new CoreRefundService())->findByRefundNo($refund_no);

View File

@ -40,6 +40,17 @@ class CorePosterService extends BaseCoreService
return true; return true;
} }
/**
* 删除
* @param $condition
* @return \think\Response
*/
public function del($condition)
{
( new Poster() )->delete($condition);
return true;
}
/** /**
* 海报类型 * 海报类型
* @param string $type * @param string $type
@ -129,7 +140,7 @@ class CorePosterService extends BaseCoreService
$dir = 'upload/poster'; $dir = 'upload/poster';
$temp1 = md5(json_encode($poster)); $temp1 = md5(json_encode($poster));
$temp2 = md5(json_encode($poster_data)); $temp2 = md5(json_encode($poster_data));
$file_path = 'poster' . $temp1 . '_' . $temp2 . '_' . $channel . '.png'; $file_path = 'poster' . $temp1 . '_' . $temp2 .'_'.$channel. '.png';
$path = $dir . '/' . $file_path; $path = $dir . '/' . $file_path;
//判断当前海报是否存在,存在直接返回地址,不存在的话则创建 //判断当前海报是否存在,存在直接返回地址,不存在的话则创建

View File

@ -51,4 +51,34 @@ class CoreScheduleLogService extends BaseCoreService
} }
/**
* 删除计划任务执行记录
* @param $ids
* @return bool
*/
public function del($ids)
{
$res = $this->model::destroy(function($query) use ($ids) {
$query->where([ [ 'id', 'in', $ids ] ]);
});
return $res;
}
/**
* 清空计划任务执行记录
* @param $data
* @return bool
*/
public function clear($data)
{
$where = [];
if ($data[ 'schedule_id' ]) {
$where[] = [ 'schedule_id', '=', $data[ 'schedule_id' ] ];
}
$res = $this->model::destroy(function($query) use ($where) {
$query->where($where);
});
return $res;
}
} }

View File

@ -38,7 +38,7 @@ class CoreWechatServeService extends BaseCoreService
public function authorization(string $url = '', string $scopes = 'snsapi_base') public function authorization(string $url = '', string $scopes = 'snsapi_base')
{ {
$oauth = CoreWechatService::app()->getOauth(); $oauth = CoreWechatService::app()->getOauth();
return $oauth->scopes([$scopes])->redirect($url); return $oauth->scopes([ $scopes ])->redirect($url);
} }
/** /**
@ -52,7 +52,7 @@ class CoreWechatServeService extends BaseCoreService
$oauth = CoreWechatService::app()->getOauth(); $oauth = CoreWechatService::app()->getOauth();
return $oauth->userFromCode($code); return $oauth->userFromCode($code);
} catch (\Exception $e) { } catch (\Exception $e) {
throw new CommonException($e->getCode()); throw new CommonException($e->getCode() . '' . $e->getMessage());
} }
} }
@ -86,7 +86,7 @@ class CoreWechatServeService extends BaseCoreService
$server = $app->getServer(); $server = $app->getServer();
$server->with(function($message, \Closure $next) { $server->with(function($message, \Closure $next) {
// 你的自定义逻辑 // 你的自定义逻辑
return (new CoreWechatMessageService)->message($message); return ( new CoreWechatMessageService )->message($message);
}); });
$response = $server->serve(); $response = $server->serve();
return $response; return $response;
@ -126,7 +126,8 @@ class CoreWechatServeService extends BaseCoreService
* @throws InvalidArgumentException * @throws InvalidArgumentException
* @throws \Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface * @throws \Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface
*/ */
public function scan(string $key, int $expire_seconds = 6 * 24 * 3600, $params = []){ public function scan(string $key, int $expire_seconds = 6 * 24 * 3600, $params = [])
{
$api = CoreWechatService::appApiClient(); $api = CoreWechatService::appApiClient();
if (is_int($key) && $key > 0) { if (is_int($key) && $key > 0) {
$type = 'QR_SCENE'; $type = 'QR_SCENE';
@ -135,7 +136,7 @@ class CoreWechatServeService extends BaseCoreService
$type = 'QR_STR_SCENE'; $type = 'QR_STR_SCENE';
$sceneKey = 'scene_str'; $sceneKey = 'scene_str';
} }
$scene = [$sceneKey => $key]; $scene = [ $sceneKey => $key ];
$param = [ $param = [
'expire_seconds' => $expire_seconds, 'expire_seconds' => $expire_seconds,
'action_name' => $type, 'action_name' => $type,

View File

@ -0,0 +1,230 @@
<?php
namespace app\upgrade\v142;
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' ] == 'CarouselSearch') {
if (!isset($diy_data[ 'value' ][ $ck ][ 'search' ][ 'color' ])) {
$diy_data[ 'value' ][ $ck ][ 'search' ][ 'color' ] = '#999999';
}
if (!isset($diy_data[ 'value' ][ $ck ][ 'search' ][ 'btnColor' ])) {
$diy_data[ 'value' ][ $ck ][ 'search' ][ 'btnColor' ] = '#FFFFFF';
}
if (!isset($diy_data[ 'value' ][ $ck ][ 'search' ][ 'bgColor' ])) {
$diy_data[ 'value' ][ $ck ][ 'search' ][ 'bgColor' ] = '#FFFFFF';
}
if (!isset($diy_data[ 'value' ][ $ck ][ 'search' ][ 'btnBgColor' ])) {
$diy_data[ 'value' ][ $ck ][ 'search' ][ 'btnBgColor' ] = '#FF3434';
}
if (!isset($diy_data[ 'value' ][ $ck ][ 'search' ][ 'style' ])) {
$diy_data[ 'value' ][ $ck ][ 'search' ][ 'style' ] = 'style-1';
}
if (!isset($diy_data[ 'value' ][ $ck ][ 'search' ][ 'styleName' ])) {
$diy_data[ 'value' ][ $ck ][ 'search' ][ 'styleName' ] = '风格一';
}
if (!isset($diy_data[ 'value' ][ $ck ][ 'search' ][ 'subTitle' ])) {
$diy_data[ 'value' ][ $ck ][ 'search' ][ 'subTitle' ] = [
"text" => "本地好价·优选生活",
"textColor" => "#000000",
"startColor" => "rgba(255,255,255,0.7)",
"endColor" => "",
];
}
if (!isset($diy_data[ 'value' ][ $ck ][ 'search' ][ 'positionColor' ])) {
$diy_data[ 'value' ][ $ck ][ 'search' ][ 'positionColor' ] = '#FFFFFF';
}
}
// 活动魔方 组件
if ($cv[ 'componentName' ] == 'ActiveCube') {
if (!isset($diy_data[ 'value' ][ $ck ][ 'textImg' ])) {
$diy_data[ 'value' ][ $ck ][ 'textImg' ] = 'static/resource/images/diy/active_cube/active_cube_text1.png';
}
if (!isset($diy_data[ 'value' ][ $ck ][ 'blockStyle' ][ 'btnText' ])) {
$diy_data[ 'value' ][ $ck ][ 'blockStyle' ] [ 'btnText' ] = 'normal';
}
}
// 优惠券 组件
if ($cv[ 'componentName' ] == 'GoodsCoupon') {
if (!isset($diy_data[ 'value' ][ $ck ][ 'titleColor' ])) {
$diy_data[ 'value' ][ $ck ][ 'titleColor' ] = '#FFFFFF';
}
if (!isset($diy_data[ 'value' ][ $ck ][ 'subTitleColor' ])) {
$diy_data[ 'value' ][ $ck ][ 'subTitleColor' ] = '#FFFFFF';
}
if (!isset($diy_data[ 'value' ][ $ck ][ 'couponItem' ])) {
$diy_data[ 'value' ][ $ck ][ 'couponItem' ] = [
"bgColor" => "#FFFFFF",
"textColor" => "#333333",
"subTextColor" => "#666666",
"moneyColor" => "#333333",
"aroundRadius" => 12
];
}
}
// 商品列表、多商品组
if ($cv[ 'componentName' ] == 'GoodsList' || $cv[ 'componentName' ] == 'ManyGoodsList') {
if (!isset($diy_data[ 'value' ][ $ck ][ 'goodsNameStyle' ][ 'isShow' ])) {
$diy_data[ 'value' ][ $ck ][ 'goodsNameStyle' ][ 'isShow' ] = true;
}
if (!isset($diy_data[ 'value' ][ $ck ][ 'priceStyle' ][ 'isShow' ])) {
$diy_data[ 'value' ][ $ck ][ 'priceStyle' ][ 'isShow' ] = true;
}
if (!isset($diy_data[ 'value' ][ $ck ][ 'priceStyle' ][ 'control' ])) {
$diy_data[ 'value' ][ $ck ][ 'priceStyle' ][ 'control' ] = true;
}
if (!isset($diy_data[ 'value' ][ $ck ][ 'priceStyle' ][ 'color' ])) {
$diy_data[ 'value' ][ $ck ][ 'priceStyle' ][ 'color' ] = '#FF4142';
}
if (isset($diy_data[ 'value' ][ $ck ][ 'priceStyle' ][ 'mainColor' ])) {
unset($diy_data[ 'value' ][ $ck ][ 'priceStyle' ][ 'mainColor' ]);
}
if (isset($diy_data[ 'value' ][ $ck ][ 'priceStyle' ][ 'mainControl' ])) {
unset($diy_data[ 'value' ][ $ck ][ 'priceStyle' ][ 'mainControl' ]);
}
if (isset($diy_data[ 'value' ][ $ck ][ 'priceStyle' ][ 'lineColor' ])) {
unset($diy_data[ 'value' ][ $ck ][ 'priceStyle' ][ 'lineColor' ]);
}
if (isset($diy_data[ 'value' ][ $ck ][ 'priceStyle' ][ 'lineControl' ])) {
unset($diy_data[ 'value' ][ $ck ][ 'priceStyle' ][ 'lineControl' ]);
}
if (!isset($diy_data[ 'value' ][ $ck ][ 'saleStyle' ][ 'isShow' ])) {
$diy_data[ 'value' ][ $ck ][ 'saleStyle' ][ 'isShow' ] = true;
}
if (!isset($diy_data[ 'value' ][ $ck ][ 'labelStyle' ])) {
$diy_data[ 'value' ][ $ck ][ 'labelStyle' ] = [
"control" => true,
"isShow" => true
];
}
if (!isset($diy_data[ 'value' ][ $ck ][ 'btnStyle' ])) {
$diy_data[ 'value' ][ $ck ][ 'btnStyle' ] = [
"fontWeight" => false,
"padding" => 0,
"aroundRadius" => 25,
"cartEvent" => "detail",
"text" => "购买",
"textColor" => "#FFFFFF",
"startBgColor" => "#FF4142",
"endBgColor" => "#FF4142",
"style" => "button",
"control" => true
];
}
}
// 图片展播 组件
if ($cv[ 'componentName' ] == 'PictureShow') {
if ($diy_data[ 'value' ][ $ck ][ 'moduleOne' ][ 'head' ][ 'textImg' ] == 'addon/shop/diy/index/style3/picture_show_head_text3.png') {
$diy_data[ 'value' ][ $ck ][ 'moduleOne' ][ 'head' ][ 'textImg' ] = 'static/resource/images/diy/picture_show/picture_show_head_text3.png';
}
if ($diy_data[ 'value' ][ $ck ][ 'moduleOne' ][ 'list' ]) {
foreach ($diy_data[ 'value' ][ $ck ][ 'moduleOne' ][ 'list' ] as $ps_k => $ps_v) {
if ($ps_v[ 'imageUrl' ] == 'addon/shop/diy/index/style3/picture_show_goods5.png') {
$diy_data[ 'value' ][ $ck ][ 'moduleOne' ][ 'list' ][ $ps_k ][ 'imageUrl' ] = 'static/resource/images/diy/picture_show/picture_05.png';
}
if ($ps_v[ 'imageUrl' ] == 'addon/shop/diy/index/style3/picture_show_goods6.png') {
$diy_data[ 'value' ][ $ck ][ 'moduleOne' ][ 'list' ][ $ps_k ][ 'imageUrl' ] = 'static/resource/images/diy/picture_show/picture_06.png';
}
}
}
if ($diy_data[ 'value' ][ $ck ][ 'moduleTwo' ][ 'head' ][ 'textImg' ] == 'addon/shop/diy/index/style3/picture_show_head_text4.png') {
$diy_data[ 'value' ][ $ck ][ 'moduleTwo' ][ 'head' ][ 'textImg' ] = 'static/resource/images/diy/picture_show/picture_show_head_text4.png';
}
if ($diy_data[ 'value' ][ $ck ][ 'moduleTwo' ][ 'list' ]) {
foreach ($diy_data[ 'value' ][ $ck ][ 'moduleTwo' ][ 'list' ] as $ps_k => $ps_v) {
if ($ps_v[ 'imageUrl' ] == 'addon/shop/diy/index/style3/picture_show_goods7.png') {
$diy_data[ 'value' ][ $ck ][ 'moduleTwo' ][ 'list' ][ $ps_k ][ 'imageUrl' ] = 'static/resource/images/diy/picture_show/picture_07.png';
}
if ($ps_v[ 'imageUrl' ] == 'addon/shop/diy/index/style3/picture_show_goods8.png') {
$diy_data[ 'value' ][ $ck ][ 'moduleTwo' ][ 'list' ][ $ps_k ][ 'imageUrl' ] = 'static/resource/images/diy/picture_show/picture_08.png';
}
}
}
}
// 图文导航 组件
if ($cv[ 'componentName' ] == 'GraphicNav') {
if (!isset($diy_data[ 'value' ][ $ck ][ 'swiper' ])) {
$diy_data[ 'value' ][ $ck ][ 'swiper' ] = [
'indicatorColor' => 'rgba(0, 0, 0, 0.3)', // 未选中颜色
"indicatorActiveColor" => '#FF0E0E',
'indicatorStyle' => 'style-1',
'indicatorAlign' => 'center',
];
}
}
}
unset($diy_data[ 'global' ][ 'topStatusBar' ][ 'isTransparent' ]);
$diy_data = json_encode($diy_data);
$diy_model->where([ [ 'id', '=', $v[ 'id' ] ] ])->update([ 'value' => $diy_data ]);
}
}
}
}

View File

@ -26,6 +26,7 @@ class LoginConfig extends Validate
'is_username' => 'number|between:0,1', 'is_username' => 'number|between:0,1',
'is_mobile' => 'number|between:0,1', 'is_mobile' => 'number|between:0,1',
'is_auth_register' => 'number|between:0,1', 'is_auth_register' => 'number|between:0,1',
'is_force_access_user_info' => 'number|between:0,1',
'is_bind_mobile' => 'number|between:0,1', 'is_bind_mobile' => 'number|between:0,1',
]; ];
@ -37,11 +38,13 @@ class LoginConfig extends Validate
'is_mobile.between' => 'validate_member.is_mobile_between', 'is_mobile.between' => 'validate_member.is_mobile_between',
'is_auth_register.number' => 'validate_member.is_auth_register_number', 'is_auth_register.number' => 'validate_member.is_auth_register_number',
'is_auth_register.between' => 'validate_member.is_auth_register_between', 'is_auth_register.between' => 'validate_member.is_auth_register_between',
'is_force_access_user_info.number' => 'validate_member.is_force_access_user_info_number',
'is_force_access_user_info.between' => 'validate_member.is_force_access_user_info_between',
'is_bind_mobile.number' => 'validate_member.is_bind_mobile_number', 'is_bind_mobile.number' => 'validate_member.is_bind_mobile_number',
'is_bind_mobile.between' => 'validate_member.is_bind_mobile_between', 'is_bind_mobile.between' => 'validate_member.is_bind_mobile_between',
]; ];
protected $scene = [ protected $scene = [
'set' => ['is_username', 'is_mobile', 'is_auth_register', 'is_bind_mobile'], 'set' => [ 'is_username', 'is_mobile', 'is_auth_register', 'is_force_access_user_info', 'is_bind_mobile' ],
]; ];
} }

View File

@ -1,6 +1,6 @@
<?php <?php
return [ return [
'version' => '1.4.1', 'version' => '1.4.2',
'code' => '202409270001' 'code' => '202411210001'
]; ];

View File

@ -32,7 +32,7 @@ class BaseModel extends Model
} }
$tables = Db::query($sql); $tables = Db::query($sql);
$table_info = $tables[0] ?? []; $table_info = $tables[0] ?? [];
$table_name = str_replace($tablePrefix, '', $table_info['Name']); $table_name = preg_replace("/^{$tablePrefix}/", '', $table_info['Name'], 1);
return Db::name($table_name)->getFields(); return Db::name($table_name)->getFields();
} }

View File

@ -39,6 +39,14 @@ class Wechatpay extends BasePay
$config['mch_public_cert_path'] = url_to_path($config['mch_public_cert_path'] ?? ''); $config['mch_public_cert_path'] = url_to_path($config['mch_public_cert_path'] ?? '');
// 选填-默认为正常模式。可选为: MODE_NORMAL, MODE_SERVICE // 选填-默认为正常模式。可选为: MODE_NORMAL, MODE_SERVICE
$config['mode'] = Pay::MODE_NORMAL; $config['mode'] = Pay::MODE_NORMAL;
if (!empty($config['wechat_public_cert_path']) && !empty($config['wechat_public_cert_id'])) {
$config['wechat_public_cert_path'] = [
$config['wechat_public_cert_id'] => url_to_path($config['wechat_public_cert_path'])
];
} else {
unset($config['wechat_public_cert_path']);
unset($config['wechat_public_cert_id']);
}
Pay::config($this->payConfig($config, 'wechat')); Pay::config($this->payConfig($config, 'wechat'));
} }