__('Status 1'), '2' => __('Status 2'), '3' => __('Status 3'), '-1' => __('Status -1')]; } public function getStatusTextAttr($value, $data) { $value = $value ? $value : (isset($data['status']) ? $data['status'] : ''); $list = $this->getStatusList(); return isset($list[$value]) ? $list[$value] : ''; } public function getSettletimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['settletime']) ? $data['settletime'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getCanceltimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['canceltime']) ? $data['canceltime'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getUnfreezetimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['unfreezetime']) ? $data['unfreezetime'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } protected function setSettletimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } protected function setCanceltimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } protected function setUnfreezetimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } public function order() { return $this->belongsTo(Order::class, 'activity_order_id', 'id', [], 'LEFT')->setEagerlyType(0); } public function log() { return $this->belongsTo(UserwithdrawalLog::class, 'withdrawal_log_id', 'id', [], 'LEFT')->setEagerlyType(0); } public function touser() { return $this->belongsTo('app\common\model\User', 'to_user_id', 'id', [], 'LEFT')->setEagerlyType(0); } public function payuser() { return $this->belongsTo('app\common\model\User', 'pay_user_id', 'id', [], 'LEFT')->setEagerlyType(0); } }