|
|
|
@ -2,6 +2,7 @@ |
|
|
|
|
|
|
|
namespace App\Service\v3\Implementations; |
|
|
|
|
|
|
|
use App\Constants\v3\Payment; |
|
|
|
use App\Model\v3\Order; |
|
|
|
use App\Model\v3\OrderGoods; |
|
|
|
use App\Model\v3\OrderMain; |
|
|
|
@ -71,6 +72,23 @@ class MiniprogramService implements MiniprogramServiceInterface |
|
|
|
]; |
|
|
|
|
|
|
|
$ret_store = $this->sendTempMsg($store['openid'], '-M7DG_ACwJxqdAvyvJuAnPpx4xaLf3VkkN0fckno71c',$data_store); |
|
|
|
|
|
|
|
// 小程序订阅消息发给商户
|
|
|
|
// 支付金额:{{amount1.DATA}}\n订单编号:{{character_string2.DATA}}\n支付时间:{{date3.DATA}}\n商品详情:{{thing4.DATA}}\n备注:{{thing7.DATA}}\n
|
|
|
|
$tmplId = 'UfCON4Dj_7aH_Q5k_HvDgzUb3gu67TokPITsJuvCMxc'; |
|
|
|
$page = 'pages/shopOrders/shopOrders?status=paid&store_id='.$store['id']; |
|
|
|
$this->sendSubscribeMessage( |
|
|
|
$store['openid'], |
|
|
|
$tmplId, |
|
|
|
[ |
|
|
|
'amount1' => $item->money, |
|
|
|
'character_string2' => $item->order_num, |
|
|
|
'date3' => $item->created_at_text??'', |
|
|
|
'thing4' => implode(";", $goods_temp_all), |
|
|
|
'thing7' => $item->note, |
|
|
|
], |
|
|
|
$page |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
// 模板数据发送消息给用户
|
|
|
|
@ -98,6 +116,9 @@ class MiniprogramService implements MiniprogramServiceInterface |
|
|
|
public function sendTemMsgForOfflineOrder($globalOrderId) |
|
|
|
{ |
|
|
|
|
|
|
|
// 主订单信息
|
|
|
|
$orderMain = OrderMain::query()->where(['global_order_id' => $globalOrderId])->first(); |
|
|
|
|
|
|
|
// 查询子订单,用于发消息给商户
|
|
|
|
$order_children = Order::query() |
|
|
|
->where(['order_main_id' => $globalOrderId]) |
|
|
|
@ -126,6 +147,23 @@ class MiniprogramService implements MiniprogramServiceInterface |
|
|
|
]; |
|
|
|
|
|
|
|
$ret_store = $this->sendTempMsg($store['openid'], 'lxVbC6PVpKbiO44bYqLmacl-BaME70D47Q0jn2Link0',$data_store); |
|
|
|
|
|
|
|
// 小程序订阅消息发给商户
|
|
|
|
// 付款金额:{{amount1.DATA}}\n商户名称:{{thing2.DATA}}\n支付方式:{{thing3.DATA}}\n交易单号:{{character_string4.DATA}}\n交易时间:{{time5.DATA}}\n
|
|
|
|
$tmplId = 'PCRNmKGb7t98xsz_GPux3rhXjsu68TPI3nXR7749dC0'; |
|
|
|
$page = 'pages/faceOrderList/faceOrderList?store_id='.$store['id']; |
|
|
|
$this->sendSubscribeMessage( |
|
|
|
$store['openid'], |
|
|
|
$tmplId, |
|
|
|
[ |
|
|
|
'amount1' => $item['money'], |
|
|
|
'thing2' => $store['name'], |
|
|
|
'thing3' => Payment::getMessage($orderMain->pay_type), |
|
|
|
'character_string4' => $item['order_num'], |
|
|
|
'time5' => $item['created_at_text']??'', |
|
|
|
], |
|
|
|
$page |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
@ -150,6 +188,41 @@ class MiniprogramService implements MiniprogramServiceInterface |
|
|
|
$ret_user = $this->sendTempMsg($openid,'ypZ7xdHUjWrRG8P-MD42dhpp6kUlh4Unoh7eTSrLZEg', $data_user); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @inheritDoc |
|
|
|
*/ |
|
|
|
public function subscribeMsgForSingleRefund($orderId, $refundStoreAmount, $orderGoodsId = '') |
|
|
|
{ |
|
|
|
|
|
|
|
$order = Order::query()->where(['id' => $orderId])->first(); |
|
|
|
$store = Store::query()->where(['id' => $order->store_id])->first(); |
|
|
|
$storeOpenid = User::query()->where(['id' => $store->user_id])->value('openid'); |
|
|
|
|
|
|
|
$goodsInfo = []; |
|
|
|
if ($orderGoodsId) { |
|
|
|
$goodsInfo = OrderGoods::query()->where(['id' => $orderGoodsId])->pluck('name')->toArray(); |
|
|
|
} else { |
|
|
|
$goodsInfo = OrderGoods::query()->where(['order_id' => $orderId])->pluck('name')->toArray(); |
|
|
|
} |
|
|
|
|
|
|
|
// 小程序订阅消息发给商户
|
|
|
|
// 订单编号:{{character_string7.DATA}}\n商品名称:{{thing10.DATA}}\n退款金额:{{amount3.DATA}}\n处理时间:{{date4.DATA}}\n退款说明:{{thing5.DATA}}\n
|
|
|
|
$tmplId = 'OaWeg0q40NVW2WeO5BY1TFdWi4GsgIY1rFBwo2wDa0g'; |
|
|
|
$page = 'pages/shopOrders/shopOrders?status=refund&store_id='.$store->id; |
|
|
|
$this->sendSubscribeMessage( |
|
|
|
$storeOpenid, |
|
|
|
$tmplId, |
|
|
|
[ |
|
|
|
'character_string7' => $order->order_num, |
|
|
|
'thing10' => implode(';', $goodsInfo), |
|
|
|
'amount3' => $refundStoreAmount, |
|
|
|
'date4' => $order->updated_at_text ?? '', |
|
|
|
'thing5' => $order->refund_note, |
|
|
|
], |
|
|
|
$page |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @inheritDoc |
|
|
|
*/ |
|
|
|
|