Browse Source

修改社区服务点短信通知内容和模板

master
weigang 5 years ago
parent
commit
04fbf9782b
  1. 2
      app/Constants/v3/SmsTemplateCode.php
  2. 12
      app/Service/v3/Implementations/SeparateAccountsService.php
  3. 10
      app/Service/v3/Implementations/SmsAliSendService.php
  4. 2
      app/Service/v3/Interfaces/SmsSendServiceInterface.php

2
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("微信打款失败")

12
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);
});
}

10
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));
}

2
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);
}
Loading…
Cancel
Save