__('Status -1'), '0' => __('Status 0'), '1' => __('Status 1')]; } public function getOldstatusList() { return ['0' => __('Oldstatus 0'), '1' => __('Oldstatus 1')]; } public function getNoticeEmailList() { return ['1' => __('Notice_email 1'), '0' => __('Notice_email 0')]; } public function getNoticeWhatsappList() { return ['1' => __('Notice_whatsapp 1'), '0' => __('Notice_whatsapp 0')]; } public function getNoticePhonecallList() { return ['1' => __('Notice_phonecall 1'), '0' => __('Notice_phonecall 0')]; } public function getIsFirstList() { return ['0' => __('Is_first 0'), '1' => __('Is_first 1')]; } public function getPrevtimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['prevtime']) ? $data['prevtime'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getBirthdayTextAttr($value, $data) { $value = $value ? $value : (isset($data['birthday']) ? $data['birthday'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getLogintimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['logintime']) ? $data['logintime'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getJointimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['jointime']) ? $data['jointime'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $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 getOldstatusTextAttr($value, $data) { $value = $value ? $value : (isset($data['oldstatus']) ? $data['oldstatus'] : ''); $list = $this->getOldstatusList(); return isset($list[$value]) ? $list[$value] : ''; } public function getNoticeEmailTextAttr($value, $data) { $value = $value ? $value : (isset($data['notice_email']) ? $data['notice_email'] : ''); $list = $this->getNoticeEmailList(); return isset($list[$value]) ? $list[$value] : ''; } public function getNoticeWhatsappTextAttr($value, $data) { $value = $value ? $value : (isset($data['notice_whatsapp']) ? $data['notice_whatsapp'] : ''); $list = $this->getNoticeWhatsappList(); return isset($list[$value]) ? $list[$value] : ''; } public function getNoticePhonecallTextAttr($value, $data) { $value = $value ? $value : (isset($data['notice_phonecall']) ? $data['notice_phonecall'] : ''); $list = $this->getNoticePhonecallList(); return isset($list[$value]) ? $list[$value] : ''; } public function getIsFirstTextAttr($value, $data) { $value = $value ? $value : (isset($data['is_first']) ? $data['is_first'] : ''); $list = $this->getIsFirstList(); return isset($list[$value]) ? $list[$value] : ''; } protected function setPrevtimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } protected function setBirthdayAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } protected function setLogintimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } protected function setJointimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } public function userwallet() { return $this->belongsTo('Userwallet', 'id', 'user_id', [], 'LEFT')->setEagerlyType(0); } }