AgentMoney.php 1002 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace app\common\model;
  3. use think\Model;
  4. class AgentMoney extends Model
  5. {
  6. // 设置字段信息
  7. protected $schema = [
  8. 'id' => 'int',
  9. 'workerid' => 'int',
  10. 'agentid' => 'int',
  11. 'title' => 'string',
  12. 'origin_value' => 'decimal',
  13. 'value' => 'decimal',
  14. 'remark' => 'string',
  15. 'status' => 'int',
  16. 'type' => 'int',
  17. 'createtime' => 'int',
  18. 'yeartime' => 'int',
  19. 'monthtime' => 'int',
  20. ];
  21. // 设置字段自动转换类型
  22. protected $type = [
  23. 'createtime' => 'timestamp:Y-m-d H:i:s',
  24. ];
  25. public function getTypeTextAttr($value, $data)
  26. {
  27. $type = [1 => '普通', 2 => '提现'];
  28. return $type[$data['type']];
  29. }
  30. public function getStatusTextAttr($value, $data)
  31. {
  32. $type = [1 => '待处理', 2 => '已成功', 3 => '已拒绝'];
  33. return $type[$data['status']];
  34. }
  35. }