diff --git a/app/Service/v3/Implementations/FinancialRecordService.php b/app/Service/v3/Implementations/FinancialRecordService.php index 02f7ac9..4ccde5d 100644 --- a/app/Service/v3/Implementations/FinancialRecordService.php +++ b/app/Service/v3/Implementations/FinancialRecordService.php @@ -6,18 +6,11 @@ use App\Constants\v3\UserType; use App\Model\v3\FinancialRecord; use App\Model\v3\UserBalance; use App\Service\v3\Interfaces\FinancialRecordServiceInterface; -use App\Service\v3\Interfaces\SmsSendServiceInterface; use Hyperf\Di\Annotation\Inject; class FinancialRecordService implements FinancialRecordServiceInterface { - /** - * @Inject - * @var SmsSendServiceInterface - */ - protected $smsAliSendService; - public function ledgerAccounts($source_id, $money, $source_type, $money_type, $desc, $comment='') { return $this->record( @@ -85,9 +78,6 @@ class FinancialRecordService implements FinancialRecordServiceInterface $balance->balance = bcadd($balance->balance, $money, 2); $balance->save(); - // 发送短信 - $this->smsAliSendService->doCommunityFinancial($user_id, $money); - } /** @@ -112,9 +102,6 @@ class FinancialRecordService implements FinancialRecordServiceInterface ]); $balance->balance = bcadd($balance->balance, $money, 2); $balance->save(); - - // 发送短信 - $this->smsAliSendService->doCommunityFinancial($user_id, $money); } /** @@ -139,9 +126,6 @@ class FinancialRecordService implements FinancialRecordServiceInterface ]); $balance->balance = bcadd($balance->balance, $money,2); $balance->save(); - - // 发送短信 - $this->smsAliSendService->doCommunityFinancial($user_id, $money); } diff --git a/app/Service/v3/Implementations/SeparateAccountsService.php b/app/Service/v3/Implementations/SeparateAccountsService.php index 0a6030f..dc8ed78 100644 --- a/app/Service/v3/Implementations/SeparateAccountsService.php +++ b/app/Service/v3/Implementations/SeparateAccountsService.php @@ -20,6 +20,7 @@ use App\Service\v3\Interfaces\FinancialRecordServiceInterface; use App\Service\v3\Interfaces\MiniprogramServiceInterface; use App\Service\v3\Interfaces\OrderOnlineServiceInterface; use App\Service\v3\Interfaces\SeparateAccountsServiceInterface; +use App\Service\v3\Interfaces\SmsSendServiceInterface; use App\Service\v3\Interfaces\UserServiceInterface; use App\TaskWorker\SSDBTask; use Hyperf\DbConnection\Db; @@ -58,6 +59,12 @@ class SeparateAccountsService implements SeparateAccountsServiceInterface */ protected $orderOnlineService; + /** + * @Inject + * @var SmsSendServiceInterface + */ + protected $smsAliSendService; + /** * @inheritDoc */ @@ -137,15 +144,27 @@ class SeparateAccountsService implements SeparateAccountsServiceInterface $orderMain->global_order_id, $award['new_user_reward'] ); + // 发送短信 + co(function () use ($orderMain, $award) { + $this->smsAliSendService->doCommunityFinancial($orderMain->user_id, $award['new_user_reward']); + }); $this->financialRecordService->communityAwardByPlatNewUserFirstOLOrder( $communityBind->source_id, $orderMain->global_order_id, $award['first_reward'] ); + // 发送短信 + co(function () use ($orderMain, $award) { + $this->smsAliSendService->doCommunityFinancial($orderMain->user_id, $award['first_reward']); + }); } // 账单分成 $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 ($orderMain, $money) { + $this->smsAliSendService->doCommunityFinancial($orderMain->user_id, $money); + }); } // =======社区服务点分账 / End=======