__('Status 1'),'2' => __('Status 2')]; } public function getPayStatusList() { return ['1' => __('Pay_status 1'),'2' => __('Pay_status 2')]; } public function getStatusTextAttr($value, $data) { $value = $value ? $value : $data['status']; $list = $this->getStatusList(); return isset($list[$value]) ? $list[$value] : ''; } public function getPayStatusTextAttr($value, $data) { $value = $value ? $value : $data['pay_status']; $list = $this->getPayStatusList(); return isset($list[$value]) ? $list[$value] : ''; } public function getLimittimeTextAttr($value, $data) { $value = $value ? $value : $data['limittime']; return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } protected function setLimittimeAttr($value) { return $value && !is_numeric($value) ? strtotime($value) : $value; } public function getStarttimeTextAttr($value, $data) { $value = $value ? $value : $data['starttime']; return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } protected function setStarttimeAttr($value) { return $value && !is_numeric($value) ? strtotime($value) : $value; } public function getOne($id) { $cacheKey = CacheConstants::getExportFansRow($id); if (!$data = Redis::instance()->hGetAll($cacheKey)) { $data = $this->where('id', $id)->where('status', ExportFansConstants::STATUS_YES)->find(); if ($data) { $data = $data->getData(); Redis::instance()->hMSet($cacheKey, $data); } else { $data = ['id' => 0]; Redis::instance()->hMSet($cacheKey, $data); } Redis::instance()->expire($cacheKey, 1800); } if (!$data['id']) { $data = false; } return $data; } }