__('文本类型'),'2' => __('图文类型'),'3' => __('图片消息')]; } public function getSubscriptionTypeList() { return ['1' => __('全部公众号'),'2' => __('指定公众号')]; } public function getSendStatusList() { return [ '1' => __('等待素材处理'), '2' => __('素材处理中'), '3' => __('素材处理完成待发送'), '4' => __('发送中'), '5' => __('发送完成'), '6' => __('发送失败(消息内容过期)'), '7' => __('已删除微信历史消息'), '8' => __('发送失败(接收人数小于2)') ]; } public function getMessageStatusList() { return ['1' => __('有效'),'2' => __('失效'),'3' => __('已删除')]; } public function getCurrentMonthCountList() { return ['1' => __('0次'),'2' => __('1次'),'3' => __('2次'),'4' => __('3次')]; } public function getIsSaveToLibraryList() { return ['1' => __('是'),'2' => __('否')]; } public function getMessageTypeTextAttr($value, $data) { $value = $value ? $value : $data['message_type']; $list = $this->getMessageTypeList(); return isset($list[$value]) ? $list[$value] : ''; } public function getSubscriptionTypeTextAttr($value, $data) { $value = $value ? $value : $data['subscription_type']; $list = $this->getSubscriptionTypeList(); return isset($list[$value]) ? $list[$value] : ''; } public function getSendStatusTextAttr($value, $data) { $value = $value ? $value : $data['send_status']; $list = $this->getSendStatusList(); return isset($list[$value]) ? $list[$value] : ''; } public function getMessageStatusTextAttr($value, $data) { $value = $value ? $value : $data['message_status']; $list = $this->getMessageStatusList(); return isset($list[$value]) ? $list[$value] : ''; } public function getCurrentMonthCountTextAttr($value, $data) { $value = $value ? $value : $data['current_month_count']; $list = $this->getCurrentMonthCountList(); return isset($list[$value]) ? $list[$value] : ''; } public function getSendTimeTextAttr($value, $data) { $value = $value ? $value : $data['send_time']; return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getCreateTimeTextAttr($value, $data) { $value = $value ? $value : $data['create_time']; return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getUpdateTimeTextAttr($value, $data) { $value = $value ? $value : $data['update_time']; return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getIsSaveToLibraryTextAttr($value, $data) { $value = $value ? $value : $data['is_save_to_library']; $list = $this->getIsSaveToLibraryList(); return isset($list[$value]) ? $list[$value] : ''; } protected function setSendTimeAttr($value) { return $value && !is_numeric($value) ? strtotime($value) : $value; } protected function setCreateTimeAttr($value) { return $value && !is_numeric($value) ? strtotime($value) : $value; } protected function setUpdateTimeAttr($value) { return $value && !is_numeric($value) ? strtotime($value) : $value; } }