__('Status 1'), '2' => __('Status 2')]; } public function getApplyTypeList() { return ['1' => __('Apply_type 1'), '2' => __('Apply_type 2')]; } public function getHeadTypeList() { return ['personal' => __('Head_type personal'), 'corporate' => __('Head_type corporate')]; } public function getInvoiceTypeList() { return ['ordinary' => __('Invoice_type ordinary'), 'special' => __('Invoice_type special')]; } public function getStatusTextAttr($value, $data) { $value = $value ? $value : (isset($data['status']) ? $data['status'] : ''); $list = $this->getStatusList(); return isset($list[$value]) ? $list[$value] : ''; } 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 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 getInvoicingtimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['invoicingtime']) ? $data['invoicingtime'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } protected function setInvoicingtimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } public function user() { return $this->belongsTo('app\admin\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0); } }