__('Male'), '0' => __('Female')]; } public function getStatusList() { return ['normal' => __('Normal'), 'hidden' => __('Hidden')]; } public function group() { return $this->belongsTo('Group', 'group_id', 'id', [], 'LEFT')->setEagerlyType(0); } public function agent() { return $this->hasOne(\app\admin\model\shopro\commission\Agent::class, 'user_id', 'id'); } /** * 获取验证字段数组值 * @param string $value * @param array $data * @return object */ public function getVerificationAttr($value, $data) { $value = array_filter((array)json_decode($value, true)); $value = array_merge(['email' => 0, 'mobile' => 0], $value); return (object)$value; } /** * 设置验证字段 * @param mixed $value * @return string */ public function setVerificationAttr($value) { $value = is_object($value) || is_array($value) ? json_encode($value) : $value; return $value; } }