__('Status 1'), '2' => __('Status 2'), '3' => __('Status 3')]; } public function getWithdrawalStatusList() { return ['1' => __('Withdrawal_status 1'), '2' => __('Withdrawal_status 2'), '3' => __('Withdrawal_status 3')]; } public function getTypeList() { return ['bank' => __('Type bank'), 'wechat' => __('Type wechat'), 'alipay' => __('Type alipay')]; } public function getStatusTextAttr($value, $data) { $value = $value ? $value : (isset($data['status']) ? $data['status'] : ''); $list = $this->getStatusList(); return isset($list[$value]) ? $list[$value] : ''; } public function getWithdrawalStatusTextAttr($value, $data) { $value = $value ? $value : (isset($data['withdrawal_status']) ? $data['withdrawal_status'] : ''); $list = $this->getWithdrawalStatusList(); return isset($list[$value]) ? $list[$value] : ''; } public function getTypeTextAttr($value, $data) { $value = $value ? $value : (isset($data['type']) ? $data['type'] : ''); $list = $this->getTypeList(); return isset($list[$value]) ? $list[$value] : ''; } public function getPaytimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['paytime']) ? $data['paytime'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getExaminetimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['examinetime']) ? $data['examinetime'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } protected function setPaytimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } protected function setExaminetimeAttr($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); } }