'个人申请', self::APPLY_TYPE_COMPANY => '企业申请' ]; } public function getStatusList() { return [ self::STATUS_PENDING => '待审核', self::STATUS_APPROVED => '已通过', self::STATUS_REJECTED => '已拒绝' ]; } public function getApplyTypeTextAttr($value, $data) { $value = $value ? $value : (isset($data['apply_type']) ? $data['apply_type'] : ''); $list = $this->getApplyTypeList(); return isset($list[$value]) ? $list[$value] : ''; } public function getStatusTextAttr($value, $data) { $value = $value ? $value : (isset($data['status']) ? $data['status'] : ''); $list = $this->getStatusList(); return isset($list[$value]) ? $list[$value] : ''; } /** * 关联用户模型 */ public function user() { return $this->belongsTo('app\common\model\User', 'user_id', 'id', [], 'LEFT'); } /** * 关联代理商身份 */ public function identity() { return $this->belongsTo('app\common\model\commission\Identity', 'agent_identity_id', 'id', [], 'LEFT'); } /** * 关联省份 */ public function province() { return $this->belongsTo('app\common\model\Area', 'province_id', 'id', [], 'LEFT'); } /** * 关联城市 */ public function city() { return $this->belongsTo('app\common\model\Area', 'city_id', 'id', [], 'LEFT'); } /** * 关联区域 */ public function district() { return $this->belongsTo('app\common\model\Area', 'district_id', 'id', [], 'LEFT'); } /** * 关联审核管理员 */ public function admin() { return $this->belongsTo('app\admin\model\Admin', 'admin_id', 'id', [], 'LEFT'); } }