__('Private_messages 0'), '1' => __('Private_messages 1'), '2' => __('Private_messages 2')]; } public function getSpeakList() { return ['0' => __('Speak 0'),'1' => __('Speak 1'),'2' => __('Speak 2')]; } public function getRechargeList() { return ['0' => __('Recharge 0'), '1' => __('Recharge 1')]; } public function getRaffleList() { return ['0' => __('Raffle 0'), '1' => __('Raffle 1')]; } public function getGiveGiftList() { return ['0' => __('Give_gift 0'), '1' => __('Give_gift 1')]; } public function getTransferList() { return ['0' => __('Transfer 0'), '1' => __('Transfer 1')]; } public function getPayorderList() { return ['0' => __('Payorder 0'), '1' => __('Payorder 1')]; } public function getAttireList() { return ['0' => __('Attire 0'), '1' => __('Attire 1')]; } public function getNobleList() { return ['0' => __('Noble 0'), '1' => __('Noble 1')]; } public function getWithdrawList() { return ['0' => __('Withdraw 0'), '1' => __('Withdraw 1')]; } public function getPrivateMessagesTextAttr($value, $data) { $value = $value ? $value : (isset($data['private_messages']) ? $data['private_messages'] : ''); $list = $this->getPrivateMessagesList(); return isset($list[$value]) ? $list[$value] : ''; } public function getSpeakTextAttr($value, $data) { $value = $value ? $value : (isset($data['speak']) ? $data['speak'] : ''); $list = $this->getSpeakList(); return isset($list[$value]) ? $list[$value] : ''; } public function getSpeakTimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['speak_time']) ? $data['speak_time'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getRechargeTextAttr($value, $data) { $value = $value ? $value : (isset($data['recharge']) ? $data['recharge'] : ''); $list = $this->getRechargeList(); return isset($list[$value]) ? $list[$value] : ''; } public function getRaffleTextAttr($value, $data) { $value = $value ? $value : (isset($data['raffle']) ? $data['raffle'] : ''); $list = $this->getRaffleList(); return isset($list[$value]) ? $list[$value] : ''; } public function getGiveGiftTextAttr($value, $data) { $value = $value ? $value : (isset($data['give_gift']) ? $data['give_gift'] : ''); $list = $this->getGiveGiftList(); return isset($list[$value]) ? $list[$value] : ''; } public function getTransferTextAttr($value, $data) { $value = $value ? $value : (isset($data['transfer']) ? $data['transfer'] : ''); $list = $this->getTransferList(); return isset($list[$value]) ? $list[$value] : ''; } public function getPayorderTextAttr($value, $data) { $value = $value ? $value : (isset($data['payorder']) ? $data['payorder'] : ''); $list = $this->getPayorderList(); return isset($list[$value]) ? $list[$value] : ''; } public function getAttireTextAttr($value, $data) { $value = $value ? $value : (isset($data['attire']) ? $data['attire'] : ''); $list = $this->getAttireList(); return isset($list[$value]) ? $list[$value] : ''; } public function getNobleTextAttr($value, $data) { $value = $value ? $value : (isset($data['noble']) ? $data['noble'] : ''); $list = $this->getNobleList(); return isset($list[$value]) ? $list[$value] : ''; } public function getWithdrawTextAttr($value, $data) { $value = $value ? $value : (isset($data['withdraw']) ? $data['withdraw'] : ''); $list = $this->getWithdrawList(); return isset($list[$value]) ? $list[$value] : ''; } protected function setSpeakTimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } public function user() { return $this->belongsTo('User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0); } }