Browse Source

社区奖励短信模板,金额为0时不记账不发短信

master
weigang 5 years ago
parent
commit
276de508f0
  1. 2
      app/Service/v3/Implementations/FinancialRecordService.php
  2. 13
      app/Service/v3/Implementations/SmsAliSendService.php

2
app/Service/v3/Implementations/FinancialRecordService.php

@ -34,7 +34,7 @@ class FinancialRecordService implements FinancialRecordServiceInterface
{
// 如果金额不存在或者金额为0时,不记账
if (!isset($record['money']) || !boolval($record['money'])) {
if (!isset($record['money']) || $record['money'] == 0) {
return true;
}

13
app/Service/v3/Implementations/SmsAliSendService.php

@ -90,12 +90,23 @@ class SmsAliSendService implements SmsSendServiceInterface
public function doCommunityFinancial($csUserAdminId, $money, $orderMain)
{
if ($money == 0) {
return true;
}
$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];
$orderTel = substr_replace($orderMain->tel, '****', 3, 4);
$params = ['store_name' => $csInfo->name, 'market_name' => $market->name, 'tel' => $orderTel, 'money' => $money.'元'];
$params = [
'store_name' => ' ['.$csInfo->name.'] ',
'markert_name' => ' ['.$market->name.'] ',
'user_name' => $orderMain->name.'(懒ID:'.$orderMain->user_id.')',
'pay_money' => $orderMain->money.'元',
'money' => $money.'元'
];
return $this->do($csInfo->phone, SmsTemplateCode::ALI_COMMUNITY_FINANCIAL, json_encode($params));
}

Loading…
Cancel
Save