WithdrawRejectNotice.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Administrator
  5. * Date: 2020/6/14
  6. * Time: 14:45
  7. */
  8. namespace app\common\services\notice\official;
  9. use app\common\services\notice\BaseMessageBody;
  10. use app\common\services\notice\share\OfficialNoticeTemplate;
  11. use app\common\services\notice\share\OrderNoticeData;
  12. class WithdrawRejectNotice extends BaseMessageBody
  13. {
  14. use OfficialNoticeTemplate,OrderNoticeData;
  15. public $withdrawModel;
  16. public function __construct($withdrawModel)
  17. {
  18. $this->withdrawModel = $withdrawModel;
  19. }
  20. public function organizeData()
  21. {
  22. // TODO: Implement organizeData() method.
  23. $this->data = [
  24. ['name' => '时间', 'value' => date('Y-m-d H:i:s', $this->withdrawModel->audit_at)],
  25. ['name' => '金额', 'value' => $this->withdrawModel->amounts],
  26. ['name' => '手续费', 'value' => $this->withdrawModel->actual_poundage],
  27. ];
  28. }
  29. public function sendMessage()
  30. {
  31. // TODO: Implement sendMessage() method.
  32. $this->getTemplate('withdraw_reject');
  33. $this->organizeData();
  34. \Log::debug("新版公众号消息-提现拒绝1",$this->template_id);
  35. \Log::debug("新版公众号消息-提现拒绝2",$this->withdrawModel->hasOneMember->hasOneFans->openid);
  36. \Log::debug("新版公众号消息-提现拒绝3",$this->data);
  37. $result = (new OfficialMessageNotice($this->temp_id,$this->withdrawModel->hasOneMember->hasOneFans->openid,$this->data,[],1,$this->url))->sendMessage();
  38. if ($result['status'] == 0) {
  39. \Log::debug($result['message']);
  40. }
  41. }
  42. }