Merge branch 'v4.7.0dev' of https://gitee.com/ZhongBangKeJi/CRMEB into v4.7.0dev

This commit is contained in:
From-wh 2023-02-27 14:52:17 +08:00
commit d2df19697f
8 changed files with 191 additions and 63 deletions

View File

@ -307,6 +307,9 @@ class SystemConfig extends AuthController
return app('json')->fail(400763);
}
}
if (isset($post['uni_brokerage_price']) && preg_match('/\.[0-9]{2,}[1-9][0-9]*$/', (string)$post['uni_brokerage_price']) > 0) {
return app('json')->fail(500029);
}
//支付接口类型选择,如果有订单就不能再进行切换
// if (isset($post['pay_wechat_type'])) {

View File

@ -22,6 +22,7 @@ use app\services\system\lang\LangTypeServices;
use app\services\system\lang\LangCodeServices;
use app\services\system\lang\LangCountryServices;
use think\facade\Config;
use think\facade\Log;
if (!function_exists('getWorkerManUrl')) {
@ -922,61 +923,72 @@ if (!function_exists('getLang')) {
*/
function getLang($code, array $replace = [])
{
/** @var LangCountryServices $langCountryServices */
$langCountryServices = app()->make(LangCountryServices::class);
/** @var LangTypeServices $langTypeServices */
$langTypeServices = app()->make(LangTypeServices::class);
/** @var LangCodeServices $langCodeServices */
$langCodeServices = app()->make(LangCodeServices::class);
//确保获取语言的时候不会报错
try {
$request = app()->request;
//获取接口传入的语言类型
if (!$range = $request->header('cb-lang')) {
//没有传入则使用系统默认语言显示
$range = $langTypeServices->cacheDriver()->remember('range_name', function () use ($langTypeServices) {
return $langTypeServices->value(['is_default' => 1], 'file_name');
});
if (!$range) {
//系统没有设置默认语言的话,根据浏览器语言显示,如果浏览器语言在库中找不到,则使用简体中文
if ($request->header('accept-language') !== null) {
$range = explode(',', $request->header('accept-language'))[0];
} else {
$range = 'zh-CN';
/** @var LangCountryServices $langCountryServices */
$langCountryServices = app()->make(LangCountryServices::class);
/** @var LangTypeServices $langTypeServices */
$langTypeServices = app()->make(LangTypeServices::class);
/** @var LangCodeServices $langCodeServices */
$langCodeServices = app()->make(LangCodeServices::class);
$request = app()->request;
//获取接口传入的语言类型
if (!$range = $request->header('cb-lang')) {
//没有传入则使用系统默认语言显示
$range = $langTypeServices->cacheDriver()->remember('range_name', function () use ($langTypeServices) {
return $langTypeServices->value(['is_default' => 1], 'file_name');
});
if (!$range) {
//系统没有设置默认语言的话,根据浏览器语言显示,如果浏览器语言在库中找不到,则使用简体中文
if ($request->header('accept-language') !== null) {
$range = explode(',', $request->header('accept-language'))[0];
} else {
$range = 'zh-CN';
}
}
}
}
// 获取type_id
$typeId = $langCountryServices->cacheDriver()->remember('type_id_' . $range, function () use ($langCountryServices, $range) {
return $langCountryServices->value(['code' => $range], 'type_id') ?: 1;
}, 3600);
// 获取type_id
$typeId = $langCountryServices->cacheDriver()->remember('type_id_' . $range, function () use ($langCountryServices, $range) {
return $langCountryServices->value(['code' => $range], 'type_id') ?: 1;
}, 3600);
// 获取类型
$langData = CacheService::remember('lang_type_data', function () use ($langTypeServices) {
return $langTypeServices->getColumn(['status' => 1, 'is_del' => 0], 'file_name', 'id');
}, 3600);
// 获取类型
$langData = CacheService::remember('lang_type_data', function () use ($langTypeServices) {
return $langTypeServices->getColumn(['status' => 1, 'is_del' => 0], 'file_name', 'id');
}, 3600);
// 获取缓存key
$langStr = 'lang_' . str_replace('-', '_', $langData[$typeId]);
// 获取缓存key
$langStr = 'lang_' . str_replace('-', '_', $langData[$typeId]);
//读取当前语言的语言包
$lang = CacheService::remember($langStr, function () use ($typeId, $range, $langCodeServices) {
return $langCodeServices->getColumn(['type_id' => $typeId, 'is_admin' => 1], 'lang_explain', 'code');
}, 3600);
//获取返回文字
$message = (string)($lang[$code] ?? 'Code Error');
//读取当前语言的语言包
$lang = CacheService::remember($langStr, function () use ($typeId, $range, $langCodeServices) {
return $langCodeServices->getColumn(['type_id' => $typeId, 'is_admin' => 1], 'lang_explain', 'code');
}, 3600);
//获取返回文字
$message = (string)($lang[$code] ?? 'Code Error');
//替换变量
if (!empty($replace) && is_array($replace)) {
// 关联索引解析
$key = array_keys($replace);
foreach ($key as &$v) {
$v = "{:{$v}}";
//替换变量
if (!empty($replace) && is_array($replace)) {
// 关联索引解析
$key = array_keys($replace);
foreach ($key as &$v) {
$v = "{:{$v}}";
}
$message = str_replace($key, $replace, $message);
}
$message = str_replace($key, $replace, $message);
}
return $message;
return $message;
} catch (\Throwable $e) {
Log::error('获取语言code:' . $code . '发成错误,错误原因是:' . json_encode([
'file' => $e->getFile(),
'message' => $e->getMessage(),
'line' => $e->getLine()
]));
return $code;
}
}
}

View File

@ -35,13 +35,11 @@ class AdminLoginListener
}
try {
$timerPath = root_path('runtime') . '.timer';
$timer = file_get_contents($timerPath);
if ($timer && $timer <= time() && $timer > (time() - 10)) {
if ($timer && $timer <= time() && $timer > (time() - 70)) {
$res1 = true;
}
} catch (\Throwable $e) {
}

View File

@ -988,10 +988,46 @@ HTML;
]
]]
];
$series3 = ['normal' => ['color' => [
'x' => 0, 'y' => 0, 'x2' => 0, 'y2' => 1,
'colorStops' => [
[
'offset' => 0,
'color' => '#69cdff'
],
[
'offset' => 0.5,
'color' => '#3eb3f7'
],
[
'offset' => 1,
'color' => '#1495eb'
]
]
]]
];
$series4 = ['normal' => ['color' => [
'x' => 0, 'y' => 0, 'x2' => 0, 'y2' => 1,
'colorStops' => [
[
'offset' => 0,
'color' => '#6fdeab'
],
[
'offset' => 0.5,
'color' => '#44d693'
],
[
'offset' => 1,
'color' => '#2cc981'
]
]
]]
];
$chartdata['series'][] = ['name' => $chartdata['legend'][0], 'type' => 'bar', 'itemStyle' => $series1, 'data' => $data['pre']['price']];//分类1值
$chartdata['series'][] = ['name' => $chartdata['legend'][1], 'type' => 'bar', 'itemStyle' => $series1, 'data' => $data['now']['price']];//分类1值
$chartdata['series'][] = ['name' => $chartdata['legend'][2], 'type' => 'line', 'itemStyle' => $series2, 'data' => $data['pre']['count'], 'yAxisIndex' => 1];//分类2值
$chartdata['series'][] = ['name' => $chartdata['legend'][3], 'type' => 'line', 'itemStyle' => $series2, 'data' => $data['now']['count'], 'yAxisIndex' => 1];//分类2值
$chartdata['series'][] = ['name' => $chartdata['legend'][1], 'type' => 'bar', 'itemStyle' => $series2, 'data' => $data['now']['price']];//分类1值
$chartdata['series'][] = ['name' => $chartdata['legend'][2], 'type' => 'line', 'itemStyle' => $series3, 'data' => $data['pre']['count'], 'yAxisIndex' => 1];//分类2值
$chartdata['series'][] = ['name' => $chartdata['legend'][3], 'type' => 'line', 'itemStyle' => $series4, 'data' => $data['now']['count'], 'yAxisIndex' => 1];//分类2值
//统计总数上期
$pre_total = $this->dao->preTotalFind($datebefor, $dateafter);
@ -1109,10 +1145,46 @@ HTML;
]
]]
];
$series3 = ['normal' => ['color' => [
'x' => 0, 'y' => 0, 'x2' => 0, 'y2' => 1,
'colorStops' => [
[
'offset' => 0,
'color' => '#69cdff'
],
[
'offset' => 0.5,
'color' => '#3eb3f7'
],
[
'offset' => 1,
'color' => '#1495eb'
]
]
]]
];
$series4 = ['normal' => ['color' => [
'x' => 0, 'y' => 0, 'x2' => 0, 'y2' => 1,
'colorStops' => [
[
'offset' => 0,
'color' => '#6fdeab'
],
[
'offset' => 0.5,
'color' => '#44d693'
],
[
'offset' => 1,
'color' => '#2cc981'
]
]
]]
];
$chartdata['series'][] = ['name' => $chartdata['legend'][0], 'type' => 'bar', 'itemStyle' => $series1, 'data' => $data['pre']['price']];//分类1值
$chartdata['series'][] = ['name' => $chartdata['legend'][1], 'type' => 'bar', 'itemStyle' => $series1, 'data' => $data['now']['price']];//分类1值
$chartdata['series'][] = ['name' => $chartdata['legend'][2], 'type' => 'line', 'itemStyle' => $series2, 'data' => $data['pre']['count'], 'yAxisIndex' => 1];//分类2值
$chartdata['series'][] = ['name' => $chartdata['legend'][3], 'type' => 'line', 'itemStyle' => $series2, 'data' => $data['now']['count'], 'yAxisIndex' => 1];//分类2值
$chartdata['series'][] = ['name' => $chartdata['legend'][1], 'type' => 'bar', 'itemStyle' => $series2, 'data' => $data['now']['price']];//分类1值
$chartdata['series'][] = ['name' => $chartdata['legend'][2], 'type' => 'line', 'itemStyle' => $series3, 'data' => $data['pre']['count'], 'yAxisIndex' => 1];//分类2值
$chartdata['series'][] = ['name' => $chartdata['legend'][3], 'type' => 'line', 'itemStyle' => $series4, 'data' => $data['now']['count'], 'yAxisIndex' => 1];//分类2值
//统计总数上期
$pre_total = $this->dao->preTotalFind($datebefor, $dateafter);
@ -1228,10 +1300,46 @@ HTML;
]
]]
];
$series3 = ['normal' => ['color' => [
'x' => 0, 'y' => 0, 'x2' => 0, 'y2' => 1,
'colorStops' => [
[
'offset' => 0,
'color' => '#69cdff'
],
[
'offset' => 0.5,
'color' => '#3eb3f7'
],
[
'offset' => 1,
'color' => '#1495eb'
]
]
]]
];
$series4 = ['normal' => ['color' => [
'x' => 0, 'y' => 0, 'x2' => 0, 'y2' => 1,
'colorStops' => [
[
'offset' => 0,
'color' => '#6fdeab'
],
[
'offset' => 0.5,
'color' => '#44d693'
],
[
'offset' => 1,
'color' => '#2cc981'
]
]
]]
];
$chartdata['series'][] = ['name' => $chartdata['legend'][0], 'type' => 'bar', 'itemStyle' => $series1, 'data' => $data['pre']['price']];//分类1值
$chartdata['series'][] = ['name' => $chartdata['legend'][1], 'type' => 'bar', 'itemStyle' => $series1, 'data' => $data['now']['price']];//分类1值
$chartdata['series'][] = ['name' => $chartdata['legend'][2], 'type' => 'line', 'itemStyle' => $series2, 'data' => $data['pre']['count'], 'yAxisIndex' => 1];//分类2值
$chartdata['series'][] = ['name' => $chartdata['legend'][3], 'type' => 'line', 'itemStyle' => $series2, 'data' => $data['now']['count'], 'yAxisIndex' => 1];//分类2值
$chartdata['series'][] = ['name' => $chartdata['legend'][1], 'type' => 'bar', 'itemStyle' => $series2, 'data' => $data['now']['price']];//分类1值
$chartdata['series'][] = ['name' => $chartdata['legend'][2], 'type' => 'line', 'itemStyle' => $series3, 'data' => $data['pre']['count'], 'yAxisIndex' => 1];//分类2值
$chartdata['series'][] = ['name' => $chartdata['legend'][3], 'type' => 'line', 'itemStyle' => $series4, 'data' => $data['now']['count'], 'yAxisIndex' => 1];//分类2值
//统计总数上期
$pre_total = $this->dao->preTotalFind($datebefor, $dateafter);

View File

@ -118,7 +118,6 @@ class StoreCategoryServices extends BaseServices
throw new AdminException(100005);
} else {
$this->cacheDriver()->clear();
$this->cacheDriver()->set('category_version', uniqid());
}
}
@ -206,7 +205,6 @@ class StoreCategoryServices extends BaseServices
if (!$res) throw new AdminException(100006);
$this->cacheDriver()->clear();
$this->cacheDriver()->set('category_version', uniqid());
return (int)$res->id;
}
@ -246,7 +244,6 @@ class StoreCategoryServices extends BaseServices
});
$this->cacheDriver()->clear();
$this->cacheDriver()->set('category_version', uniqid());
}
/**
@ -262,7 +259,6 @@ class StoreCategoryServices extends BaseServices
if (!$res) throw new AdminException(100008);
$this->cacheDriver()->clear();
$this->cacheDriver()->set('category_version', uniqid());
}
/**

View File

@ -50,7 +50,7 @@ class UserAuthServices extends BaseServices
if ($token === 'undefined') {
throw new AuthException(110002);
}
if (!$token || !$tokenData = CacheService::get($md5Token, '', NULL, 'api'))
if (!$token || !$tokenData = CacheService::get($md5Token))
throw new AuthException(110002);
if (!is_array($tokenData) || empty($tokenData) || !isset($tokenData['uid'])) {

View File

@ -49,6 +49,7 @@ class WechatQrcodeServices extends BaseServices
$item['stop'] = $item['end_time'] ? $item['end_time'] > time() ? 1 : -1 : 0;
$item['label_name'] = $userLabel->getColumn([['id', 'in', $item['label_id']]], 'label_name');
$item['end_time'] = date('Y-m-d H:i:s', $item['end_time']);
$item['add_time'] = date('Y-m-d H:i:s', $item['add_time']);
}
$count = $this->dao->count($where);
return compact('list', 'count');

View File

@ -26520,7 +26520,17 @@ INSERT INTO `eb_lang_code` (`id`, `type_id`, `code`, `remarks`, `lang_explain`,
(24977, 7, '500028', '请填写邀请码', '초대 코드를 입력하십시오.', 1),
(24978, 8, '500028', '请填写邀请码', 'Урилгын кодыг бөглөнө үү', 1),
(24979, 9, '500028', '请填写邀请码', 'กรุณากรอกรหัสเชิญ', 1),
(24980, 10, '500028', '请填写邀请码', 'Vui lòng điền mã mời', 1);
(24980, 10, '500028', '请填写邀请码', 'Vui lòng điền mã mời', 1),
(24981, 1, '500029', '金额最多两位小数', '金额最多两位小数', 1),
(24982, 2, '500029', '金额最多两位小数', 'Amount Up to two decimal places', 1),
(24983, 3, '500029', '金额最多两位小数', '金額最多兩位小數', 1),
(24984, 4, '500029', '金额最多两位小数', 'Montant Jusquà deux décimales', 1),
(24985, 5, '500029', '金额最多两位小数', 'Importo Fino a due decimali', 1),
(24986, 6, '500029', '金额最多两位小数', '金額は小数点以下2桁まで', 1),
(24987, 7, '500029', '金额最多两位小数', '양 소수점 이하 두 자리까지', 1),
(24988, 8, '500029', '金额最多两位小数', 'Хэмжээ Хоёр аравтын бутархай газар хүртэл', 1),
(24989, 9, '500029', '金额最多两位小数', 'จำนวนทศนิยมสูงสุดสองตำแหน่ง', 1),
(24990, 10, '500029', '金额最多两位小数', 'Số tiền tối đa hai chữ số thập phân', 1);
-- --------------------------------------------------------