__('Ordinary'), 'special' => __('Special')]; } public function getTitleTypeList() { return ['personal' => __('Personal'), 'enterprise' => __('Enterprise')]; } public function getStatusList() { return [ 'wait' => __('Wait'), 'issued' => __('Issued'), 'reject' => __('Reject'), 'cancel' => __('Cancel'), ]; } public function getTypeTextAttr($value, $data) { $value = $value ?: ($data['type'] ?? ''); $list = $this->getTypeList(); return $list[$value] ?? ''; } public function getTitleTypeTextAttr($value, $data) { $value = $value ?: ($data['title_type'] ?? ''); if ($value === '' && !empty($data['tax_no'])) { $value = 'enterprise'; } $list = $this->getTitleTypeList(); return $list[$value] ?? __('Personal'); } public function getStatusTextAttr($value, $data) { $value = $value ?: ($data['status'] ?? ''); $list = $this->getStatusList(); return $list[$value] ?? ''; } public function user() { return $this->belongsTo('User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0); } public function merchant() { return $this->belongsTo('Merchant', 'merchant_id', 'id', [], 'LEFT')->setEagerlyType(0); } }