__('Head_type personal'), 'corporate' => __('Head_type corporate')]; } public function getInvoiceTypeList() { return ['ordinary' => __('Invoice_type ordinary'), 'special' => __('Invoice_type special')]; } public function getIsDefaultList() { return ['0' => __('Is_default 0'), '1' => __('Is_default 1')]; } public function getHeadTypeTextAttr($value, $data) { $value = $value ? $value : (isset($data['head_type']) ? $data['head_type'] : ''); $list = $this->getHeadTypeList(); return isset($list[$value]) ? $list[$value] : ''; } public function getInvoiceTypeTextAttr($value, $data) { $value = $value ? $value : (isset($data['invoice_type']) ? $data['invoice_type'] : ''); $list = $this->getInvoiceTypeList(); return isset($list[$value]) ? $list[$value] : ''; } public function getIsDefaultTextAttr($value, $data) { $value = $value ? $value : (isset($data['is_default']) ? $data['is_default'] : ''); $list = $this->getIsDefaultList(); return isset($list[$value]) ? $list[$value] : ''; } public function user() { return $this->belongsTo('app\admin\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0); } }