__('Paytype 0'), '1' => __('Paytype 1')]; } public function getStatusList() { return ['0' => __('Status 0'), '1' => __('Status 1'), '2' => __('Status 2'), '3' => __('Status 3')]; } public function getRefundstatusList() { return ['0' => __('Refundstatus 0'), '1' => __('Refundstatus 1'), '2' => __('Refundstatus 2')]; } public function getPaytypeTextAttr($value, $data) { $value = $value ? $value : (isset($data['paytype']) ? $data['paytype'] : ''); $list = $this->getPaytypeList(); 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 getRefundstatusTextAttr($value, $data) { $value = $value ? $value : (isset($data['refundstatus']) ? $data['refundstatus'] : ''); $list = $this->getRefundstatusList(); return isset($list[$value]) ? $list[$value] : ''; } public function getRefundtimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['refundtime']) ? $data['refundtime'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } protected function setRefundtimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } public function active() { return $this->belongsTo('Active', 'active_id', 'id', [], 'LEFT')->setEagerlyType(0); } public function user() { return $this->belongsTo('User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0); } }