Cash.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. namespace app\common\model\plus\agent;
  3. use app\common\model\BaseModel;
  4. /**
  5. * 分销商提现明细模型
  6. */
  7. class Cash extends BaseModel
  8. {
  9. protected $name = 'agent_cash';
  10. protected $pk = 'id';
  11. /**
  12. * 打款方式
  13. * @var array
  14. */
  15. public $payType = [
  16. 10 => '微信',
  17. 20 => '支付宝',
  18. 30 => '银行卡',
  19. ];
  20. /**
  21. * 申请状态
  22. * @var array
  23. */
  24. public $applyStatus = [
  25. 10 => '待审核',
  26. 20 => '审核通过',
  27. 30 => '驳回',
  28. 40 => '已打款',
  29. ];
  30. /**
  31. * 关联分销商用户表
  32. * @return \think\model\relation\BelongsTo
  33. */
  34. public function user()
  35. {
  36. return $this->belongsTo('User');
  37. }
  38. /**
  39. * 提现详情
  40. */
  41. public static function detail($id)
  42. {
  43. return (new static())->find($id);
  44. }
  45. /**
  46. * 审核状态
  47. * @param $value
  48. * @return array
  49. */
  50. public function getApplyStatusAttr($value)
  51. {
  52. $method = [10 => '待审核', 20 => '审核通过', 30 => '驳回', 40 => '已打款'];
  53. return ['text' => $method[$value], 'value' => $value];
  54. }
  55. }