BrokerForm.php 642 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace app\common\model;
  3. use think\Model;
  4. class BrokerForm extends Model
  5. {
  6. // 设置字段信息
  7. protected $schema = [
  8. 'id' => 'int',
  9. 'realname' => 'string',
  10. 'mobile' => 'string',
  11. 'address' => 'string',
  12. 'idcard' => 'string',
  13. 'recommender' => 'string',
  14. 'status' => 'tinyint',
  15. 'remark' => 'string',
  16. 'createtime' => 'int'
  17. ];
  18. // 设置字段自动转换类型
  19. protected $type = [
  20. 'createtime' => 'timestamp:Y-m-d H:i:s'
  21. ];
  22. public function getStatusTextAttr($value,$data)
  23. {
  24. $status = [1=>'待处理',2=>'处理中',3=>'已处理'];
  25. return $status[$data['status']];
  26. }
  27. }