WithdrawFailNotice.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Administrator
  5. * Date: 2020/6/14
  6. * Time: 14:40
  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 WithdrawFailNotice 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. ['name' => '提现单号', 'value' => $this->withdrawModel->withdraw_sn],
  28. ];
  29. }
  30. public function sendMessage()
  31. {
  32. // TODO: Implement sendMessage() method.
  33. $this->getTemplate('withdraw_fail');
  34. $this->organizeData();
  35. \Log::debug("新版公众号消息-提现失败1",$this->template_id);
  36. \Log::debug("新版公众号消息-提现失败2",$this->withdrawModel->hasOneMember->hasOneFans->openid);
  37. \Log::debug("新版公众号消息-提现失败3",$this->data);
  38. $result = (new OfficialMessageNotice($this->temp_id,$this->withdrawModel->hasOneMember->hasOneFans->openid,$this->data,[],1,$this->url))->sendMessage();
  39. if ($result['status'] == 0) {
  40. \Log::debug($result['message']);
  41. }
  42. }
  43. }