WithdrawSubmitNotice.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 WithdrawSubmitNotice 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' => $this->withdrawModel->created_at->toDateTimeString()],
  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_submit');
  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. }