WithDrawArrivalNotice.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Administrator
  5. * Date: 2020/6/21
  6. * Time: 18:45
  7. */
  8. namespace app\common\services\notice\applet\withdraw;
  9. use app\common\services\notice\applet\AppletMessageNotice;
  10. use app\common\services\notice\BaseMessageBody;
  11. use app\common\services\notice\share\MiniNoticeTemplate;
  12. use app\common\services\notice\share\WithDrawData;
  13. class WithDrawArrivalNotice extends BaseMessageBody
  14. {
  15. use MiniNoticeTemplate,WithDrawData;
  16. public $withdraw;
  17. public function __construct($withdraw)
  18. {
  19. $this->withdraw = $withdraw;
  20. $this->getWithdrawModel($withdraw);
  21. }
  22. public function organizeData()
  23. {
  24. // TODO: Implement organizeData() method.
  25. $this->data = [
  26. 'name1'=>['value'=> $this->nickname()],// 提现时间
  27. 'amount2'=>['value'=> $this->withdraw->amounts],//提现金额
  28. 'date3'=>['value'=> date("Y-m-d H:i:s",time())],// 提现方式
  29. ];
  30. }
  31. public function sendMessage()
  32. {
  33. // TODO: Implement sendMessage() method.
  34. $this->getTemplate("提现成功通知");
  35. $back = [];
  36. if (empty($this->temp_open)) {
  37. $back['message'] = $this->temp_title."消息通知未开启";
  38. \Log::debug($back['message']);
  39. return ;
  40. }
  41. $this->organizeData();
  42. $this->getMember();
  43. \Log::debug("新版小程序消息-提现到账1",$this->temp_id);
  44. \Log::debug("新版小程序消息-提现到账2",$this->openid);
  45. \Log::debug("新版小程序消息-提现到账3",$this->data);
  46. $result = (new AppletMessageNotice($this->temp_id,$this->openid,$this->data,[],2))->sendMessage();
  47. if ($result['status'] == 0) {
  48. \Log::debug($result['message']);
  49. }
  50. }
  51. }