mirror of
https://github.com/crmeb/CRMEB.git
synced 2025-12-11 18:32:50 +00:00
格式化代码,调整模板消息发送类型
This commit is contained in:
parent
1067d7e776
commit
2762c576b1
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace app\models\routine;
|
||||
|
||||
use crmeb\utils\Template;
|
||||
@ -71,13 +72,15 @@ class RoutineTemplate
|
||||
$data['keyword5']['value'] = '已成功退款';
|
||||
return self::sendOut('ORDER_REFUND_SUCCESS', $order['uid'], $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户申请退款给管理员发送消息
|
||||
* @param array $order
|
||||
* @param string $refundReasonWap
|
||||
* @param array $adminList
|
||||
*/
|
||||
public static function sendOrderRefundStatus($order = array(),$refundReasonWap = '',$adminList = array()){
|
||||
public static function sendOrderRefundStatus($order = array(), $refundReasonWap = '', $adminList = array())
|
||||
{
|
||||
$data['keyword1'] = $order['order_id'];
|
||||
$data['keyword2'] = $refundReasonWap;
|
||||
$data['keyword3'] = date('Y-m-d H:i:s', time());
|
||||
@ -95,7 +98,8 @@ class RoutineTemplate
|
||||
* @param int $bargainUserId
|
||||
* @return bool
|
||||
*/
|
||||
public static function sendBargainSuccess($bargain = array(),$bargainUser = array(),$bargainUserId = 0){
|
||||
public static function sendBargainSuccess($bargain = array(), $bargainUser = array(), $bargainUserId = 0)
|
||||
{
|
||||
$data['keyword1'] = $bargain['title'];
|
||||
$data['keyword2'] = $bargainUser['bargain_price'];
|
||||
$data['keyword3'] = $bargainUser['bargain_price_min'];
|
||||
@ -114,7 +118,8 @@ class RoutineTemplate
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public static function sendOrderSuccess($formId = '',$orderId = ''){
|
||||
public static function sendOrderSuccess($formId = '', $orderId = '')
|
||||
{
|
||||
if ($orderId == '') return;
|
||||
$order = StoreOrder::where('order_id', $orderId)->find();
|
||||
$data['keyword1'] = $orderId;
|
||||
|
||||
@ -34,7 +34,7 @@ class NoticeRepositories
|
||||
$openid = $wechatUser['openid'];
|
||||
$routineOpenid = $wechatUser['routine_openid'];
|
||||
try {
|
||||
if ($openid) {//公众号发送模板消息
|
||||
if ($openid && in_array($order['is_channel'],[0,2])) {//公众号发送模板消息
|
||||
WechatTemplateService::sendTemplate($openid, WechatTemplateService::ORDER_PAY_SUCCESS, [
|
||||
'first' => '亲,您购买的商品已支付成功',
|
||||
'keyword1' => $order['order_id'],
|
||||
@ -51,7 +51,7 @@ class NoticeRepositories
|
||||
]);
|
||||
//订单支付成功后给客服发送客服消息
|
||||
CustomerRepository::sendOrderPaySuccessCustomerService($order, 1);
|
||||
} else if ($routineOpenid) {//小程序发送模板消息
|
||||
} else if ($routineOpenid && in_array($order['is_channel'],[1,2])) {//小程序发送模板消息
|
||||
RoutineTemplate::sendOrderSuccess($formId, $order['order_id']);
|
||||
//订单支付成功后给客服发送客服消息
|
||||
CustomerRepository::sendOrderPaySuccessCustomerService($order, 0);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user