<?php
namespace app\index\model;
use think\Model;
class Allocationclass extends Model{
protected $type = [
'time'=>'timestamp:Y-m-d',
'auditingtime'=>'timestamp:Y-m-d H:i:s',
'more' => 'json'
];
public function merchantinfo(){
return $this->hasOne('Merchant','id','merchant');
}
public function userinfo(){
return $this->hasOne('User','id','user');
}
public function auditinguserinfo(){
return $this->hasOne('User','id','auditinguser');
}
protected function setTimeAttr ($val){
return strtotime($val);
}
protected function getTypeAttr ($val,$data){
$arr=['0'=>'未审核','1'=>'已审核'];
$re['name']=$arr[$val];
$re['nod']=$val;
return $re;
}
}