FormApproval.php 807 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace addons\qingdongams\model;
  3. use think\Model;
  4. use traits\model\SoftDelete;
  5. /**
  6. * 审批表单配置
  7. */
  8. class FormApproval extends Model {
  9. use SoftDelete;
  10. // 表名,不含前缀
  11. protected $name = 'qingdongams_form_approval';
  12. // 自动写入时间戳字段
  13. protected $autoWriteTimestamp = 'int';
  14. // 定义时间戳字段名
  15. protected $createTime = 'createtime';
  16. protected $updateTime = 'updatetime';
  17. protected $deleteTime = 'deletetime';
  18. public function getUpdatetimeAttr($value){
  19. return date('Y-m-d H:i',$value);
  20. }
  21. public static function getImgAttr($value){
  22. return cdnurl($value,true);
  23. }
  24. //客户
  25. public function form() {
  26. return $this->hasOne(Form::class, 'id', 'form_id')->field('id,name,type');
  27. }
  28. }