WithDrawData.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Administrator
  5. * Date: 2020/6/21
  6. * Time: 18:21
  7. */
  8. namespace app\common\services\notice\share;
  9. use app\common\models\Member;
  10. use app\common\models\Withdraw;
  11. trait WithDrawData
  12. {
  13. public $member;
  14. public $openid;
  15. public $withdrawModel;
  16. public $statusComment = [
  17. Withdraw::STATUS_INVALID => '审核无效',
  18. Withdraw::STATUS_INITIAL => '提现申请',
  19. Withdraw::STATUS_AUDIT => '审核通过',
  20. Withdraw::STATUS_PAY => '已打款',
  21. Withdraw::STATUS_REBUT => '审核驳回',
  22. Withdraw::STATUS_PAYING => '打款中',
  23. ];
  24. public function getWithdrawModel($withdraw)
  25. {
  26. $this->withdrawModel = $withdraw;
  27. }
  28. public function getMember()
  29. {
  30. $this->member = Member::uniacid()->where("uid",$this->withdrawModel->member_id)->first();
  31. $this->openid = $this->member['hasOneMiniApp']['openid'];
  32. }
  33. public function nickname()
  34. {
  35. return $this->withdrawModel->hasOneMember ? $this->withdrawModel->hasOneMember->nickname : '';
  36. }
  37. public function payWayName()
  38. {
  39. return $this->withdrawModel->pay_way_name;
  40. }
  41. public function getStatusComment($status)
  42. {
  43. return isset($this->statusComment[$status]) ? $this->statusComment[$status] : '';
  44. }
  45. }