【程序目录】更新微信模版消息

This commit is contained in:
吴昊天 2022-09-17 12:19:45 +08:00
parent 0288daddad
commit 985f062f90
29 changed files with 850 additions and 497 deletions

View File

@ -47,6 +47,34 @@ class Login extends AuthController
return app()->make(Captcha::class)->create();
}
/**
* @return mixed
*/
public function ajcaptcha()
{
$captchaType = $this->request->get('captchaType');
return app('json')->success(aj_captcha_create($captchaType));
}
/**
* 一次验证
* @return mixed
*/
public function ajcheck()
{
[$token, $pointJson, $captchaType] = $this->request->postMore([
['token', ''],
['pointJson', ''],
['captchaType', ''],
], true);
try {
aj_captcha_check_one($captchaType, $token, $pointJson);
return app('json')->success();
} catch (\Throwable $e) {
return app('json')->fail(400336);
}
}
/**
* 登陆
* @return mixed
@ -56,14 +84,25 @@ class Login extends AuthController
*/
public function login()
{
[$account, $password, $imgcode, $key] = $this->request->postMore([
'account', 'pwd', ['imgcode', ''], ['key', '']
[$account, $password, $imgcode, $key, $captchaVerification, $captchaType] = $this->request->postMore([
'account',
'pwd',
['imgcode', ''],
['key', ''],
['captchaVerification', ''],
['captchaType', '']
], true);
if (!app()->make(Captcha::class)->check($imgcode)) {
return app('json')->fail(400336);
}
try {
aj_captcha_check_two($captchaType, $captchaVerification);
} catch (\Throwable $e) {
return app('json')->fail(400336);
}
$this->validate(['account' => $account, 'pwd' => $password], \app\adminapi\validate\setting\SystemAdminValidata::class, 'get');
return app('json')->success($this->services->login($account, $password, 'admin', $key));

View File

@ -1,5 +1,13 @@
<?php
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
namespace app\adminapi\controller\v1\setting;
use app\adminapi\controller\AuthController;

View File

@ -1,5 +1,13 @@
<?php
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
namespace app\adminapi\controller\v1\setting;
use app\adminapi\controller\AuthController;

View File

@ -1,10 +1,18 @@
<?php
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
namespace app\adminapi\controller\v1\setting;
use app\adminapi\controller\AuthController;
use app\services\system\lang\LangCountryServices;
use app\services\system\lang\LangTypeServices;
use crmeb\services\CacheService;
use think\facade\App;
class LangType extends AuthController
@ -57,6 +65,7 @@ class LangType extends AuthController
['status', 0]
]);
$this->services->langTypeSave($data);
CacheService::redisHandler()->delete('lang_type_data');
return app('json')->success(100000);
}
@ -68,6 +77,7 @@ class LangType extends AuthController
public function langTypeDel(int $id = 0)
{
$this->services->langTypeDel($id);
CacheService::redisHandler()->delete('lang_type_data');
return app('json')->success(100002);
}
}

View File

@ -168,6 +168,8 @@ class SystemAdmin extends AuthController
['pwd', ''],
['new_pwd', ''],
['conf_pwd', ''],
['file_pwd', ''],
['conf_file_pwd', ''],
]);
if(!preg_match('/^(?![^a-zA-Z]+$)(?!\D+$).{6,}$/',$data['new_pwd'])){
return app('json')->fail(400183);

View File

@ -44,32 +44,106 @@ class SystemFile extends AuthController
}
//打开目录
// public function opendir()
// {
// return app('json')->success($this->services->opendir());
// }
public function opendir()
{
return app('json')->success($this->services->opendir());
}
//读取文件
// public function openfile()
// {
// $file = $this->request->param('filepath');
// if (empty($file)) return app('json')->fail('出现错误');
// return app('json')->success($this->services->openfile($file));
// }
public function openfile()
{
$file = $this->request->param('filepath');
if (empty($file)) return app('json')->fail(410087);
return app('json')->success($this->services->openfile($file));
}
//保存文件
// public function savefile()
// {
// $comment = $this->request->param('comment');
// $filepath = $this->request->param('filepath');
// if(empty($comment) || empty($filepath)){
// return app('json')->fail('出现错误');
// }
// $res = $this->services->savefile($filepath,$comment);
// if ($res) {
// return app('json')->success('保存成功!');
// } else {
// return app('json')->fail('保存失败');
// }
// }
public function savefile()
{
$comment = $this->request->param('comment');
$filepath = $this->request->param('filepath');
if (empty($comment) || empty($filepath)) {
return app('json')->fail(410087);
}
$res = $this->services->savefile($filepath, $comment);
if ($res) {
return app('json')->success(100000);
} else {
return app('json')->fail(100006);
}
}
/**
* 创建文件夹
* @return mixed
*
* @date 2022/09/17
* @author yyw
*/
public function createFolder()
{
[$path] = $this->request->postMore([
['path', '']
], true);
try {
$this->services->createFolder($path);
} catch (\Exception $e) {
return app('json')->fail($e->getMessage());
}
return app('json')->success(100010);
}
/**
* 创建文件
* @return mixed
*
* @date 2022/09/17
* @author yyw
*/
public function createFile()
{
[$path] = $this->request->postMore([
['path', '']
], true);
try {
$this->services->createFile($path);
} catch (\Exception $e) {
return app('json')->fail($e->getMessage());
}
return app('json')->success(100010);
}
/**
* 删除文件或文件夹
* @return mixed
*
* @date 2022/09/17
* @author yyw
*/
public function delFolder()
{
[$path] = $this->request->postMore([
['path', '']
], true);
try {
$this->services->delFolder($path);
} catch (\Exception $e) {
return app('json')->fail($e->getMessage());
}
return app('json')->success(100010);
}
public function copyFolder()
{
[$surDir, $toDir] = $this->request->postMore([
['surDir', ''],
['toDir', '']
], true);
try {
return app('json')->success($this->services->copyFolder($surDir, $toDir));
} catch (\Exception $e) {
return app('json')->fail($e->getMessage());
}
}
}

View File

@ -16,6 +16,7 @@ use app\Request;
use app\services\system\admin\AdminAuthServices;
use crmeb\interfaces\MiddlewareInterface;
use think\facade\Config;
use crmeb\services\CacheService;
/**
* 后台登陆验证中间件
@ -28,6 +29,13 @@ class AdminAuthTokenMiddleware implements MiddlewareInterface
{
$authInfo = null;
$token = trim(ltrim($request->header(Config::get('cookie.token_name', 'Authori-zation')), 'Bearer'));
// 获取文件token,让其失效
$invalid_token = trim(ltrim($request->header(Config::get('cookie.invalid_token_name', 'Invalid-zation')), 'Bearer'));
if($invalid_token)
{
$md5Token = md5($invalid_token);
$res = CacheService::clearToken($md5Token);
}
/** @var AdminAuthServices $service */
$service = app()->make(AdminAuthServices::class);

View File

@ -0,0 +1,53 @@
<?php
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
namespace app\adminapi\middleware;
use app\Request;
use app\services\system\admin\AdminAuthServices;
use crmeb\exceptions\AuthException;
use crmeb\interfaces\MiddlewareInterface;
use think\facade\Config;
/**
* 后台登陆验证中间件
* Class AdminAuthTokenMiddleware
* @package app\adminapi\middleware
*/
class AdminEditorTokenMiddleware implements MiddlewareInterface
{
public function handle(Request $request, \Closure $next)
{
$authInfo = null;
$token = trim(ltrim($request->header(Config::get('cookie.token_name', 'Authori-zation')), 'Bearer'));
/** @var AdminAuthServices $service */
$service = app()->make(AdminAuthServices::class);
$adminInfo = $service->parseToken($token,110008);
if($adminInfo['type'] !== 'admin_edit')
{
throw new AuthException('登陆异常,请重新登录',[],110008);
}
Request::macro('isAdminLogin', function () use (&$adminInfo) {
return !is_null($adminInfo);
});
Request::macro('adminId', function () use (&$adminInfo) {
return $adminInfo['id'];
});
Request::macro('adminInfo', function () use (&$adminInfo) {
return $adminInfo;
});
return $next($request);
}
}

View File

@ -28,6 +28,10 @@ Route::group(function () {
Route::get('download', 'PublicController/download')->option(['real_name' => '下载文件']);
//验证码
Route::get('captcha_pro', 'Login/captcha')->name('')->option(['real_name' => '获取验证码']);
//获取验证码
Route::get('ajcaptcha', 'Login/ajcaptcha')->name('ajcaptcha')->option(['real_name' => '获取验证码']);
//一次验证
Route::post('ajcheck', 'Login/ajcheck')->name('ajcheck')->option(['real_name' => '一次验证']);
//获取客服数据
Route::get('get_workerman_url', 'PublicController/getWorkerManUrl')->option(['real_name' => '获取客服数据']);
//测试

View File

@ -45,12 +45,6 @@ Route::group('system', function () {
Route::get('log/search_admin', 'v1.system.SystemLog/search_admin')->option(['real_name' => '系统日志管理员搜索条件']);
//文件校验
Route::get('file', 'v1.system.SystemFile/index')->name('SystemFile')->option(['real_name' => '文件校验']);
//打开目录
// Route::get('file/opendir', 'v1.system.SystemFile/opendir')->option(['real_name' => '打开目录']);
//读取文件
// Route::get('file/openfile', 'v1.system.SystemFile/openfile')->option(['real_name' => '读取文件']);
//保存文件
// Route::post('file/savefile', 'v1.system.SystemFile/savefile')->option(['real_name' => '保存文件']);
//数据所有表
Route::get('backup', 'v1.system.SystemDatabackup/index')->option(['real_name' => '数据库所有表']);
//数据备份详情
@ -106,3 +100,22 @@ Route::group('system', function () {
\app\adminapi\middleware\AdminCheckRoleMiddleware::class,
\app\adminapi\middleware\AdminLogMiddleware::class
]);
Route::group('system', function () {
//打开目录
Route::get('file/opendir', 'v1.system.SystemFile/opendir')->option(['real_name' => '打开目录']);
//读取文件
Route::get('file/openfile', 'v1.system.SystemFile/openfile')->option(['real_name' => '读取文件']);
//保存文件
Route::post('file/savefile', 'v1.system.SystemFile/savefile')->option(['real_name' => '保存文件']);
Route::get('file/createFolder', 'v1.system.SystemFile/createFolder')->option(['real_name' => '创建文件夹']);
Route::get('file/createFile', 'v1.system.SystemFile/createFile')->option(['real_name' => '创建文件']);
Route::get('file/delFolder', 'v1.system.SystemFile/delFolder')->option(['real_name' => '删除文件夹']);
})->middleware([
\app\http\middleware\AllowOriginMiddleware::class,
\app\adminapi\middleware\AdminEditorTokenMiddleware::class,
\app\adminapi\middleware\AdminCheckRoleMiddleware::class,
\app\adminapi\middleware\AdminLogMiddleware::class
]);

View File

@ -121,29 +121,35 @@ class LoginController
*/
public function verify(Request $request, SmsService $services)
{
[$phone, $type, $key, $code] = $request->postMore([['phone', 0], ['type', ''], ['key', ''], ['code', '']], true);
[$phone, $type, $key, $captchaType, $captchaVerification] = $request->postMore([
['phone', 0],
['type', ''],
['key', ''],
['captchaType', ''],
['captchaVerification', ''],
], true);
$keyName = 'sms.key.' . $key;
$nowKey = 'sms.' . date('YmdHi');
if (!Cache::has($keyName))
if (!Cache::has($keyName)) {
return app('json')->fail(410003);
if (($num = Cache::get($keyName)) > 2) {
if (!$code)
return app('json')->fail(410004);
if (!$this->checkCaptcha($key, $code))
return app('json')->fail(410005);
}
$total = 1;
if ($has = Cache::has($nowKey)) {
if (Cache::has($nowKey)) {
$total = Cache::get($nowKey);
if ($total > Config::get('sms.maxMinuteCount', 20))
return app('json')->success(410006);
}
//二次验证
try {
aj_captcha_check_two($captchaType, $captchaVerification);
} catch (\Throwable $e) {
return app('json')->fail($e->getError());
}
try {
validate(RegisterValidates::class)->scene('code')->check(['phone' => $phone]);
} catch (ValidateException $e) {
@ -153,7 +159,6 @@ class LoginController
$smsCode = $this->services->verify($services, $phone, $type, $time, app()->request->ip());
if ($smsCode) {
CacheService::set('code_' . $phone, $smsCode, $time * 60);
Cache::set($keyName, $num + 1, 300);
Cache::set($nowKey, $total, 61);
return app('json')->success(410007);
} else {
@ -455,4 +460,32 @@ class LoginController
}
}
/**
* @return mixed
*/
public function ajcaptcha(Request $request)
{
$captchaType = $request->get('captchaType');
return app('json')->success(aj_captcha_create($captchaType));
}
/**
* 一次验证
* @return mixed
*/
public function ajcheck(Request $request)
{
[$token, $pointJson, $captchaType] = $request->postMore([
['token', ''],
['pointJson', ''],
['captchaType', ''],
], true);
try {
aj_captcha_check_one($captchaType, $token, $pointJson);
return app('json')->success();
} catch (\Throwable $e) {
return app('json')->fail(400336);
}
}
}

View File

@ -30,6 +30,10 @@ Route::group(function () {
Route::post('login/mobile', 'v1.LoginController/mobile')->name('loginMobile');
//图片验证码
Route::get('sms_captcha', 'v1.LoginController/captcha')->name('captcha');
//图形验证码
Route::get('ajcaptcha', 'v1.LoginController/ajcaptcha')->name('ajcaptcha');
//图形验证码
Route::post('ajcheck', 'v1.LoginController/ajcheck')->name('ajcheck');
//验证码发送
Route::post('register/verify', 'v1.LoginController/verify')->name('registerVerify');
//手机号注册

View File

@ -11,6 +11,7 @@
// 应用公共文件
use crmeb\services\CacheService;
use Fastknife\Service\ClickWordCaptchaService;
use think\exception\ValidateException;
use crmeb\services\FormBuilder as Form;
use app\services\other\UploadService;
@ -934,10 +935,14 @@ if (!function_exists('getLang')) {
$langCountryServices = app()->make(LangCountryServices::class);
$typeId = $langCountryServices->value(['code' => $range], 'type_id') ?: 1;
// 获取类型
$langData = CacheService::redisHandler()->remember('lang_type_data', function () {
/** @var LangTypeServices $langTypeServices */
$langTypeServices = app()->make(LangTypeServices::class);
return $langTypeServices->getColumn(['status' => 1, 'is_del' => 0], 'file_name', 'id');
}, 3600);
// 获取缓存key
/** @var LangTypeServices $langTypeServices */
$langTypeServices = app()->make(LangTypeServices::class);
$langData = $langTypeServices->getColumn(['status' => 1, 'is_del' => 0], 'file_name', 'id');
$langStr = 'lang_' . str_replace('-', '_', $langData[$typeId]);
//读取当前语言的语言包
@ -963,18 +968,30 @@ if (!function_exists('getLang')) {
}
}
if (!function_exists('aj_captcha_check')) {
if (!function_exists('aj_captcha_check_one')) {
/**
* 验证滑块
* 验证滑块1次验证
* @param string $token
* @param string $pointJson
* @return bool
*/
function aj_captcha_check(string $token, string $pointJson)
function aj_captcha_check_one(string $captchaType, string $token, string $pointJson)
{
$config = Config::get('ajcaptcha');
$service = new BlockPuzzleCaptchaService($config);
$service->check($token, $pointJson);
aj_get_serevice($captchaType)->check($token, $pointJson);
return true;
}
}
if (!function_exists('aj_captcha_check_two')) {
/**
* 验证滑块2次验证
* @param string $token
* @param string $pointJson
* @return bool
*/
function aj_captcha_check_two(string $captchaType, string $captchaVerification )
{
aj_get_serevice($captchaType)->verificationByEncryptCode($captchaVerification);
return true;
}
}
@ -985,10 +1002,31 @@ if (!function_exists('aj_captcha_create')) {
* 创建验证码
* @return array
*/
function aj_captcha_create()
function aj_captcha_create(string $captchaType)
{
$config = Config::get('ajcaptcha');
$service = new BlockPuzzleCaptchaService($config);
return $service->get();
return aj_get_serevice($captchaType)->get();
}
}
if (!function_exists('aj_get_serevice')) {
/**
* @param string $captchaType
* @return ClickWordCaptchaService|BlockPuzzleCaptchaService
*/
function aj_get_serevice(string $captchaType)
{
$config = Config::get('ajcaptcha');
switch ($captchaType) {
case "clickWord":
$service = new ClickWordCaptchaService($config);
break;
case "blockPuzzle":
$service = new BlockPuzzleCaptchaService($config);
break;
default:
throw new ValidateException('captchaType参数不正确!');
}
return $service;
}
}

View File

@ -245,22 +245,12 @@ class OrderJob extends BaseJobs
}
/**
* 支付成功短信提醒
* @param string $order_id
*/
public function mssageSendPaySuccess($order)
{
$switch = (bool)sys_config('lower_order_switch');
//模板变量
$pay_price = $order['pay_price'];
$order_id = $order['order_id'];
/** @var SmsService $smsServices */
$smsServices = app()->make(SmsService::class);
$smsServices->send($switch, $order['user_phone'], compact('order_id', 'pay_price'), 'order_pay_success');
}
/**计算节约金额
* 计算节约金额
* @param $order
* @return false|mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function setEconomizeMoney($order)
{
@ -293,7 +283,7 @@ class OrderJob extends BaseJobs
if ($cartInfo) {
foreach ($cartInfo as $k => $item) {
foreach ($item as $value) {
if ($value['price_type'] == 'member') $memberPrice += bcmul($value['vip_truePrice'], $value['cart_num'] ?: 1, 2);
if (isset($value['price_type']) && $value['price_type'] == 'member') $memberPrice += bcmul($value['vip_truePrice'], $value['cart_num'] ?: 1, 2);
}
}
}

View File

@ -64,7 +64,6 @@ class TemplateJob extends BaseJobs
$notifyServices = app()->make(SystemNotificationServices::class);
return $notifyServices->getNotInfo(['type' => $is_type, 'mark' => $tempCode])['tempid'];
});
return $template->send($tempid, $data);
} catch (\Exception $e) {
Log::error($e->getMessage());

View File

@ -136,7 +136,7 @@ class Notice implements ListenerInterface
$smsdata = ['nickname' => $nickname, 'store_name' => $storeTitle, 'order_id' => $orderInfo['order_id'], 'delivery_name' => $orderInfo['delivery_name'], 'delivery_id' => $orderInfo['delivery_id'], 'user_address' => $orderInfo['user_address']];
$SystemMsg->sendMsg($orderInfo['uid'], $smsdata);
//模板消息公众号模版消息
$WechatTemplateList->sendOrderPostage($orderInfo['uid'], $orderInfo->toArray(), $datas);
$WechatTemplateList->sendOrderPostage($orderInfo['uid'], $orderInfo->toArray(), $store_name);
//模板消息小程序订阅消息
$RoutineTemplateList->sendOrderPostage($orderInfo['uid'], $orderInfo->toArray(), $storeTitle, $isGive);
break;
@ -169,12 +169,15 @@ class Notice implements ListenerInterface
case 'order_refund':
$datas = $data['data'];
$order = $data['order'];
$order['refund_price'] = $datas['refund_price'];
$order['refund_no'] = $datas['refund_no'];
$storeName = $orderInfoServices->getCarIdByProductTitle($order['id'], $order['cart_id']);
$storeTitle = Str::substrUTf8($storeName, 20, 'UTF-8', '');
//站内信
$SystemMsg->sendMsg($order['uid'], ['order_id' => $order['order_id'], 'pay_price' => $order['pay_price'], 'refund_price' => $datas['refund_price']]);
//模板消息公众号模版消息
$WechatTemplateList->sendOrderRefundSuccess($order['uid'], $datas, $order);
$title = '亲,您购买的商品已退款';
$WechatTemplateList->sendOrderRefund($order['uid'], $order, $title);
//模板消息小程序订阅消息
$RoutineTemplateList->sendOrderRefundSuccess($order['uid'], $order, $storeTitle, $datas);
break;
@ -182,11 +185,13 @@ class Notice implements ListenerInterface
case 'send_order_refund_no_status':
$order = $data['orderInfo'];
$order['pay_price'] = $order['refund_price'];
$order['refund_no'] = $order['order_id'];
$storeTitle = Str::substrUTf8($order['cart_info'][0]['productInfo']['store_name'], 20, 'UTF-8', '');
//站内信
$SystemMsg->sendMsg($order['uid'], ['order_id' => $order['order_id'], 'pay_price' => $order['refund_price'], 'store_name' => $storeTitle]);
//模板消息公众号模版消息
$WechatTemplateList->sendOrderRefundNoStatus($order['uid'], $order);
$title = '亲,您的订单拒绝退款,点击查看原因';
$WechatTemplateList->sendOrderRefund($order['uid'], $order, $title);
//模板消息小程序订阅消息
$RoutineTemplateList->sendOrderRefundFail($order['uid'], $order, $storeTitle);
break;
@ -219,7 +224,7 @@ class Notice implements ListenerInterface
//站内信
$SystemMsg->sendMsg($order['uid'], ['order_id' => $order['order_id'], 'store_name' => $data['storeTitle'], 'pay_price' => $order['pay_price'], 'gain_integral' => $data['give_integral'], 'integral' => $data['integral']]);
//模板消息公众号模版消息
$WechatTemplateList->sendUserIntegral($order['uid'], $order);
$WechatTemplateList->sendUserIntegral($order['uid'], $order, $data);
//模板消息小程序订阅消息
$RoutineTemplateList->sendUserIntegral($order['uid'], $data['order'], $data['storeTitle'], $data['give_integral'], $data['integral']);
break;
@ -233,7 +238,7 @@ class Notice implements ListenerInterface
//站内信
$SystemMsg->sendMsg($spread_uid, ['goods_name' => $goodsName, 'goods_price' => $goodsPrice, 'brokerage_price' => $brokeragePrice]);
//模板消息公众号模版消息
$WechatTemplateList->sendOrderBrokerageSuccess($spread_uid, $brokeragePrice, $goodsName, $goodsPrice, $add_time);
$WechatTemplateList->sendOrderBrokerageSuccess($spread_uid, $brokeragePrice, $add_time);
//模板消息小程序订阅消息
$RoutineTemplateList->sendOrderBrokerageSuccess($spread_uid, $brokeragePrice, $goodsName);
break;
@ -249,6 +254,32 @@ class Notice implements ListenerInterface
//模板消息小程序订阅消息
$RoutineTemplateList->sendBargainSuccess($uid, $bargainInfo, $bargainUserInfo, $uid);
break;
//开团成功
case 'open_pink_success':
$orderInfo = $data['orderInfo'];
$title = $data['title'];
$pink = $data['pink'];
$nickname = $UserServices->value(['uid' => $orderInfo['uid']], 'nickname');
//站内信
$SystemMsg->sendMsg($orderInfo['uid'], ['title' => $title, 'nickname' => $nickname, 'count' => $pink['people'], 'pink_time' => date('Y-m-d H:i:s', $pink['add_time'])]);
//模板消息公众号模版消息
$WechatTemplateList->sendOrderPinkOpenSuccess($orderInfo['uid'], $pink, $title);
//模板消息小程序订阅消息
$RoutineTemplateList->sendPinkSuccess($orderInfo['uid'], $title, $nickname, $pink['add_time'], $pink['people'], '/pages/users/order_details/index?order_id=' . $pink['order_id']);
break;
//参团成功
case 'can_pink_success':
$orderInfo = $data['orderInfo'];
$title = $data['title'];
$pink = $data['pink'];
$nickname = $UserServices->value(['uid' => $orderInfo['uid']], 'nickname');
//站内信
$SystemMsg->sendMsg($orderInfo['uid'], ['title' => $title, 'nickname' => $nickname, 'count' => $pink['people'], 'pink_time' => date('Y-m-d H:i:s', $pink['add_time'])]);
//模板消息公众号模版消息
$WechatTemplateList->sendOrderPinkUseSuccess($orderInfo['uid'], $orderInfo, $title);
//模板消息小程序订阅消息
$RoutineTemplateList->sendPinkSuccess($orderInfo['uid'], $title, $nickname, $pink['add_time'], $pink['people'], '/pages/users/order_details/index?order_id=' . $pink['order_id']);
break;
//拼团成功
case 'order_user_groups_success':
$list = $data['list'];
@ -257,7 +288,7 @@ class Notice implements ListenerInterface
//站内信
$SystemMsg->sendMsg($list['uid'], ['title' => $title, 'nickname' => $list['nickname'], 'count' => $list['people'], 'pink_time' => date('Y-m-d H:i:s', $list['add_time'])]);
//模板消息公众号模版消息
$WechatTemplateList->sendOrderPinkSuccess($list['uid'], $list['order_id'], $list['id'], $title);
$WechatTemplateList->sendOrderPinkSuccess($list['uid'], $list, $title);
//模板消息小程序订阅消息
$RoutineTemplateList->sendPinkSuccess($list['uid'], $title, $list['nickname'], $list['add_time'], $list['people'], $url);
break;
@ -283,32 +314,6 @@ class Notice implements ListenerInterface
//模板消息小程序订阅消息
$RoutineTemplateList->sendPinkFail($uid, $pink->title, $pink->people, '亲,您拼团失败,自动为您申请退款,退款金额为:' . $pink->price, '/pages/order_details/index?order_id=' . $pink->order_id);
break;
//参团成功
case 'can_pink_success':
$orderInfo = $data['orderInfo'];
$title = $data['title'];
$pink = $data['pink'];
$nickname = $UserServices->value(['uid' => $orderInfo['uid']], 'nickname');
//站内信
$SystemMsg->sendMsg($orderInfo['uid'], ['title' => $title, 'nickname' => $nickname, 'count' => $pink['people'], 'pink_time' => date('Y-m-d H:i:s', $pink['add_time'])]);
//模板消息公众号模版消息
$WechatTemplateList->sendOrderPinkUseSuccess($orderInfo['uid'], $orderInfo['order_id'], $title, $orderInfo['pink_id']);
//模板消息小程序订阅消息
$RoutineTemplateList->sendPinkSuccess($orderInfo['uid'], $title, $nickname, $pink['add_time'], $pink['people'], '/pages/users/order_details/index?order_id=' . $pink['order_id']);
break;
//开团成功
case 'open_pink_success':
$orderInfo = $data['orderInfo'];
$title = $data['title'];
$pink = $data['pink'];
$nickname = $UserServices->value(['uid' => $orderInfo['uid']], 'nickname');
//站内信
$SystemMsg->sendMsg($orderInfo['uid'], ['title' => $title, 'nickname' => $nickname, 'count' => $pink['people'], 'pink_time' => date('Y-m-d H:i:s', $pink['add_time'])]);
//模板消息公众号模版消息
$WechatTemplateList->sendOrderPinkOpenSuccess($orderInfo['uid'], $pink, $title);
//模板消息小程序订阅消息
$RoutineTemplateList->sendPinkSuccess($orderInfo['uid'], $title, $nickname, $pink['add_time'], $pink['people'], '/pages/users/order_details/index?order_id=' . $pink['order_id']);
break;
//提现成功
case 'user_extract':
$extractNumber = $data['extractNumber'];
@ -338,24 +343,13 @@ class Notice implements ListenerInterface
case 'order_pay_false':
$order = $data['order'];
$order_id = $order['order_id'];
$order['storeName'] = $orderInfoServices->getCarIdByProductTitle($order['id'], $order['cart_id']);
//短信
$NoticeSms->sendSms($order['user_phone'], compact('order_id'));
//站内信
$SystemMsg->sendMsg($order['uid'], ['order_id' => $order_id]);
$WechatTemplateList->sendOrderPayFalse($order['uid'], $order);
break;
//申请退款给客服发消息
case 'send_order_apply_refund':
$order = $data['order'];
//站内信
$SystemMsg->kefuSystemSend(['order_id' => $order['order_id']]);
//短信
$NoticeSms->sendAdminRefund($order);
//公众号
// $WechatTemplateList->sendAdminNewRefund($order);
//企业微信通知
$EnterpriseWechat->sendMsg(['order_id' => $order['order_id']]);
break;
//新订单给客服
case 'admin_pay_success_code':
$order = $data;
@ -364,17 +358,14 @@ class Notice implements ListenerInterface
//短信
$NoticeSms->sendAdminPaySuccess($order);
//公众号小程序
// $WechatTemplateList->sendAdminNewOrder($order);
$storeName = $orderInfoServices->getCarIdByProductTitle($order['id'], $order['cart_id']);
$title = '亲,来新订单啦!';
$status = '新订单';
$link = '/pages/admin/orderDetail/index?id=' . $order['order_id'];
$WechatTemplateList->sendAdminOrder($order['order_id'], $storeName, $title, $status, $link);
//企业微信通知
$EnterpriseWechat->sendMsg(['order_id' => $order['order_id']]);
break;
//提现申请给客服
case 'kefu_send_extract_application':
//站内信
$SystemMsg->kefuSystemSend($data);
//企业微信通知
$EnterpriseWechat->sendMsg($data);
break;
//确认收货给客服
case 'send_admin_confirm_take_over':
$order = $data['order'];
@ -383,9 +374,38 @@ class Notice implements ListenerInterface
$SystemMsg->kefuSystemSend(['storeTitle' => $storeTitle, 'order_id' => $order['order_id']]);
//短信
$NoticeSms->sendAdminConfirmTakeOver($order);
//公众号
$storeName = $orderInfoServices->getCarIdByProductTitle($order['id'], $order['cart_id']);
$title = '亲,用户已经收到货物啦!';
$status = '订单收货';
$link = '/pages/admin/orderDetail/index?id=' . $order['order_id'];
$WechatTemplateList->sendAdminOrder($order['order_id'], $storeName, $title, $status, $link);
//企业微信通知
$EnterpriseWechat->sendMsg(['storeTitle' => $storeTitle, 'order_id' => $order['order_id']]);
break;
//申请退款给客服发消息
case 'send_order_apply_refund':
$order = $data['order'];
//站内信
$SystemMsg->kefuSystemSend(['order_id' => $order['order_id']]);
//短信
$NoticeSms->sendAdminRefund($order);
//企业微信通知
$EnterpriseWechat->sendMsg(['order_id' => $order['order_id']]);
//公众号
$storeName = $orderInfoServices->getCarIdByProductTitle($order['id'], $order['cart_id']);
$title = '亲,您有个退款订单待处理!';
$status = '订单退款';
$link = '/pages/admin/orderDetail/index?id=' . $order['refund_no'] . '&types=-3';
$WechatTemplateList->sendAdminOrder($order['refund_no'], $storeName, $title, $status, $link);
break;
//提现申请给客服
case 'kefu_send_extract_application':
//站内信
$SystemMsg->kefuSystemSend($data);
//企业微信通知
$EnterpriseWechat->sendMsg($data);
break;
}
}

View File

@ -16,7 +16,6 @@ use app\services\kefu\service\StoreServiceServices;
use app\services\message\MessageSystemServices;
use think\facade\Log;
/**
* 短信发送消息列表
* Created by PhpStorm.
@ -44,11 +43,11 @@ class SystemMsgService extends NoticeService
}
/**
* 发送消息
* @param $uid uid
* @param array $data 模板内容
* @param int $uid
* @param $data
* @return bool|void
*/
public function sendMsg(int $uid, $data)
{
@ -80,8 +79,8 @@ class SystemMsgService extends NoticeService
/**
* 给客服发站内信
* @param array $notceinfo
* @param array $data
* @param $data
* @return bool|void
*/
public function kefuSystemSend($data)
{
@ -114,6 +113,4 @@ class SystemMsgService extends NoticeService
return true;
}
}
}

View File

@ -80,6 +80,22 @@ class WechatTemplateListService extends NoticeService
}
}
/**
* 绑定成功通知
* @param string $uid
* @param string $userName
* @return bool|void
*/
public function sendBindSpreadUidSuccess(string $uid, string $userName)
{
return $this->sendTemplate((int)$uid, [
'first' => '恭喜,加入您的团队',
'keyword1' => $userName,
'keyword2' => date('Y-m-d H:i:s', time()),
'remark' => '授人以鱼不如授人以渔,一起分享赚钱吧,点击查看详情!'
], '/pages/users/promoter-list/index');
}
/**
* 支付成功发送模板消息
* @param $uid
@ -91,29 +107,16 @@ class WechatTemplateListService extends NoticeService
return $this->sendTemplate((int)$uid, [
'first' => '亲,您购买的商品已支付成功',
'keyword1' => $order['order_id'],
'keyword2' => $order['pay_price'],
'keyword2' => $order['storeName'],
'keyword3' => $order['pay_price'],
'keyword4' => $order['send_name'],
'keyword5' => date('Y-m-d H:i:s', $order['pay_time']),
'remark' => '点击查看订单详情'
], '/pages/users/order_details/index?order_id=' . $order['order_id']);
], '/pages/goods/order_details/index?order_id=' . $order['order_id']);
}
/**
* 购买会员成功
* @param $uid
* @param $order
* @return bool|void
*/
public function sendMemberOrderPaySuccess($uid, $order)
{
return $this->sendTemplate((int)$uid, [
'first' => '亲,购买会员成功,恭喜您成为本平台尊贵会员!',
'keyword1' => $order['order_id'],
'keyword2' => $order['pay_price'],
'remark' => '点击查看订单详情'
], '/pages/annex/vip_paid/index');
}
/**
* 订单发货
* 订单配送通知
* @param $uid
* @param string $goodsName
* @param $order
@ -123,61 +126,33 @@ class WechatTemplateListService extends NoticeService
public function sendOrderDeliver($uid, string $goodsName, $order, array $data)
{
return $this->sendTemplate((int)$uid, [
'first' => '亲,您的订单已发货,请注意查收',
'keyword1' => $goodsName,
'keyword2' => $order['pay_type'] == 'offline' ? '线下支付' : date('Y/m/d H:i', $order['pay_time']),
'keyword3' => $order['user_address'],
'keyword4' => $order['delivery_name'],
'keyword5' => $order['delivery_id'],
'first' => '亲,您的订单已开始送货,请注意查收',
'keyword1' => $order['order_id'],
'keyword2' => $order['pay_price'],
'keyword3' => $order['delivery_name'],
'keyword4' => $order['delivery_id'],
'remark' => '点击查看订单详情'
], '/pages/users/order_details/index?order_id=' . $order['order_id']);
], '/pages/goods/order_details/index?order_id=' . $order['order_id']);
}
/**
* 订单发货
* @param $uid
* @param $order
* @param array $data
* @param $storeTitle
* @return bool|void
*/
public function sendOrderPostage($uid, $order, array $data)
public function sendOrderPostage($uid, $order, $storeTitle)
{
return $this->sendTemplate((int)$uid, [
'keyword1' => $order['order_id'],
'keyword2' => $order['delivery_name'],
'keyword3' => $order['delivery_id'],
'first' => '亲,您的订单已发货,请注意查收',
'keyword1' => $order['order_id'],
'keyword2' => date('Y-m-d H:i:s', time()),
'keyword3' => $storeTitle,
'keyword4' => $order['delivery_name'],
'keyword5' => $order['delivery_id'],
'remark' => '点击查看订单详情'
], '/pages/users/order_details/index?order_id=' . $order['order_id']);
}
/**
* 发送客服消息
* @param $uid
* @param $data
* @return bool|void
*/
public function sendServiceNotice($uid, $data)
{
return $this->sendTemplate((int)$uid, [
'keyword1' => '新订单',
'keyword2' => $data['delivery_name'],
'keyword3' => $data['delivery_id'],
'first' => '亲,您有新的订单待处理',
'remark' => '点击查看订单详情'
], '/pages/users/order_details/index?order_id=' . $data['order_id']);
}
/**
* 退款发送客服消息
* @param $uid
* @param $data
* @param string|null $link
* @return bool|void
*/
public function sendRefundServiceNotice($uid, $data, ?string $link = null)
{
return $this->sendTemplate((int)$uid, $data, $link);
], '/pages/goods/order_details/index?order_id=' . $order['order_id']);
}
/**
@ -192,65 +167,67 @@ class WechatTemplateListService extends NoticeService
return $this->sendTemplate((int)$uid, [
'first' => '亲,您的订单已收货',
'keyword1' => $order['order_id'],
'keyword2' => '已收货',
'keyword3' => date('Y-m-d H:i:s', time()),
'keyword4' => $title,
'keyword2' => $title,
'keyword3' => $order['pay_price'],
'keyword4' => date('Y-m-d H:i:s', time()),
'remark' => '感谢您的光临!'
], '/pages/goods/order_details/index?order_id=' . $order['order_id']);
}
/**
* 订单改价
* @param $uid
* @param $order
* @return bool|void
*/
public function sendPriceRevision($uid, $order)
{
return $this->sendTemplate((int)$uid, [
'first' => '亲,您的订单已改价',
'keyword1' => $order['order_id'],
'keyword2' => $order['storeName'],
'keyword3' => date('Y-m-d H:i:s', $order['add_time']),
'keyword4' => $order['pay_price'],
'keyword5' => '未支付',
'remark' => '点击查看订单详情!'
], '/pages/goods/order_details/index?order_id=' . $order['order_id']);
}
/**
* 发送退款模板消息
* @param $uid
* @param $order
* @param $title
* @return bool|void
*/
public function sendOrderRefund($uid, $order, $title)
{
return $this->sendTemplate((int)$uid, [
'first' => $title,
'keyword1' => $order['pay_price'],
'keyword2' => date('Y-m-d H:i:s', time()),
'keyword3' => $order['refund_no'],
'remark' => '点击查看订单详情'
], '/pages/goods/order_details/index?order_id=' . $order['refund_no'] . '&isReturen=1');
}
/**
* 充值成功
* @param $uid
* @param $order
* @return bool|void
*/
public function sendRechargeSuccess($uid, $order)
{
return $this->sendTemplate((int)$uid, [
'first' => '亲,您的充值已成功',
'keyword1' => date('Y-m-d H:i:s', $order['add_time']),
'keyword2' => $order['price'],
'keyword3' => '充值成功',
'remark' => '感谢您的光临!'
]);
}
/**
* 发送退款申请模板消息
* @param $uid
* @param $order
* @return bool|void
*/
public function sendOrderApplyRefund($uid, $order)
{
return $this->sendTemplate((int)$uid, [
'first' => '你有一笔退款订单需要处理',
'keyword1' => $order['order_id'],
'keyword2' => $order['status'],
'keyword3' => date('Y-m-d H:i:s', $order['add_time']),
'remark' => '点击查看退款详情'
], '/pages/admin/orderDetail/index?id=' . $order['order_id']);
}
/**
* 发送退款模板消息
* @param $uid
* @param $data
* @param $order
* @return bool|void
*/
public function sendOrderRefundSuccess($uid, $data, $order)
{
return $this->sendTemplate((int)$uid, [
'first' => '亲,您购买的商品已退款,本次退款' . $data['refund_price'] . '金额',
'keyword1' => $data['order_id'],
'keyword2' => $order['pay_price'],
'keyword3' => date('Y-m-d H:i:s', $order['add_time']),
'remark' => '点击查看订单详情'
], '/pages/users/order_details/index?order_id=' . $data['order_id'] . '&isReturen=1');
}
/**
* 发送退款模板消息
* @param $uid
* @param $order
* @return bool|void
*/
public function sendOrderRefundNoStatus($uid, $order)
{
return $this->sendTemplate((int)$uid, [
'first' => '亲,您的退款申请未申请通过',
'keyword1' => $order['order_id'],
'keyword2' => $order['pay_price'],
'keyword3' => date('Y-m-d H:i:s', $order['add_time']),
'remark' => '点击查看订单详情'
], '/pages/users/order_details/index?order_id=' . $order['order_id'] . '&isReturen=1');
}
/**
* 发送用户充值退款模板消息
* @param $uid
@ -261,103 +238,49 @@ class WechatTemplateListService extends NoticeService
public function sendRechargeRefundStatus($uid, $data, $userRecharge)
{
return $this->sendTemplate((int)$uid, [
'first' => '亲,您充值的金额已退款,本次退款' .
$data['refund_price'] . '金额',
'keyword1' => $userRecharge['order_id'],
'keyword2' => $userRecharge['price'],
'keyword3' => date('Y-m-d H:i:s', $userRecharge['add_time']),
'first' => '亲,您充值的金额已退款',
'keyword1' => $data['refund_price'],
'keyword2' => date('Y-m-d H:i:s', $userRecharge['add_time']),
'keyword3' => $userRecharge['order_id'],
'remark' => '点击查看订单详情'
], '/pages/users/user_bill/index');
}
/**
* 拼团成功发送模板消息
* 获得积分
* @param $uid
* @param $order_id
* @param $pinkId
* @param $title
* @param $order
* @param $data
* @return bool|void
*/
public function sendOrderPinkSuccess($uid, $order_id, $pinkId, $title)
public function sendUserIntegral($uid, $order, $data)
{
return $this->sendTemplate((int)$uid, [
'first' => '亲,您的拼团已经完成了',
'keyword1' => $order_id,
'keyword2' => $title,
'remark' => '点击查看订单详情'
], '/pages/activity/goods_combination_status/index?id=' . $pinkId);
'first' => '亲,您的积分已到账',
'keyword1' => $data['storeTitle'],
'keyword2' => $order['pay_price'],
'keyword3' => $order['use_integral'],
'keyword4' => $data['give_integral'],
'keyword5' => date('Y-m-d H:i:s', $order['add_time']),
'remark' => '点击查看订单详情!'
], '/pages/goods/order_details/index?order_id=' . $order['order_id']);
}
/**
* 参团成功发送模板消息
* @param $uid
* @param string $order_id
* @param string $title
* @param int $pink_id
* 佣金到账发送模板消息
* @param string $uid
* @param string $brokeragePrice
* @param $orderTime
* @return bool|void
*/
public function sendOrderPinkUseSuccess($uid, string $order_id, string $title, int $pink_id)
public function sendOrderBrokerageSuccess(string $uid, string $brokeragePrice, $orderTime)
{
return $this->sendTemplate((int)$uid, [
'first' => '亲,您已成功参与拼团',
'keyword1' => $order_id,
'keyword2' => $title,
'remark' => '点击查看订单详情'
], '/pages/activity/goods_combination_status/index?id=' . $pink_id);
}
/**
* 取消拼团发送模板消息
* @param $uid
* @param $pink
* @param $title
* @return bool|void
*/
public function sendOrderPinkClone($uid, $pink, $title)
{
return $this->sendTemplate((int)$uid, [
'first' => '亲,您的拼团取消',
'keyword1' => $title,
'keyword2' => $pink->price,
'keyword3' => $pink->price,
'remark' => '点击查看订单详情'
], '/pages/activity/goods_combination_status/index?id=' . $pink->id);
}
/**
* 拼团失败发送模板消息
* @param $uid
* @param $pink
* @param $title
* @return bool|void
*/
public function sendOrderPinkFail($uid, $pink, $title)
{
return $this->sendTemplate((int)$uid, [
'first' => '亲,您的拼团失败',
'keyword1' => $title,
'keyword2' => $pink->price,
'keyword3' => $pink->price,
'remark' => '点击查看订单详情'
], '/pages/activity/goods_combination_status/index?id=' . $pink->id);
}
/**
* 开团成功发送模板消息
* @param $uid
* @param $pink
* @param $title
* @return bool|void
*/
public function sendOrderPinkOpenSuccess($uid, $pink, $title)
{
return $this->sendTemplate((int)$uid, [
'first' => '您好,您已成功开团!赶紧与小伙伴们分享吧!!!',
'keyword1' => $title,
'keyword2' => $pink['total_price'],
'keyword3' => $pink['people'],
'remark' => '点击查看订单详情'
], '/pages/activity/goods_combination_status/index?id=' . $pink['id']);
'first' => '亲,您有一笔佣金入账!',
'keyword1' => $brokeragePrice,//分销佣金
'keyword2' => date('Y-m-d H:i:s', $orderTime),//结算时间
'remark' => '点击查看佣金详情'
], '/pages/users/user_spread_money/index?type=2');
}
/**
@ -373,162 +296,108 @@ class WechatTemplateListService extends NoticeService
return $this->sendTemplate((int)$uid, [
'first' => '好腻害!你的朋友们已经帮你砍到底价了!',
'keyword1' => $bargain['title'],
'keyword2' => $bargain['min_price'],
'keyword2' => $bargain['price'],
'keyword3' => $bargain['min_price'],
'keyword4' => date('Y-m-d H:i:s', time()),
'remark' => '点击查看订单详情'
], '/pages/activity/goods_bargain_details/index?id=' . $bargain['id'] . '&bargain=' . $bargainUserId);
}
/**
* 佣金到账发送模板消息
* @param string $uid
* @param string $brokeragePrice
* @param string $goodsName
* @param string $goodsPrice
* @param $orderTime
* 开团成功发送模板消息
* @param $uid
* @param $pink
* @param $title
* @return bool|void
*/
public function sendOrderBrokerageSuccess(string $uid, string $brokeragePrice, string $goodsName, string $goodsPrice, $orderTime)
public function sendOrderPinkOpenSuccess($uid, $pink, $title)
{
return $this->sendTemplate((int)$uid, [
'first' => '亲,您有一笔佣金入账!',
'keyword1' => $brokeragePrice,//分销佣金
'keyword2' => $goodsPrice . "元",//交易金额
'keyword3' => date('Y-m-d H:i:s', $orderTime),//结算时间
'first' => '您好,您已成功开团!赶紧与小伙伴们分享吧!!!',
'keyword1' => $title,
'keyword2' => $pink['nickname'],
'keyword3' => $pink['people'],
'keyword4' => date('Y-m-d H:i:s', $pink['stop_time']),
'remark' => '点击查看订单详情'
], '/pages/users/user_spread_user/index');
], '/pages/activity/goods_combination_status/index?id=' . $pink['id']);
}
/**
* 绑定推广关系发送消息提醒
* @param string $uid
* @param string $userName
* @return bool|void
*/
public function sendBindSpreadUidSuccess(string $uid, string $userName)
{
return $this->sendTemplate((int)$uid, [
'first' => '恭喜,加入您的团队',
'keyword1' => $userName,
'keyword2' => date('Y-m-d H:i:s', time()),
'remark' => '授人以鱼不如授人以渔,一起分享赚钱吧,点击查看详情!'
], '/pages/users/user_spread_user/index');
}
/**
* 新订单给客服提醒
* @param $order
* @return bool
*/
public function sendAdminNewOrder($order)
{
/** @var StoreServiceServices $StoreServiceServices */
$StoreServiceServices = app()->make(StoreServiceServices::class);
$adminList = $StoreServiceServices->getStoreServiceOrderNotice();
foreach ($adminList as $item) {
$this->sendTemplate((int)$item['uid'],
[
'keyword1' => '新订单',
'keyword2' => $order['delivery_name'],
'keyword3' => $order['delivery_id'],
'first' => '亲,您有新的订单待处理',
'remark' => '点击查看订单详情'
], '/pages/admin/orderDetail/index?id=' . $order['order_id']);
}
return true;
}
/**
* 退款给客服提醒
* @param $order
* @return bool
*/
public function sendAdminNewRefund($order)
{
/** @var StoreServiceServices $StoreServiceServices */
$StoreServiceServices = app()->make(StoreServiceServices::class);
$adminList = $StoreServiceServices->getStoreServiceOrderNotice();
foreach ($adminList as $item) {
$this->sendTemplate((int)$item['uid'],
[
'keyword1' => '退款申请',
'keyword2' => $order['delivery_name'],
'keyword3' => $order['delivery_id'],
'first' => '亲,您有个退款订单待处理',
'remark' => '点击查看订单详情'
], '/pages/admin/orderDetail/index?id=' . $order['order_id']);
}
return true;
}
/**
* 订单改价
* 参团成功发送模板消息
* @param $uid
* @param $order
* @param $orderInfo
* @param string $title
* @return bool|void
*/
public function sendPriceRevision($uid, $order)
public function sendOrderPinkUseSuccess($uid, $orderInfo, string $title)
{
return $this->sendTemplate((int)$uid, [
'first' => '亲,您的订单已改价',
'keyword1' => $order['order_id'],
'keyword2' => $order['pay_price'],
'remark' => '点击查看订单详情!'
], '/pages/users/order_details/index?order_id=' . $order['order_id']);
'first' => '亲,您已成功参与拼团',
'keyword1' => $orderInfo['order_id'],
'keyword2' => $title,
'keyword3' => $orderInfo['pay_price'],
'keyword4' => '参团成功',
'remark' => '点击查看订单详情'
], '/pages/activity/goods_combination_status/index?id=' . $orderInfo['pink_id']);
}
/**
* 充值成功
* 拼团成功发送模板消息
* @param $uid
* @param $order
* @param $order_id
* @param $pinkId
* @param $title
* @return bool|void
*/
public function sendRechargeSuccess($uid, $order)
public function sendOrderPinkSuccess($uid, $orderInfo, $title)
{
return $this->sendTemplate((int)$uid, [
'first' => '亲,您的充值已成功',
'keyword1' => $uid,
'keyword2' => $order['price'],
'keyword3' => $order['order_id'],
'keyword4' => date('Y-m-d H:i:s', $order['add_time']),
'remark' => '感谢您的光临!'
]);
'first' => '亲,您的拼团已经完成了',
'keyword1' => $orderInfo['order_id'],
'keyword2' => $title,
'keyword3' => $orderInfo['total_price'],
'keyword4' => '拼团完成',
'remark' => '点击查看订单详情'
], '/pages/activity/goods_combination_status/index?id=' . $orderInfo['id']);
}
/**
* 获得积分
* 取消拼团发送模板消息
* @param $uid
* @param $order
* @param $pink
* @param $title
* @return bool|void
*/
public function sendUserIntegral($uid, $order)
public function sendOrderPinkClone($uid, $pink, $title)
{
return $this->sendTemplate((int)$uid, [
'first' => '亲,您的积分已到账',
'keyword1' => $uid,
'keyword2' => $order['pay_price'],
'keyword3' => $order['use_integral'],
'keyword4' => $order['gain_integral'],
'keyword5' => date('Y-m-d H:i:s', $order['add_time']),
'remark' => '点击查看订单详情!'
], '/pages/users/order_details/index?order_id=' . $order['order_id']);
'first' => '亲,您的拼团取消',
'keyword1' => $pink['order_id'],
'keyword2' => $title,
'keyword3' => '拼团失败',
'keyword4' => '用户取消拼团',
'remark' => '点击查看订单详情'
], '/pages/activity/goods_combination_status/index?id=' . $pink->id);
}
/**
* 提醒付款通知
* 拼团失败发送模板消息
* @param $uid
* @param $order
* @param $pink
* @param $title
* @return bool|void
*/
public function sendOrderPayFalse($uid, $order)
public function sendOrderPinkFail($uid, $pink, $title)
{
return $this->sendTemplate((int)$uid, [
'first' => '亲,您有订单还未付款',
'keyword1' => $order['order_id'],
'keyword2' => $order['pay_price'],
'keyword3' => date('Y-m-d H:i:s', $order['add_time']),
'remark' => '感谢您的光临!'
]);
'first' => '亲,您的拼团失败',
'keyword1' => $pink['order_id'],
'keyword2' => $title,
'keyword3' => '拼团失败',
'keyword4' => '拼团时间超时',
'remark' => '点击查看订单详情'
], '/pages/activity/goods_combination_status/index?id=' . $pink->id);
}
/**
@ -543,7 +412,8 @@ class WechatTemplateListService extends NoticeService
'first' => '亲,您的提现申请已通过',
'keyword1' => $extractNumber,
'keyword2' => date('Y-m-d H:i:s', time()),
'keywords' => '已通过',
'keyword3' => '已通过',
'keyword4' => '已通过',
'remark' => '感谢您的光临!'
]);
}
@ -565,4 +435,49 @@ class WechatTemplateListService extends NoticeService
'remark' => '请联系管理员!'
]);
}
/**
* 提醒付款通知
* @param $uid
* @param $order
* @return bool|void
*/
public function sendOrderPayFalse($uid, $order)
{
return $this->sendTemplate((int)$uid, [
'first' => '亲,您有订单还未付款',
'keyword1' => $order['pay_price'],
'keyword2' => $order['storeName'],
'keyword3' => $order['order_id'],
'remark' => '感谢您的光临!'
], '/pages/goods/order_details/index?order_id=' . $order['order_id']);
}
/**
* 订单给客服提醒
* @param $orderId
* @param $storeName
* @param $title
* @param $status
* @param $link
* @return bool
*/
public function sendAdminOrder($orderId, $storeName, $title, $status, $link)
{
/** @var StoreServiceServices $StoreServiceServices */
$StoreServiceServices = app()->make(StoreServiceServices::class);
$adminList = $StoreServiceServices->getStoreServiceOrderNotice();
foreach ($adminList as $item) {
$this->sendTemplate((int)$item['uid'],
[
'first' => $title,
'keyword1' => $orderId,
'keyword2' => $storeName,
'keyword3' => $status,
'keyword4' => date('Y-m-d H:i:s', time()),
'remark' => '点击查看订单详情'
], $link);
}
return true;
}
}

View File

@ -334,33 +334,32 @@ class OtherOrderServices extends BaseServices
$orderInfo['phone'] = $userInfo['phone'];
$capitalFlowServices->setFlow($orderInfo, $type);
}
//用户推送消息事件
event('notice.notice', [$orderInfo, 'order_pay_success']);
//支付成功给客服发送消息
event('notice.notice', [$orderInfo, 'admin_pay_success_code']);
$res = $res1 && $res2 && $res3 && $res4;
return false !== $res;
}
/**
* 修改
* @param array $where
* @param $where
* @param array $data
* @return mixed
* @return \crmeb\basic\BaseModel
*/
public function update(array $where, array $data)
public function update($where, array $data)
{
return $this->dao->update($where, $data);
}
/**
* 购买会员卡数据校验
* @param $memberType
* @param $pay_price
* @param $type
* @param string $memberType
* @param string $payPrice
* @param string $type
* @param $uid
* @param $mcId
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function checkPayMemberType(string $memberType, string $payPrice, string $type, $uid, $mcId)
{

View File

@ -22,6 +22,7 @@ use crmeb\exceptions\AdminException;
use crmeb\exceptions\ApiException;
use crmeb\services\FormBuilder as Form;
use app\services\shipping\ExpressServices;
use think\facade\Log;
/**
* 订单发货
@ -439,9 +440,11 @@ class StoreOrderDeliveryServices extends BaseServices
switch ($type) {
case 1://快递发货
$this->orderDeliverGoods($id, $data, $orderInfo, $storeName);
event('notice.notice', [['orderInfo' => $orderInfo, 'storeName' => $storeName, 'data' => $data], 'order_postage_success']);
break;
case 2://配送
$this->orderDelivery($id, $data, $orderInfo, $storeName);
event('notice.notice', [['orderInfo' => $orderInfo, 'storeName' => $storeName, 'data' => $data], 'order_deliver_success']);
break;
case 3://虚拟发货
$this->orderVirtualDelivery($id, $data, $orderInfo, $storeName);
@ -449,9 +452,8 @@ class StoreOrderDeliveryServices extends BaseServices
default:
throw new AdminException(400522);
}
//用户推送消息事件
event('notice.notice', [['orderInfo' => $orderInfo, 'storeName' => $storeName, 'data' => $data], 'order_deliver_success']);
event('order.delivery', [$orderInfo, $storeName, $data, $type]);
//到期自动收货
event('order.orderDelivery', [$orderInfo, $storeName, $data, $type]);
return true;
}

View File

@ -948,7 +948,7 @@ class StoreOrderRefundServices extends BaseServices
$refundData['refund_num'] = $refund_num;
$refundData['refund_type'] = $refundType;
$refundData['refund_price'] = $refund_price;
$refundData['order_id'] = app()->make(StoreOrderCreateServices::class)->getNewOrderId('');
$refundData['order_id'] = $order['refund_no'] = app()->make(StoreOrderCreateServices::class)->getNewOrderId('');
$refundData['add_time'] = time();
$refundData['cart_info'] = json_encode(array_column($cartInfos, 'cart_info'));
$refundData['is_pink_cancel'] = $isPink;

View File

@ -58,7 +58,12 @@ class StoreOrderSuccessServices extends BaseServices
* 支付成功
* @param array $orderInfo
* @param string $paytype
* @param array $other
* @return bool
* @throws \Psr\SimpleCache\InvalidArgumentException
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function paySuccess(array $orderInfo, string $paytype = PayServices::WEIXIN_PAY, array $other = [])
{
@ -67,6 +72,9 @@ class StoreOrderSuccessServices extends BaseServices
if ($other && isset($other['trade_no'])) {
$updata['trade_no'] = $other['trade_no'];
}
/** @var StoreOrderCartInfoServices $orderInfoServices */
$orderInfoServices = app()->make(StoreOrderCartInfoServices::class);
$orderInfo['storeName'] = $orderInfoServices->getCarIdByProductTitle((int)$orderInfo['id'], $orderInfo['cart_id']);
$res1 = $this->dao->update($orderInfo['id'], $updata);
$resPink = true;
if ($orderInfo['combination_id'] && $res1 && !$orderInfo['refund_status']) {
@ -82,6 +90,7 @@ class StoreOrderSuccessServices extends BaseServices
$luckLotteryServices = app()->make(LuckLotteryServices::class);
$luckLotteryServices->setCacheLotteryNum((int)$orderInfo['uid'], 'order');
}
$orderInfo['send_name'] = $orderInfo['real_name'];
//订单支付成功后置事件
event('order.orderPaySuccess', [$orderInfo]);
//用户推送消息事件

View File

@ -134,6 +134,9 @@ class StoreOrderTakeServices extends BaseServices
* @param $userInfo
* @param $storeTitle
* @return bool
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function gainUserIntegral($order, $userInfo, $storeTitle)
{
@ -159,6 +162,8 @@ class StoreOrderTakeServices extends BaseServices
$integral = $userInfo['integral'] + $order['gain_integral'];
$userInfo->integral = $integral;
$res1 = false != $userInfo->save();
} else {
$res2 = true;
}
$order_integral = 0;
@ -175,7 +180,6 @@ class StoreOrderTakeServices extends BaseServices
}
}
$order_integral = bcmul((string)$order_give_integral, (string)($order_integral ?: $order['pay_price']), 0);
$res3 = false != $userBillServices->income('order_give_integral', $order['uid'], $order_integral, $userInfo['integral'] + $order_integral, $order['id']);
$integral = $userInfo['integral'] + $order_integral;
$userInfo->integral = $integral;
@ -316,7 +320,7 @@ class StoreOrderTakeServices extends BaseServices
$userBrokerageServices->income('get_pink_master_brokerage', $pinkMasterUid, [
'number' => floatval($pinkMasterPrice),
'frozen_time' => $frozen_time
], bcadd((string)$userInfo['brokerage_price'],$pinkMasterPrice,2), $orderInfo['id']);
], bcadd((string)$userInfo['brokerage_price'], $pinkMasterPrice, 2), $orderInfo['id']);
}
}
if (!$combinationInfo['is_commission']) {

View File

@ -43,13 +43,13 @@ class AdminAuthServices extends BaseServices
* @return array
* @throws \Psr\SimpleCache\InvalidArgumentException
*/
public function parseToken(string $token): array
public function parseToken(string $token,int $code = 110003): array
{
/** @var CacheService $cacheService */
$cacheService = app()->make(CacheService::class);
if (!$token || $token === 'undefined') {
throw new AuthException(110003);
throw new AuthException($code);
}
/** @var JwtAuth $jwtAuth */
$jwtAuth = app()->make(JwtAuth::class);
@ -60,7 +60,7 @@ class AdminAuthServices extends BaseServices
$md5Token = md5($token);
if (!$cacheService->hasToken($md5Token) || !($cacheToken = $cacheService->getTokenBucket($md5Token))) {
$this->authFailAfter($id, $type);
throw new AuthException(110003);
throw new AuthException($code);
}
//是否超出有效次数
if (isset($cacheToken['invalidNum']) && $cacheToken['invalidNum'] >= 3) {
@ -68,7 +68,7 @@ class AdminAuthServices extends BaseServices
$cacheService->clearToken($md5Token);
}
$this->authFailAfter($id, $type);
throw new AuthException(110003);
throw new AuthException($code);
}
@ -84,7 +84,7 @@ class AdminAuthServices extends BaseServices
$cacheService->clearToken($md5Token);
}
$this->authFailAfter($id, $type);
throw new AuthException(110003);
throw new AuthException($code);
}
//获取管理员信息
@ -94,10 +94,10 @@ class AdminAuthServices extends BaseServices
$cacheService->clearToken($md5Token);
}
$this->authFailAfter($id, $type);
throw new AuthException(110003);
throw new AuthException($code);
}
if ($pwd !== md5($adminInfo->pwd)) {
throw new AuthException(110003);
throw new AuthException($code);
}
$adminInfo->type = $type;

View File

@ -79,6 +79,35 @@ class SystemAdminServices extends BaseServices
return $adminInfo;
}
/**
* 文件管理员登陆
* @param string $account
* @param string $password
* @return array|\think\Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function verifyFileLogin(string $account, string $password)
{
$adminInfo = $this->dao->accountByAdmin($account);
if (!$adminInfo) {
throw new AdminException(400594);
}
if (!$adminInfo->status) {
throw new AdminException(400595);
}
if (!password_verify($password, $adminInfo->file_pwd)) {
throw new AdminException(400140);
}
$adminInfo->last_time = time();
$adminInfo->last_ip = app('request')->ip();
$adminInfo->login_count++;
$adminInfo->save();
return $adminInfo;
}
/**
* 后台登陆获取菜单获取token
* @param string $account
@ -327,6 +356,15 @@ class SystemAdminServices extends BaseServices
throw new AdminException(400264);
$adminInfo->pwd = $this->passwordHash($data['new_pwd']);
}
if($data['file_pwd'])
{
if($adminInfo->level != 0) throw new AdminException(400611);
if (!$data['conf_file_pwd'])
throw new AdminException(400263);
if($data['file_pwd'] != $data['conf_file_pwd'])
throw new AdminException(400264);
$adminInfo->file_pwd = $this->passwordHash($data['file_pwd']);
}
$adminInfo->real_name = $data['real_name'];
$adminInfo->head_pic = $data['head_pic'];

View File

@ -14,6 +14,7 @@ namespace app\services\system\log;
use app\dao\system\log\SystemFileDao;
use app\services\BaseServices;
use app\services\system\admin\SystemAdminServices;
use crmeb\exceptions\AdminException;
use crmeb\services\CacheService;
use crmeb\services\FileService as FileClass;
@ -35,6 +36,32 @@ class SystemFileServices extends BaseServices
$this->dao = $dao;
}
/**
* @param array $admin
* @param string $password
* @param string $type
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*
* @date 2022/09/07
* @author yyw
*/
public function Login($account, string $password, string $type)
{
/** @var SystemAdminServices $adminServer */
$adminServer = app()->make(SystemAdminServices::class);
$adminInfo = $adminServer->verifyFileLogin($account, $password);
$tokenInfo = $this->createToken($adminInfo->id, $type,$adminInfo->pwd);
return [
'token' => $tokenInfo['token'],
'expires_time' => $tokenInfo['params']['exp'],
];
}
/**
* 获取文件校验列表
* @return array
@ -191,11 +218,19 @@ class SystemFileServices extends BaseServices
$rootdir = str_replace('\\', '\\\\', $rootdir);
}
$list = array_merge($fileAll['dir'], $fileAll['file']);
$navList = [];
foreach ($list as $key => $value) {
$list[$key]['real_path'] = str_replace($rootdir, '', $value['pathname']);
$list[$key]['mtime'] = date('Y-m-d H:i:s', $value['mtime']);
$navList[$key]['title'] = $value['filename'];
if($value['isDir']) $navList[$key]['loading'] = false;
$navList[$key]['children'] = [];
$navList[$key]['path'] = $value['path'];
$navList[$key]['isDir'] = $value['isDir'];
$navList[$key]['pathname'] = $value['pathname'];
}
return compact('dir', 'list');
return compact('dir', 'list','navList');
}
//读取文件
@ -205,11 +240,16 @@ class SystemFileServices extends BaseServices
$ext = FileClass::getExt($filepath);
$extarray = [
'js' => 'text/javascript'
, 'htm' => 'text/html'
, 'shtml' => 'text/html'
, 'xml' => 'text/xml'
, 'php' => 'text/x-php'
, 'html' => 'text/html'
, 'sql' => 'text/x-mysql'
, 'css' => 'text/x-scss'];
$mode = empty($extarray[$ext]) ? '' : $extarray[$ext];
, 'css' => 'text/x-scss'
, 'txt'=>'text/plain'
];
$mode = empty($extarray[$ext]) ? 'text/plain' : $extarray[$ext];
return compact('content', 'mode', 'filepath');
}
@ -225,4 +265,47 @@ class SystemFileServices extends BaseServices
}
return FileClass::writeFile($filepath, $comment);
}
public function delFolder(string $path)
{
if (!file_exists($path)) {
return false;
}
if(is_file($path))
{
return unlink($path);
}
$dir = opendir($path);
while ($fileName = readdir($dir)) {
$file = $path . '/' . $fileName;
if ($fileName != '.' && $fileName != '..') {
if (is_dir($file)) {
self::delDir($file);
} else {
unlink($file);
}
}
}
closedir($dir);
return rmdir($path);
}
public function createFolder(string $path, int $permissions = 0755)
{
/** @var FileClass $fileClass */
$fileClass = app()->make(FileClass::class);
return $fileClass->createDir($path,$permissions);
}
public function createFile(string $path)
{
/** @var FileClass $fileClass */
$fileClass = app()->make(FileClass::class);
return $fileClass->createFile($path);
}
public function copyFolder($surDir,$toDir)
{
return FileClass::copyDir($surDir,$toDir);
}
}

View File

@ -25,11 +25,11 @@ return [
'watermark' => [
'fontsize' => 12,
'color' => '#000000',
'text' => '我的水印'
'text' => 'CRMEB标准版'
],
'cache' => [
//若您使用了框架,并且想使用类似于redis这样的缓存驱动,则应换成框架的中的缓存驱动
'constructor' => [think\Facade\Cache::class, 'instance'],
'constructor' => app()->make(\think\Cache::class),
'method' => [
//遵守PSR-16规范不需要设置此项(tp6, laravel,hyperf)。如tp5就不支持(tp5缓存方法是rm,所以要配置为"delete" => "rm")
/**

View File

@ -28,7 +28,7 @@ return [
// 跨域header
'header' => [
'Access-Control-Allow-Origin' => '*',
'Access-Control-Allow-Headers' => 'Authori-zation,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With, Form-type, Cb-lang',
'Access-Control-Allow-Headers' => 'Authori-zation,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With, Form-type, Cb-lang, Invalid-zation',
'Access-Control-Allow-Methods' => 'GET,POST,PATCH,PUT,DELETE,OPTIONS,DELETE',
'Access-Control-Max-Age' => '1728000',
'Access-Control-Allow-Credentials' => 'true'

View File

@ -33476,7 +33476,9 @@ INSERT INTO `eb_system_menus` (`id`, `pid`, `icon`, `menu_name`, `module`, `cont
(1067, 25, '', '语言设置', 'admin', '', '', '', '', '[]', 0, 1, 0, 1, '/admin/setting/lang', '25', 1, '', 0, 'admin-lang', 0),
(1068, 1067, '', '语言列表', 'admin', '', '', '', '', '[]', 0, 1, 0, 1, '/admin/setting/lang/list', '12/1067', 1, '', 0, 'admin-lang-list', 0),
(1069, 1067, '', '语言详情', 'admin', '', '', '', '', '[]', 0, 1, 0, 1, '/admin/setting/lang/info', '12/1067', 1, '', 0, 'admin-lang-info', 0),
(1070, 1067, '', '国家列表', 'admin', '', '', '', '', '[]', 0, 1, 0, 1, '/admin/setting/lang/country', '25/1067', 1, '', 0, 'admin-lang-country', 0);
(1070, 1067, '', '地区列表', 'admin', '', '', '', '', '[]', 0, 1, 0, 1, '/admin/setting/lang/country', '25/1067', 1, '', 0, 'admin-lang-country', 0),
(1071, 25, '', '文件管理', 'admin', '', '', '', '', '[]', 0, 1, 0, 1, '/admin/system/maintain/system_file/opendir', '25', 1, '', 0, 'system-maintain-system-file', 0);
-- --------------------------------------------------------
--
@ -33748,23 +33750,24 @@ INSERT INTO `eb_template_message` (`id`, `notification_id`, `type`, `tempkey`, `
(12, 2, 0, '1927', '付款成功通知', '', '付款单号{{character_string1.DATA}}\n付款金额{{amount2.DATA}}\n付款时间{{date3.DATA}}', '', '', '1637554360', 1),
(14, 8, 0, '335', '积分到账提醒', '', '订单编号{{character_string2.DATA}}\n商品名称{{thing3.DATA}}\n支付金额{{amount4.DATA}}\n获得积分{{number5.DATA}}\n累计积分{{number6.DATA}}', '', '', '1637554360', 1),
(15, 12, 0, '3353', '拼团状态通知', '', '商品名称{{thing2.DATA}}\n拼团人数{{thing1.DATA}}\n备注{{thing3.DATA}}', '', '', '1637554360', 1),
(16, 21, 1, 'OPENTM200565259', '订单发货提醒', '', '{{first.DATA}}\n订单编号:{{keyword1.DATA}}\n物流公司:{{keyword2.DATA}}\n物流单号:{{keyword3.DATA}}\n{{remark.DATA}}', '', '', '1515052638', 1),
(17, 3, 1, 'OPENTM413386489', '订单收货通知', '', '{{first.DATA}}\n订单编号:{{keyword1.DATA}}\n订单状态:{{keyword2.DATA}}\n收货时间:{{keyword3.DATA}}\n商品详情:{{keyword4.DATA}}\n{{remark.DATA}}', '', '', '1515052765', 1),
(18, 5, 1, 'OPENTM410119152', '退款进度通知', '', '{{first.DATA}}\n订单编号:{{keyword1.DATA}}\n订单金额:{{keyword2.DATA}}\n下单时间:{{keyword3.DATA}}\n{{remark.DATA}}', '', '', '1515053049', 1),
(20, 20, 1, 'OPENTM207707249', '订单发货提醒', '', '{{first.DATA}}\r\n商品明细:{{keyword1.DATA}}\r\n下单时间:{{keyword2.DATA}}\r\n配送地址:{{keyword3.DATA}}\r\n配送人:{{keyword4.DATA}}\r\n联系电话:{{keyword5.DATA}}\r\n{{remark.DATA}}', '', '', '1515053313', 1),
(23, 11, 1, 'OPENTM407456411', '拼团成功通知', '', '{{first.DATA}}\n订单编号:{{keyword1.DATA}}\n团购商品:{{keyword2.DATA}}\n{{remark.DATA}}', '', '', '1520063823', 1),
(24, 12, 1, 'OPENTM401113750', '拼团失败通知', '', '{{first.DATA}}\n拼团商品:{{keyword1.DATA}}\n商品金额:{{keyword2.DATA}}\n退款金额:{{keyword3.DATA}}\n{{remark.DATA}}', '', '', '1520064059', 1),
(26, 2, 1, 'OPENTM207791277', '订单支付成功通知', '', '{{first.DATA}}\n订单编号:{{keyword1.DATA}}\n支付金额:{{keyword2.DATA}}\n{{remark.DATA}}', '', '', '1528966759', 1),
(27, 10, 1, 'OPENTM410292733', '砍价成功提醒', '', '{{first.DATA}}\n商品名称:{{keyword1.DATA}}\n底价:{{keyword2.DATA}}\n{{remark.DATA}}', '', '', '1564566678', 1),
(28, 23, 1, 'OPENTM414349441', '开团成功通知', '', '{{first.DATA}}\n拼团名称:{{keyword1.DATA}}\n团购价格:{{keyword2.DATA}}\n拼团人数:{{keyword3.DATA}}\n{{remark.DATA}}', '', '', '1564567037', 1),
(30, 9, 1, 'OPENTM409909643', '佣金到账提醒', '', '{{first.DATA}}\r\n分销佣金:{{keyword1.DATA}}\r\n交易金额:{{keyword2.DATA}}\r\n结算时间:{{keyword3.DATA}}\r\n{{remark.DATA}}', '', '', '1602500478', 1),
(31, 1, 1, 'OPENTM410239001', '下级推广者绑定成功提醒', '', '{{first.DATA}}\r\n关联用户:{{keyword1.DATA}}\r\n关联说明:{{keyword2.DATA}}\r\n{{remark.DATA}}', '', '', '1602558146', 1),
(36, 4, 1, 'OPENTM410137124', '改价提醒发送', '', '{{first.DATA}}\r\n订单编号:{{keyword1.DATA}}\r\n订单金额:{{keyword2.DATA}}\r\n{{remark.DATA}}', '', '', '1632305076', 1),
(37, 7, 1, 'OPENTM411706852', '充值成功提醒发送', '', '{{first.DATA}}\r\n会员账号:{{keyword1.DATA}}\r\n充值金额:{{keyword2.DATA}}\r\n充值订单:{{keyword3.DATA}}\r\n充值时间:{{keyword4.DATA}}\r\n{{remark.DATA}}', '', '', '1632305076', 1),
(38, 14, 1, 'OPENTM418265600', '提现成功提醒发送', '', '{{first.DATA}}\r\n提现金额:{{keyword1.DATA}}\r\n申请时间:{{keyword2.DATA}}\r\n提现状态:{{keyword3.DATA}}\r\n{{remark.DATA}}', '', '', '1632305076', 1),
(39, 15, 1, 'OPENTM408529050', '提现失败提醒发送', '', '{{first.DATA}}\r\n提现金额:{{keyword1.DATA}}\r\n提现时间:{{keyword2.DATA}}\r\n失败原因:{{keyword3.DATA}}\r\n{{remark.DATA}}', '', '', '1632305076', 1),
(40, 26, 1, 'OPENTM413741318', '提醒付款通知', '', '{{first.DATA}}\r\n订单编号:{{keyword1.DATA}}\r\n订单金额:{{keyword2.DATA}}\r\n下单时间:{{keyword3.DATA}}\r\n{{remark.DATA}}', '', '', '1632305076', 1),
(41, 8, 1, 'OPENTM418252271', '积分到账提醒发送', '', '{{first.DATA}}\r\n会员ID:{{keyword1.DATA}}\r\n消费金额:{{keyword2.DATA}}\r\n使用积分:{{keyword3.DATA}}\r\n获得积分:{{keyword4.DATA}}\r\n时间:{{keyword5.DATA}}\r\n{{remark.DATA}}', '', '', '1632305076', 1);
(16, 21, 1, 'OPENTM415939287', '订单发货通知', '', '{{first.DATA}}\n订单编号:{{keyword1.DATA}}\n发货日期:{{keyword2.DATA}}\n商品详细:{{keyword3.DATA}}\n物流公司:{{keyword4.DATA}}\n物流单号:{{keyword5.DATA}}\n{{remark.DATA}}', '', '', '1515052638', 1),
(17, 3, 1, 'OPENTM418528119', '订单收货通知', '', '{{first.DATA}}\n订单编号:{{keyword1.DATA}}\n商品名称:{{keyword2.DATA}}\n金额:{{keyword3.DATA}}\n时间:{{keyword4.DATA}}\n{{remark.DATA}}', '', '', '1515052765', 1),
(18, 5, 1, 'OPENTM207284059', '退款通知', '', '{{first.DATA}}\r\n退款金额:{{keyword1.DATA}}\r\n退款时间:{{keyword2.DATA}}\r\n订单编号:{{keyword3.DATA}}\r\n{{remark.DATA}}', '', '', '1515053049', 1),
(20, 20, 1, 'OPENTM416122303', '订单配送通知', '', '{{first.DATA}}\r\n订单编号:{{keyword1.DATA}}\r\n订单金额:{{keyword2.DATA}}\r\n配送员:{{keyword3.DATA}}\r\n联系电话:{{keyword4.DATA}}\r\n{{remark.DATA}}', '', '', '1515053313', 1),
(23, 11, 1, 'OPENTM409367318', '拼团成功通知', '', '{{first.DATA}}\r\n订单号:{{keyword1.DATA}}\r\n商品信息:{{keyword2.DATA}}\r\n拼团价格:{{keyword3.DATA}}\r\n组团信息:{{keyword4.DATA}}\r\n{{remark.DATA}}', '', '', '1520063823', 1),
(24, 12, 1, 'OPENTM418350969', '拼团失败通知', '', '{{first.DATA}}\r\n订单号:{{keyword1.DATA}}\r\n商品信息:{{keyword2.DATA}}\r\n失败类型:{{keyword3.DATA}}\r\n失败原因:{{keyword4.DATA}}\r\n{{remark.DATA}}', '', '', '1520064059', 1),
(26, 2, 1, 'OPENTM418062102', '订单支付成功通知', '', '{{first.DATA}}\n订单号:{{keyword1.DATA}}\n商品名称:{{keyword2.DATA}}\n支付金额:{{keyword3.DATA}}\n下单人:{{keyword4.DATA}}\n订单支付时间:{{keyword5.DATA}}\n{{remark.DATA}}', '', '', '1528966759', 1),
(27, 10, 1, 'OPENTM418554923', '砍价成功通知', '', '{{first.DATA}}\n商品名称:{{keyword1.DATA}}\n底价:{{keyword2.DATA}}\n{{remark.DATA}}', '', '', '1564566678', 1),
(28, 23, 1, 'OPENTM410867947', '开团成功提醒', '', '{{first.DATA}}\r\n商品信息:{{keyword1.DATA}}\r\n团长:{{keyword2.DATA}}\r\n拼团人数:{{keyword3.DATA}}\r\n截止时间:{{keyword4.DATA}}\r\n{{remark.DATA}}', '', '', '1564567037', 1),
(30, 9, 1, 'OPENTM400590844', '佣金提醒', '', '{{first.DATA}}\r\n佣金金额:{{keyword1.DATA}}\r\n时间:{{keyword2.DATA}}\r\n{{remark.DATA}}', '', '', '1602500478', 1),
(31, 1, 1, 'OPENTM409880752', '绑定成功通知', '', '{{first.DATA}}\r\n姓名:{{keyword1.DATA}}\r\n绑定时间:{{keyword2.DATA}}\r\n{{remark.DATA}}', '', '', '1602558146', 1),
(36, 4, 1, 'OPENTM401202515', '订单修改价格通知', '', '{{first.DATA}}\n订单号:{{keyword1.DATA}}\n商品名称:{{keyword2.DATA}}\n下单时间:{{keyword3.DATA}}\n订单总价:{{keyword4.DATA}}\n订单状态:{{keyword5.DATA}}\n{{remark.DATA}}', '', '', '1632305076', 1),
(37, 7, 1, 'OPENTM414089457', '充值成功通知', '', '{{first.DATA}}\r\n充值时间:{{keyword1.DATA}}\r\n充值金额:{{keyword2.DATA}}\r\n充值状态:{{keyword3.DATA}}\r\n{{remark.DATA}}', '', '', '1632305076', 1),
(38, 14, 1, 'OPENTM405876306', '提现审核通知', '', '{{first.DATA}}\n提现金额:{{keyword1.DATA}}\n申请时间:{{keyword2.DATA}}\n审核状态:{{keyword3.DATA}}\n原因说明:{{keyword4.DATA}}\n{{remark.DATA}}', '', '', '1632305076', 1),
(39, 15, 1, 'OPENTM403167119', '提现失败通知', '', '{{first.DATA}}\r\n提现金额:{{keyword1.DATA}}\r\n提现时间:{{keyword2.DATA}}\r\n原因说明:{{keyword3.DATA}}\r\n{{remark.DATA}}', '', '', '1632305076', 1),
(40, 26, 1, 'OPENTM408199008', '订单待支付提醒', '', '{{first.DATA}}\r\n订单金额:{{keyword1.DATA}}\r\n订单详情:{{keyword2.DATA}}\r\n订单编号:{{keyword3.DATA}}\r\n{{remark.DATA}}', '', '', '1632305076', 1),
(41, 8, 1, 'OPENTM201661503', '消费成功通知', '', '{{first.DATA}}\r\n商品名称:{{keyword1.DATA}}\r\n消费金额:{{keyword2.DATA}}\r\n抵扣积分:{{keyword3.DATA}}\r\n获得积分:{{keyword4.DATA}}\r\n消费时间:{{keyword5.DATA}}\r\n{{remark.DATA}}', '', '', '1632305076', 1),
(42, 8, 1, 'OPENTM415269411', '订单进度提醒', '', '{{first.DATA}}\r\n订单编号:{{keyword1.DATA}}\r\n订单内容:{{keyword2.DATA}}\r\n订单状态:{{keyword3.DATA}}\r\n时间:{{keyword4.DATA}}\r\n{{remark.DATA}}', '', '', '1632305076', 1);
-- --------------------------------------------------------