chore: 添加静态资源文件和版本配置文件

添加大量图片、字体、音频等静态资源文件,包括用户界面图片、模板文件和安装界面素材
添加系统版本配置文件(.version)和常量定义文件(.constant)
更新供应商依赖文件,包括Symfony VarDumper组件和相关许可证文件
添加验证码配置文件(captcha.php)和.gitignore规则
This commit is contained in:
2026-03-06 20:14:23 +08:00
commit c9a98f342c
4485 changed files with 490986 additions and 0 deletions

View File

@@ -0,0 +1,118 @@
<?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\services\message\notice;
use app\services\wechat\WechatUserServices;
use think\facade\Log;
/**
* Class BaseNoticeService
* @author 等风来
* @email 136327134@qq.com
* @date 2023/9/20
* @package app\services\message\notice
*/
abstract class BaseNoticeService
{
/**
* 配置
* @var array
*/
protected array $config;
/**
* 发送数据
* @var array
*/
protected array $data;
/**
* @var
*/
protected bool $switchLog = true;
/**
* @var bool
*/
protected bool $noticeSwitch = false;
/**
* BaseNoticeService constructor.
* @param array $config
* @param bool $noticeSwitch
* @param bool $switchLog
*/
public function __construct(array $config, bool $noticeSwitch, bool $switchLog = true)
{
$this->config = $config;
$this->noticeSwitch = $noticeSwitch;
$this->switchLog = $switchLog;
}
/**
* 记录日志
* @param string $message
* @param array $content
* @author 等风来
* @email 136327134@qq.com
* @date 2023/9/20
*/
protected function log(string $message, array $content = [])
{
$this->switchLog && Log::error($message, $content);
}
/**
* 执行任务
* @param callable $callable
* @param array $params
* @return false
* @author 等风来
* @email 136327134@qq.com
* @date 2023/9/20
*/
protected function handle(callable $callable, array $params = [])
{
try {
if ($this->noticeSwitch) {
return $callable(...$params);
} else {
return false;
}
} catch (\Throwable $e) {
$this->log($e->getMessage(), [
'file' => $e->getFile(),
'line' => $e->getLine()
]);
return false;
}
}
/**
* 根据UID,user_type获取openid
* @param int $uid
* @param string $userType
* @return mixed
*/
public function getOpenidByUid(int $uid, string $userType = 'wechat')
{
/** @var WechatUserServices $wechatServices */
$wechatServices = app()->make(WechatUserServices::class);
return $wechatServices->uidToOpenid($uid, $userType);
}
}

View File

@@ -0,0 +1,40 @@
<?php
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
namespace app\services\message\notice;
use app\jobs\notice\EnterpriseWechatJob;
/**
* 企业微信发送消息
* Created by PhpStorm.
* User: xurongyao <763569752@qq.com>
* Date: 2021/9/22 1:23 PM
*/
class EnterpriseWechatService extends BaseNoticeService
{
/**
* 发送消息
* @param array $data 模板内容
* @return bool
*/
public function sendMsg($data)
{
return $this->handle(function ($data) {
$url = $this->config['url'] ?? '';
$ent_wechat_text = $this->config['ent_wechat_text'] ?? '';
EnterpriseWechatJob::dispatchDo('doJob', [$data, $url, $ent_wechat_text]);
}, [$data]);
}
}

View File

@@ -0,0 +1,111 @@
<?php
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
namespace app\services\message\notice;
use app\jobs\notice\SmsJob;
use app\services\message\service\StoreServiceServices;
use app\services\system\admin\SystemAdminServices;
/**
* 短信发送消息列表
* Created by PhpStorm.
* User: xurongyao <763569752@qq.com>
* Date: 2021/9/22 1:23 PM
*/
class NoticeSmsService extends BaseNoticeService
{
/**
* 发送短信消息
* @param $phone
* @param array $data 模板内容
* @param string $template
* @return void
*/
public function sendSms($phone, array $data, string $template)
{
if ($phone) {
$this->handle(fn() => SmsJob::dispatch('doJob', [$phone, $data, $template]));
}
}
/**
* 退款发送管理员消息任务
* @param $order
* @return bool
*/
public function sendAdminRefund($order, $store_id = 0)
{
if (isset($order['supplier_id']) && $order['supplier_id']) {
/** @var SystemAdminServices $systemAdminServices */
$systemAdminServices = app()->make(SystemAdminServices::class);
$adminList = $systemAdminServices->getNotifySupplierList((int)$order['supplier_id'], 'phone,real_name as nickname');
} else {
/** @var StoreServiceServices $StoreServiceServices */
$StoreServiceServices = app()->make(StoreServiceServices::class);
$adminList = $StoreServiceServices->getStoreServiceOrderNotice();
}
if ($adminList) {
foreach ($adminList as $item) {
$data = ['order_id' => $order['order_id'], 'admin_name' => $item['nickname'] ?? ''];
$this->sendSms($item['phone'], $data, 'ADMIN_RETURN_GOODS_CODE');
}
}
return true;
}
/**
* 用户确认收货管理员短信提醒
* @param $switch
* @param $adminList
* @param $order
* @return bool
*/
public function sendAdminConfirmTakeOver($order)
{
/** @var StoreServiceServices $StoreServiceServices */
$StoreServiceServices = app()->make(StoreServiceServices::class);
$adminList = $StoreServiceServices->getStoreServiceOrderNotice();
foreach ($adminList as $item) {
$data = ['order_id' => $order['order_id'], 'admin_name' => $item['nickname']];
$this->sendSms($item['phone'], $data, 'ADMIN_TAKE_DELIVERY_CODE');
}
return true;
}
/**
* 下单成功给客服管理员发送短信
* @param $switch
* @param $adminList
* @param $order
* @return bool
*/
public function sendAdminPaySuccess($order, $store_id = 0)
{
if (isset($order['supplier_id']) && $order['supplier_id']) {
/** @var SystemAdminServices $systemAdminServices */
$systemAdminServices = app()->make(SystemAdminServices::class);
$adminList = $systemAdminServices->getNotifySupplierList((int)$order['supplier_id'], 'phone,real_name as nickname');
} else {
/** @var StoreServiceServices $StoreServiceServices */
$StoreServiceServices = app()->make(StoreServiceServices::class);
$adminList = $StoreServiceServices->getStoreServiceOrderNotice();
}
if ($adminList) {
foreach ($adminList as $item) {
$data = ['order_id' => $order['order_id'], 'admin_name' => $item['nickname'] ?? ''];
$this->sendSms($item['phone'], $data, 'ADMIN_PAY_SUCCESS_CODE');
}
}
return true;
}
}

View File

@@ -0,0 +1,376 @@
<?php
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
namespace app\services\message\notice;
use app\jobs\notice\template\TemplateJob;
use think\facade\Log;
/**
* 小程序模板消息消息队列
* Class RoutineTemplateJob
* @package crmeb\jobs
*/
class RoutineTemplateListService extends BaseNoticeService
{
/**
* 发送模板消息
* @param string $tempCode 模板消息常量名称
* @param int $uid uid
* @param array $data 模板内容
* @param string|null $link 跳转链接
* @param string|null $color 文字颜色
* @return bool|mixed
*/
public function sendTemplate(string $tempCode, int $uid, array $data, string $link = null, string $color = null)
{
if (!$this->noticeSwitch) {
return false;
}
if (!$uid) {
return false;
}
try {
$openid = $this->getOpenidByUid($uid, 'routine');
if (!$openid) {
return false;
}
TemplateJob::dispatchDo('doJob', ['subscribe', $openid, $tempCode, $data, $link, $color]);
} catch (\Exception $e) {
Log::error($e->getMessage());
return true;
}
}
/**
* 确认收货
* @param $uid
* @param $order
* @param $title
* @return bool|mixed
*/
public function sendOrderTakeOver($uid, $order, $title)
{
return $this->sendTemplate('ORDER_TAKE', $uid, [
'thing1' => $order['order_id'],
'thing2' => mb_substr_str($title, 20),
'date5' => date('Y-m-d H:i:s', time()),
], '/pages/goods/order_details/index?order_id=' . $order['order_id']);
}
/**
* 发货
* @param $uid
* @param $order
* @param $storeTitle
* @param array $data
* @param int $isGive 0 = 同城配送, 1 = 快递发货
* @return bool|mixed
*/
public function sendOrderPostage($uid, $order, $storeTitle, array $data, int $isGive = 0)
{
if ($isGive) {//快递发货
return $this->sendTemplate('ORDER_DELIVER_SUCCESS', $uid, [
'character_string2' => $data['delivery_id'] ?? '',
'thing1' => mb_substr_str($data['delivery_name'] ?? '', 20),
'time3' => date('Y-m-d H:i:s', time()),
'thing5' => mb_substr_str($storeTitle, 20),
], '/pages/goods/order_details/index?order_id=' . $order['order_id']);
} else {//同城配送
return $this->sendTemplate('ORDER_POSTAGE_SUCCESS', $uid, [
'thing8' => mb_substr_str($storeTitle, 20),
'character_string1' => $order['order_id'],
'name4' => mb_substr_str($data['delivery_name'] ?? '', 10, '...', 1),
'phone_number10' => $data['delivery_id'] ?? ''
], '/pages/goods/order_details/index?order_id=' . $order['order_id']);
}
}
/**
* 充值金额退款
* @param $uid
* @param $UserRecharge
* @param $now_money
* @return bool|mixed
*/
public function sendRechargeSuccess($uid, $UserRecharge, $now_money)
{
return $this->sendTemplate('RECHARGE_SUCCESS', $uid, [
'character_string1' => $UserRecharge['order_id'],
'amount3' => $UserRecharge['price'],
'amount4' => $now_money,
'date5' => date('Y-m-d H:i:s', time()),
], '/pages/users/user_bill/index?type=2');
}
/**
* 订单退款成功发送消息
* @param string $openid
* @param array $order
* @return bool
*/
public function sendOrderRefundSuccess($openid, $order, $storeTitle)
{
return $this->sendTemplate('ORDER_REFUND', $openid, [
'thing1' => '已成功退款',
'thing2' => mb_substr_str($storeTitle, 20),
'amount3' => $order['pay_price'],
'character_string6' => $order['order_id']
], '/pages/goods/order_after_details/index?order_id=' . $order['order_id'] . '&isReturen=1');
}
/**
* 订单退款失败
* @param $uid
* @param $order
* @param $storeTitle
* @return bool|mixed
*/
public function sendOrderRefundFail($uid, $order, $storeTitle)
{
return $this->sendTemplate('ORDER_REFUND', $uid, [
'thing1' => '退款失败',
'thing2' => mb_substr_str($storeTitle, 20),
'amount3' => $order['pay_price'],
'character_string6' => $order['order_id']
], '/pages/goods/order_after_details/index?order_id=' . $order['order_id'] . '&isReturen=1');
}
/**
* 用户申请退款给管理员发送消息
* @param $uid
* @param $order
* @return bool|mixed
*/
public function sendOrderRefundStatus($uid, $order)
{
$data['character_string4'] = $order['order_id'];
$data['date5'] = date('Y-m-d H:i:s', time());
$data['amount2'] = $order['pay_price'];
$data['phrase7'] = '申请退款中';
$data['thing8'] = '请及时处理';
return $this->sendTemplate('ORDER_REFUND_STATUS', $uid, $data);
}
/**
* 砍价成功通知
* @param $uid
* @param array $bargain
* @param array $bargainUser
* @param int $bargainUserId
* @return bool|mixed
*/
public function sendBargainSuccess($uid, $bargain = [], $bargainUser = [], $bargainUserId = 0)
{
$data['thing1'] = mb_substr_str($bargain['title'], 20);
$data['amount2'] = $bargain['min_price'];
$data['thing3'] = '恭喜您,已经砍到最低价了';
return $this->sendTemplate('BARGAIN_SUCCESS', $uid, $data, '/pages/activity/goods_bargain_details/index?id=' . $bargain['id'] . '&bargain=' . $bargainUserId);
}
/**
* 订单支付成功发送模板消息
* @param $uid
* @param $pay_price
* @param $orderId
* @return bool|mixed
*/
public function sendOrderSuccess($uid, $pay_price, $orderId)
{
if ($orderId == '') return true;
$data['character_string1'] = $orderId;
$data['amount2'] = $pay_price . '元';
$data['date3'] = date('Y-m-d H:i:s', time());
return $this->sendTemplate('ORDER_PAY_SUCCESS', $uid, $data, '/pages/goods/order_details/index?order_id=' . $orderId);
}
/**
* 收益到账通知
* @param $uid
* @param $orderId
* @param $extract_price
* @param $msg
* @param $type
* @return bool|mixed
* User: liusl
* DateTime: 2025/2/17 上午11:57
*/
public function sendRevenueReceived($uid, $extract_price, $msg, $link)
{
$data['amount3'] = $extract_price . '元';
$data['thing4'] = $msg;
$data['time9'] = date('Y-m-d H:i:s', time());
return $this->sendTemplate('REVENUE_RECEIVED', $uid, $data, $link);
}
/**
* 会员订单支付成功发送消息
* @param $uid
* @param $pay_price
* @param $orderId
* @return bool|mixed
*/
public function sendMemberOrderSuccess($uid, $pay_price, $orderId)
{
if ($orderId == '') return true;
$data['character_string1'] = $orderId;
$data['amount2'] = $pay_price . '元';
$data['date3'] = date('Y-m-d H:i:s', time());
return $this->sendTemplate('ORDER_PAY_SUCCESS', $uid, $data, '/pages/annex/vip_paid/index');
}
/**
* 提现失败
* @param $uid
* @param $msg
* @param $extract_number
* @param $nickname
* @return bool|mixed
*/
public function sendExtractFail($uid, $msg, $extract_number, $nickname)
{
return $this->sendTemplate('USER_EXTRACT', $uid, [
'thing1' => mb_substr_str('提现失败:' . $msg, 20),
'amount2' => $extract_number . '元',
'thing3' => mb_substr_str($nickname, 20),
'date4' => date('Y-m-d H:i:s', time())
], '/pages/users/user_spread_money/index?type=2');
}
/**
* 提现成功
* @param $uid
* @param $extract_number
* @param $nickname
* @return bool|mixed
*/
public function sendExtractSuccess($uid, $extract_number, $nickname)
{
return $this->sendTemplate('USER_EXTRACT', $uid, [
'thing1' => '提现成功',
'amount2' => $extract_number . '元',
'thing3' => mb_substr_str($nickname, 20),
'date4' => date('Y-m-d H:i:s', time())
], '/pages/users/user_spread_money/index?type=2');
}
/**
* 拼团成功通知
* @param $uid
* @param $pinkTitle
* @param $nickname
* @param $pinkTime
* @param $count
* @param string $link
* @return bool|mixed
*/
public function sendPinkSuccess($uid, $pinkTitle, $nickname, $pinkTime, $count, string $link = '')
{
return $this->sendTemplate('PINK_TRUE', $uid, [
'thing1' => mb_substr_str($pinkTitle, 20),
'name3' => mb_substr_str($nickname, 10, '...', 1),
'date5' => date('Y-m-d H:i:s', $pinkTime),
'number2' => $count
], $link);
}
/**
* 拼团状态通知
* @param $uid
* @param $pinkTitle
* @param $count
* @param $remarks
* @param $link
* @return bool|mixed
*/
public function sendPinkFail($uid, $pinkTitle, $count, $remarks, $link)
{
return $this->sendTemplate('PINK_STATUS', $uid, [
'thing2' => mb_substr_str($pinkTitle, 20),
'thing1' => mb_substr_str($count, 20),
'thing3' => mb_substr_str($remarks, 20)
], $link);
}
/**
* 赠送积分消息提醒
* @param $uid
* @param $order
* @param $storeTitle
* @param $gainIntegral
* @param $integral
* @return bool|mixed
*/
public function sendUserIntegral($uid, $order, $storeTitle, $gainIntegral, $integral)
{
if (!$order || !$uid) return true;
if (is_string($order['cart_id']))
$order['cart_id'] = json_decode($order['cart_id'], true);
return $this->sendTemplate('INTEGRAL_ACCOUT', $uid, [
'character_string2' => $order['order_id'],
'thing3' => mb_substr_str($storeTitle, 20),
'amount4' => $order['pay_price'],
'number5' => $gainIntegral,
'number6' => $integral
], '/pages/users/user_integral/index');
}
/**
* 获得推广佣金发送提醒
* @param string $uid
* @param string $brokeragePrice
* @param string $goods_name
* @return bool|mixed
*/
public function sendOrderBrokerageSuccess(string $uid, string $brokeragePrice, string $goods_name)
{
return $this->sendTemplate('ORDER_BROKERAGE', $uid, [
'thing2' => mb_substr_str($goods_name, 20),
'amount4' => $brokeragePrice . '元',
'time1' => date('Y-m-d H:i:s', time())
], '/pages/users/user_spread_user/index');
}
/**
* 绑定推广关系发送消息提醒
* @param string $uid
* @param string $userName
* @return bool|mixed
*/
public function sendBindSpreadUidSuccess(string $uid, string $userName)
{
return $this->sendTemplate('BIND_SPREAD_UID', $uid, [
'name3' => mb_substr_str($userName . "加入您的团队", 10, '...', 1),
'date4' => date('Y-m-d H:i:s', time())
], '/pages/users/user_spread_user/index');
}
/**
* 用户签到发送消息提醒
* @param int $uid
* @return bool|mixed
*/
public function sendSignRemind(int $uid)
{
return $this->sendTemplate('SIGN_REMIND_TIME', $uid, [
'thing3' => '每日签到',
'thing2' => '今天还没有签到哟!'
], '/pages/users/user_sgin/index');
}
}

View File

@@ -0,0 +1,92 @@
<?php
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
namespace app\services\message\notice;
use app\jobs\notice\SystemMsgJob;
use app\services\message\service\StoreServiceServices;
use app\services\message\SystemMessageServices;
use think\db\exception\DataNotFoundException;
use think\db\exception\DbException;
use think\db\exception\ModelNotFoundException;
use think\facade\Log;
/**
* 短信发送消息列表
* Created by PhpStorm.
* User: xurongyao <763569752@qq.com>
* Date: 2021/9/22 1:23 PM
*/
class SystemMsgService extends BaseNoticeService
{
/**
* 发送消息
* @param int $uid uid
* @param array $data 模板内容
*/
public function sendMsg(int $uid, $data)
{
if ($uid) {
$this->handle(fn() => SystemMsgJob::dispatch([$uid, $this->config, $data]));
}
}
/**
* 给客服发站内信
* @param array $data
* @return bool
* @throws DataNotFoundException
* @throws DbException
* @throws ModelNotFoundException
*/
public function kefuSystemSend($data)
{
if (!$this->noticeSwitch) {
return false;
}
/** @var StoreServiceServices $StoreServiceServices */
$StoreServiceServices = app()->make(StoreServiceServices::class);
$adminList = $StoreServiceServices->getStoreServiceOrderNotice();
try {
if ($adminList) {
foreach ($adminList as $item) {
$uid = $item['uid'] ?? 0;
$data['admin_name'] = $item['staff_name'] ?? ($item['nickname'] ?? '');
//放入队列执行
SystemMsgJob::dispatch([$uid, $this->config, $data, 2]);
}
}
} catch (\Exception $e) {
Log::error($e->getMessage());
return true;
}
}
/**
* 站内信发放
* @param int $uid
* @param array $noticeInfo
* @return \crmeb\basic\BaseModel|\think\Model
*/
public function systemSend(int $uid, array $noticeInfo)
{
$data = [];
$data['mark'] = $noticeInfo['mark'];
$data['uid'] = $uid;
$data['title'] = $noticeInfo['title'];
$data['content'] = $noticeInfo['content'];
$data['type'] = 1;
$data['add_time'] = time();
return app()->make(SystemMessageServices::class)->save($data);
}
}

View File

@@ -0,0 +1,622 @@
<?php
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
namespace app\services\message\notice;
use app\jobs\notice\template\TemplateJob;
use app\services\message\service\StoreServiceServices;
use think\facade\Log;
/**
* 微信模版消息列表
* Created by PhpStorm.
* User: xurongyao <763569752@qq.com>
* Date: 2021/9/22 1:23 PM
*/
class WechatTemplateListService extends BaseNoticeService
{
/**
* 发送模板消息
* @param string $tempCode 模板消息常量名称
* @param int $uid uid
* @param array $data 模板内容
* @param string|null $link 跳转链接
* @param string|null $color 文字颜色
* @return bool
*/
public function sendTemplate(string $tempCode, int $uid, array $data, string $link = null, string $color = null)
{
if (!$this->noticeSwitch) {
return false;
}
if (!$uid) {
return false;
}
try {
$openid = $this->getOpenidByUid($uid, 'wechat');
if (!$openid) {
return false;
}
TemplateJob::dispatchDo('doJob', ['wechat', $openid, $tempCode, $data, $link, $color]);
} catch (\Exception $e) {
Log::error($e->getMessage());
return true;
}
}
/**
* 支付成功发送模板消息
* @param $uid
* @param $order
* @param $link
* @return bool
*/
public function sendOrderPaySuccess($uid, $order, $link)
{
return $this->sendTemplate('ORDER_PAY_SUCCESS', $uid, [
'character_string2' => $order['order_id'],
'thing3' => $order['storeName'],
'amount5' => bcadd((string)$order['pay_price'], '0', 2),
'phrase18' => $order['send_name'],
'time4' => date('Y-m-d H:i:s', $order['pay_time'])
], $link);
}
/**
* 收益到账通知
* @param $uid
* @param $msg
* @param $extract_price
* @param $link
* @return bool
* User: liusl
* DateTime: 2025/2/18 下午5:35
*/
public function sendRevenueReceivedSuccess($uid, $msg, $extract_price, $link)
{
return $this->sendTemplate('REVENUE_RECEIVED', $uid, [
'amount2' => $extract_price,
'const5' => $msg,
'time3' => date('Y-m-d H:i:s', time())
], $link);
}
/**
* 购买会员成功
* @param $uid
* @param $order
* @return bool|mixed
*/
public function sendMemberOrderPaySuccess($uid, $order)
{
return $this->sendTemplate('ORDER_PAY_SUCCESS', $uid, [
'first' => '亲,购买会员成功,恭喜您成为本平台尊贵会员!',
'keyword1' => $order['order_id'],
'keyword2' => $order['pay_price'],
'remark' => '点击查看订单详情'
], '/pages/annex/vip_paid/index');
}
/**
* 订单发货
* @param $order
* @param array $data
* @return bool|mixed
*/
public function sendOrderDeliver($uid, string $goodsName, $order, array $data)
{
return $this->sendTemplate('ORDER_DELIVER_SUCCESS', $uid, [
'first' => '亲,您的订单已发货,请注意查收',
'keyword1' => $order['order_id'],
'keyword2' => $order['pay_price'],
'keyword3' => $order['delivery_name'],
'keyword4' => $order['delivery_id'],
'remark' => '点击查看订单详情'
], '/pages/goods/order_details/index?order_id=' . $order['order_id']);
}
/**
* 订单发货
* @param $order
* @param array $data
* @return bool|mixed
*/
public function sendOrderPostage($uid, $order, array $data, $storeTitle)
{
return $this->sendTemplate('ORDER_POSTAGE_SUCCESS', $uid, [
'character_string2' => $order['order_id'],
'thing4' => $storeTitle,
'thing13' => $data['delivery_name'],
'character_string14' => $data['delivery_id'],
'time12' => date('Y-m-d H:i:s', time())
], '/pages/goods/order_details/index?order_id=' . $order['order_id']);
}
/**
* 发送客服消息
* @param $order
* @param string|null $link
* @return bool
*/
public function sendServiceNotice($uid, $data)
{
return $this->sendTemplate('ADMIN_NOTICE', $uid,
[
'keyword1' => '新订单',
'keyword2' => $data['delivery_name'],
'keyword3' => $data['delivery_id'],
'first' => '亲,您有新的订单待处理',
'remark' => '点击查看订单详情'
], '/pages/goods/order_details/index?order_id=' . $data['order_id']);
}
/**
* 退款发送客服消息
* @param $order
* @param string|null $link
* @return bool
*/
public function sendRefundServiceNotice($uid, $data, ?string $link = null)
{
return $this->sendTemplate('ADMIN_NOTICE', $uid, $data, $link);
}
/**
* 确认收货发送模板消息
* @param $order
* @return bool|mixed
*/
public function sendOrderTakeSuccess($uid, $order, $title)
{
return $this->sendTemplate('ORDER_TAKE_SUCCESS', $uid, [
'character_string7' => $order['order_id'],
'thing6' => $title,
'time4' => date('Y-m-d H:i:s', time())
]);
}
/**
* 发送退款申请模板消息
* @param array $data
* @param $order
* @return bool|mixed
*/
public function sendOrderApplyRefund($uid, $order)
{
return $this->sendTemplate('ORDER_REFUND_STATUS', $uid, [
'first' => '你有一笔退款订单需要处理',
'keyword1' => $order['pay_price'],
'keyword2' => date('Y-m-d H:i:s', $order['add_time']),
'keyword3' => $order['order_id'],
'remark' => '点击查看退款详情'
], '/pages/admin/orderDetail/index?id=' . $order['order_id']);
}
/**
* 发送退款模板消息
* @param array $data
* @param $order
* @return bool|mixed
*/
public function sendOrderRefundSuccess($uid, array $data, $order)
{
return $this->sendTemplate('ORDER_REFUND_STATUS', $uid, [
'amount2' => bcadd((string)$data['refund_price'], '0', 2),
'time4' => date('Y-m-d H:i:s', $order['add_time']),
'character_string5' => $order['order_id']
], '/pages/goods/order_after_details/index?order_id=' . $order['order_id']);
}
/**
* 发送退款模板消息
* @param array $data
* @param $order
* @return bool|mixed
*/
public function sendOrderRefundNoStatus($uid, $order)
{
return $this->sendTemplate('ORDER_REFUND_FAIL', $uid, [
'amount5' => $order['pay_price'],
'character_string8' => $order['order_id'],
'thing6' => '审核未通过',
'time9' => date('Y-m-d H:i:s', $order['add_time'])
], '/pages/goods/order_details/index?order_id=' . $order['order_id']);
}
/**
* 发送用户充值退款模板消息
* @param array $data
* @param $userRecharge
* @return bool|mixed
*/
public function sendRechargeRefundStatus($uid, array $data, $userRecharge)
{
return $this->sendTemplate('ORDER_REFUND_STATUS', $uid, [
'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 $extract_number
* @param $fail_msg
* @return bool|mixed
*/
public function sendUserBalanceChangeFail($uid, $extract_number, $fail_msg)
{
return $this->sendTemplate('USER_BALANCE_CHANGE', $uid, [
'first' => '提现失败,退回佣金' . $extract_number . '元',
'keyword1' => '佣金提现',
'keyword2' => date('Y-m-d H:i:s', time()),
'keyword3' => $extract_number,
'remark' => '错误原因:' . $fail_msg
], '/pages/users/user_spread_money/index?type=1');
}
/**
* 佣金提现成功发送模板消息
* @param $uid
* @param $extractNumber
* @return bool|mixed
*/
public function sendUserBalanceChangeSuccess($uid, $extractNumber)
{
return $this->sendTemplate('USER_BALANCE_CHANGE', $uid, [
'first' => '成功提现佣金' . $extractNumber . '元',
'keyword1' => '佣金提现',
'keyword2' => date('Y-m-d H:i:s', time()),
'keyword3' => $extractNumber,
'remark' => '点击查看我的佣金明细'
], '/pages/users/user_spread_money/index?type=1');
}
/**
* 拼团成功发送模板消息
* @param $uid
* @param $order_id
* @param $title
* @return bool|mixed
*/
public function sendOrderPinkSuccess($uid, $orderInfo, $title)
{
return $this->sendTemplate('ORDER_USER_GROUPS_SUCCESS', $uid, [
'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_id
* @param $title
* @return bool|mixed
*/
public function sendOrderPinkUseSuccess($uid, array $orderInfo, string $title)
{
return $this->sendTemplate('ORDER_USER_GROUPS_SUCCESS', $uid, [
'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 StorePink $order_id
* @param $price
* @param string $title
* @return bool|mixed
*/
public function sendOrderPinkClone($uid, $pink, $title)
{
return $this->sendTemplate('ORDER_USER_GROUPS_LOSE', $uid, [
'first' => '亲,您的拼团取消',
'keyword1' => $pink['order_id'],
'keyword2' => $title,
'keyword3' => '拼团失败',
'keyword4' => '用户取消拼团',
'remark' => '点击查看订单详情'
], '/pages/activity/goods_combination_status/index?id=' . $pink['id']);
}
/**
* 拼团失败发送模板消息
* @param $uid
* @param StorePink $pink
* @param $title
* @return bool|mixed
*/
public function sendOrderPinkFial($uid, $pink, $title)
{
return $this->sendTemplate('ORDER_USER_GROUPS_LOSE', $uid, [
'first' => '亲,您的拼团失败',
'keyword1' => $pink['order_id'],
'keyword2' => $title,
'keyword3' => '拼团失败',
'keyword4' => '拼团时间超时',
'remark' => '点击查看订单详情'
], '/pages/activity/goods_combination_status/index?id=' . $pink['id']);
}
/**
* 开团成功发送模板消息
* @param $uid
* @param StorePink $pink
* @param $title
* @return bool|mixed
*/
public function sendOrderPinkOpenSuccess($uid, $pink, $title)
{
return $this->sendTemplate('OPEN_PINK_SUCCESS', $uid, [
'first' => '您好,您已成功开团!赶紧与小伙伴们分享吧!!!',
'keyword1' => $title,
'keyword2' => $pink['nickname'],
'keyword3' => $pink['people'],
'keyword4' => date('Y-m-d H:i:s', $pink['stop_time']),
'remark' => '点击查看订单详情'
], '/pages/activity/goods_combination_status/index?id=' . $pink['id']);
}
/**
* 砍价成功发送模板消息
* @param $uid
* @param StoreBargain $bargain
* @return bool|mixed
*/
public function sendBargainSuccess($uid, $bargain, $bargainUser = [], $bargainUserId = 0)
{
return $this->sendTemplate('BARGAIN_SUCCESS', $uid, [
'first' => '好腻害!你的朋友们已经帮你砍到底价了!',
'keyword1' => $bargain['title'],
'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 $order
* @return bool
*/
public function sendOrderBrokerageSuccess(string $uid, string $brokeragePrice, string $goodsName, string $goodsPrice, $orderTime)
{
return $this->sendTemplate('ORDER_BROKERAGE', $uid, [
'first' => '亲,您有一笔佣金入账!',
'keyword1' => $brokeragePrice,//分销佣金
// 'keyword2' => $goodsPrice . "元",//交易金额
'keyword2' => date('Y-m-d H:i:s', $orderTime),//结算时间
'remark' => '点击查看订单详情'
], '/pages/users/user_spread_user/index');
}
/** 绑定推广关系发送消息提醒
* @param string $uid
* @param string $userName
* @return bool|mixed
*/
public function sendBindSpreadUidSuccess(string $uid, string $userName)
{
return $this->sendTemplate('BIND_SPREAD_UID', $uid, [
'first' => '恭喜,加入您的团队',
'keyword1' => $userName,
'keyword2' => date('Y-m-d H:i:s', time()),
'remark' => '授人以鱼不如授人以渔,一起分享赚钱吧,点击查看详情!'
], '/pages/users/user_spread_user/index');
}
/**
* 新订单给客服提醒
* @param $switch
* @param $adminList
* @param $order
* @return bool
*/
public function sendAdminNewOrder($order, $store_id = 0)
{
/** @var StoreServiceServices $StoreServiceServices */
$StoreServiceServices = app()->make(StoreServiceServices::class);
$adminList = $StoreServiceServices->getStoreServiceOrderNotice();
foreach ($adminList as $item) {
$this->sendTemplate('ADMIN_NOTICE', $item['uid'],
[
'keyword1' => $order['order_id'],
'keyword2' => $order['storeName'],
'keyword3' => '新订单',
'keyword4' => date('Y-m-d H:i:s', time()),
'first' => '亲,您有新的订单待处理',
'remark' => '点击查看订单详情'
], '/pages/admin/orderDetail/index?id=' . $order['order_id']);
}
return true;
}
/**
* 退款给客服提醒
* @param $switch
* @param $adminList
* @param $order
* @return bool
*/
public function sendAdminNewRefund($order, $store_id = 0)
{
/** @var StoreServiceServices $StoreServiceServices */
$StoreServiceServices = app()->make(StoreServiceServices::class);
$adminList = $StoreServiceServices->getStoreServiceOrderNotice();
foreach ($adminList as $item) {
$this->sendTemplate('ADMIN_NOTICE', $item['uid'],
[
'keyword1' => $order['order_id'],
'keyword2' => $order['storeName'],
'keyword3' => '退款申请',
'keyword4' => date('Y-m-d H:i:s', time()),
'first' => '亲,您有个退款订单待处理',
'remark' => '点击查看订单详情'
], '/pages/admin/orderDetail/index?id=' . $order['order_id']);
}
return true;
}
/**
* 订单改价
* @param $uid
* @param $order
* @return bool|mixed
*/
public function sendPriceRevision($uid, $order)
{
return $this->sendTemplate('PRICE_REVISION', $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
* @return bool|mixed
*/
public function sendRechargeSuccess($uid, $order)
{
return $this->sendTemplate('RECHARGE_SUCCESS', $uid, [
'time11' => date('Y-m-d H:i:s', $order['add_time']),
'amount5' => bcadd((string)$order['price'], '0', 2)
]);
}
/**
* 获得积分
* @param $uid
* @param $order
* @return bool|mixed
*/
public function sendUserIntegral($uid, $order, $data)
{
return $this->sendTemplate('INTEGRAL_ACCOUT', $uid, [
'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 $order
* @return bool|mixed
*/
public function sendOrderPayFalse($uid, $order)
{
return $this->sendTemplate('ORDER_PAY_FALSE', $uid, [
'first' => '亲,您有订单还未付款',
'keyword1' => $order['pay_price'],
'keyword2' => $order['storeName'],
'keyword3' => $order['order_id'],
'remark' => '感谢您的光临!'
]);
}
/**
* 提现成功
* @param $uid
* @param $extractNumber
* @return bool|mixed
*/
public function sendUserExtract($uid, $extractNumber)
{
return $this->sendTemplate('USER_EXTRACT', $uid, [
'amount3' => bcadd((string)$extractNumber, '0', 2),
'time4' => date('Y-m-d H:i:s', time())
]);
}
/**
* 提现失败
* @param $uid
* @param $extractNumber
* @param $message
* @return bool|mixed
*/
public function sendExtractFail($uid, $extractNumber, $message)
{
return $this->sendTemplate('USER_EXTRACT_FAIL', $uid, [
'first' => '亲,您的提现申请未通过',
'keyword1' => $extractNumber,
'keyword2' => date('Y-m-d H:i:s', time()),
'keyword3' => $message,
'remark' => '请联系管理员!'
]);
}
/**
* 服务消息(新)
* @param $openid
* @param $data
* @param $url
* @return bool|mixed
*/
public function sendServiceNoticeNew($openid, $data, $url)
{
return $this->sendTemplate('ADMIN_NOTICE', $openid, [
'first' => $data['first'],
'keyword1' => $data['keyword1'],
'keyword2' => $data['keyword2'],
'keyword3' => $data['keyword3'],
'remark' => $data['remark']
], $url);
}
/**虚拟商品发货消息
* @param $uid
* @param $data
* @param $url
* @return bool|mixed
*/
public function sendKamiDeliverGoods($uid, $value, $url)
{
return $this->sendTemplate('KAMI_DELIVER_GOODS_CODE', $uid, [
'first' => '亲,你的虚拟商品购买成功',
'keyword1' => '虚拟数字卡密',
'keyword2' => $value,
'remark' => '感谢您的支持!'
], $url);
}
}