From 04fbf9782bc3b60d5632f756d625ef0c861147e8 Mon Sep 17 00:00:00 2001 From: weigang Date: Wed, 28 Oct 2020 11:20:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=A4=BE=E5=8C=BA=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E7=82=B9=E7=9F=AD=E4=BF=A1=E9=80=9A=E7=9F=A5=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E5=92=8C=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Constants/v3/SmsTemplateCode.php | 2 +- .../v3/Implementations/SeparateAccountsService.php | 12 ++++++------ app/Service/v3/Implementations/SmsAliSendService.php | 10 ++++++---- .../v3/Interfaces/SmsSendServiceInterface.php | 2 +- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/app/Constants/v3/SmsTemplateCode.php b/app/Constants/v3/SmsTemplateCode.php index 34b7bb3..14f3462 100644 --- a/app/Constants/v3/SmsTemplateCode.php +++ b/app/Constants/v3/SmsTemplateCode.php @@ -18,7 +18,7 @@ class SmsTemplateCode extends AbstractConstants /** * @Message("社区服务点奖励流水") */ - const ALI_COMMUNITY_FINANCIAL = 'SMS_200690862'; + const ALI_COMMUNITY_FINANCIAL = 'SMS_205122825'; /** * @Message("微信打款失败") diff --git a/app/Service/v3/Implementations/SeparateAccountsService.php b/app/Service/v3/Implementations/SeparateAccountsService.php index cd78ec7..7070ff4 100644 --- a/app/Service/v3/Implementations/SeparateAccountsService.php +++ b/app/Service/v3/Implementations/SeparateAccountsService.php @@ -146,8 +146,8 @@ class SeparateAccountsService implements SeparateAccountsServiceInterface $award['new_user_reward'] ); // 发送短信 - co(function () use ($communityBind, $award) { - $this->smsAliSendService->doCommunityFinancial($communityBind->source_id, $award['new_user_reward']); + co(function () use ($communityBind, $award, $orderMain) { + $this->smsAliSendService->doCommunityFinancial($communityBind->source_id, $award['new_user_reward'], $orderMain); }); $this->financialRecordService->communityAwardByPlatNewUserFirstOLOrder( $communityBind->source_id, @@ -155,16 +155,16 @@ class SeparateAccountsService implements SeparateAccountsServiceInterface $award['first_reward'] ); // 发送短信 - co(function () use ($communityBind, $award) { - $this->smsAliSendService->doCommunityFinancial($communityBind->source_id, $award['first_reward']); + co(function () use ($communityBind, $award, $orderMain) { + $this->smsAliSendService->doCommunityFinancial($communityBind->source_id, $award['first_reward'], $orderMain); }); } // 账单分成 $money = bcmul($orderMain->money, bcdiv($award['flow_reward'], 100, 6), 2); $this->financialRecordService->communitySeparateAccountsByOrderComp($communityBind->source_id, $orderMain->global_order_id, $money); // 发送短信 - co(function () use ($communityBind, $money) { - $this->smsAliSendService->doCommunityFinancial($communityBind->source_id, $money); + co(function () use ($communityBind, $money, $orderMain) { + $this->smsAliSendService->doCommunityFinancial($communityBind->source_id, $money, $orderMain); }); } diff --git a/app/Service/v3/Implementations/SmsAliSendService.php b/app/Service/v3/Implementations/SmsAliSendService.php index dcf388b..8e0fae3 100644 --- a/app/Service/v3/Implementations/SmsAliSendService.php +++ b/app/Service/v3/Implementations/SmsAliSendService.php @@ -88,12 +88,14 @@ class SmsAliSendService implements SmsSendServiceInterface // TODO: Implement removeVerifyCode() method. } - public function doCommunityFinancial($userId, $money) + public function doCommunityFinancial($csUserAdminId, $money, $orderMain) { - $csInfo = CsInfo::query()->where(['admin_user_id' => $userId])->first(); - $market = Market::query()->where(['id' => $csInfo->market_id])->first(); + $csInfo = CsInfo::query()->where(['admin_user_id' => $csUserAdminId])->first(); + $market = Market::query()->where(['id' => $orderMain->market_id])->first(); - $params = ['user_name' => $csInfo->name, 'market_name' => $market->name, 'money' => $money]; + // $params = ['user_name' => $csInfo->name, 'market_name' => $market->name, 'money' => $money]; + $orderTel = substr_replace($orderMain->tel, '****', 3, 4); + $params = ['store_name' => $csInfo->name, 'market_name' => $market->name, 'tel' => $orderTel, 'money' => $money.'元']; return $this->do($csInfo->phone, SmsTemplateCode::ALI_COMMUNITY_FINANCIAL, json_encode($params)); } diff --git a/app/Service/v3/Interfaces/SmsSendServiceInterface.php b/app/Service/v3/Interfaces/SmsSendServiceInterface.php index c7b7994..937af81 100644 --- a/app/Service/v3/Interfaces/SmsSendServiceInterface.php +++ b/app/Service/v3/Interfaces/SmsSendServiceInterface.php @@ -10,6 +10,6 @@ interface SmsSendServiceInterface public function doVerifyCode($tel, $code); public function checkVerifyCode($tel, $code); public function undoVerifyCode($tel, $code); - public function doCommunityFinancial($userId, $money); + public function doCommunityFinancial($csUserAdminId, $money, $orderMain); public function doWithdrawFail($storeName, $money, $errorCode, $errorCodeDes); } \ No newline at end of file