new-admin-api/app/model/supplier/SystemSupplierApply.php

42 lines
840 B
PHP

<?php
namespace app\model\supplier;
use app\common\model\marketing\Agent;
use crmeb\basic\BaseModel;
use crmeb\traits\ModelTrait;
class SystemSupplierApply extends BaseModel{
use ModelTrait;
protected $pk = 'id';
protected $name = 'system_supplier_apply';
public function setCorporationIdCardAttr($value){
return implode(',',$value);
}
public function setChairmanIdCardAttr($value){
return implode(',',$value);
}
public function getCorporationIdCardAttr($value){
if(!empty($value)) return explode(',',$value);
return [];
}
public function getChairmanIdCardAttr($value){
if(!empty($value)) return explode(',',$value);
return [];
}
public function agent(){
return $this->hasOne(Agent::class,'id','invite_agent_id');
}
}