12345678910111213141516171819202122232425262728293031323334353637 |
- <?php
- namespace addons\qingdongams\model;
- use think\Model;
- use traits\model\SoftDelete;
- /**
- * 审批表单配置
- */
- class FormApproval extends Model {
- use SoftDelete;
- // 表名,不含前缀
- protected $name = 'qingdongams_form_approval';
- // 自动写入时间戳字段
- protected $autoWriteTimestamp = 'int';
- // 定义时间戳字段名
- protected $createTime = 'createtime';
- protected $updateTime = 'updatetime';
- protected $deleteTime = 'deletetime';
- public function getUpdatetimeAttr($value){
- return date('Y-m-d H:i',$value);
- }
- public static function getImgAttr($value){
- return cdnurl($value,true);
- }
- //客户
- public function form() {
- return $this->hasOne(Form::class, 'id', 'form_id')->field('id,name,type');
- }
- }
|