WithDrawAuditNotice.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Administrator
  5. * Date: 2020/6/21
  6. * Time: 18:00
  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 WithDrawAuditNotice 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. 'time1'=>['value'=> $this->withdraw->created_at->toDateTimeString()],// 提现时间
  27. 'amount3'=>['value'=> $this->withdraw->amounts],//提现金额
  28. 'thing2'=>['value'=> $this->checkDataLength($this->payWayName(),20)],// 提现方式
  29. 'phrase4'=>['value'=> $this->checkDataLength($this->getStatusComment($this->withdraw->status),5)],// 提现状态
  30. ];
  31. }
  32. public function sendMessage()
  33. {
  34. // TODO: Implement sendMessage() method.
  35. $this->getTemplate("提现状态通知");
  36. $back = [];
  37. if (empty($this->temp_open)) {
  38. $back['message'] = $this->temp_title."消息通知未开启";
  39. \Log::debug($back['message']);
  40. return ;
  41. }
  42. $this->organizeData();
  43. $this->getMember();
  44. \Log::debug("新版小程序消息-提现状态1",$this->temp_id);
  45. \Log::debug("新版小程序消息-提现状态2",$this->openid);
  46. \Log::debug("新版小程序消息-提现状态3",$this->data);
  47. $result = (new AppletMessageNotice($this->temp_id,$this->openid,$this->data,[],2))->sendMessage();
  48. if ($result['status'] == 0) {
  49. \Log::debug($result['message']);
  50. }
  51. }
  52. }