'禁用', 1 => '启用' ]; } /** * 状态文本 */ public function getStatusTextAttr($value, $data) { $list = $this->getStatusList(); return isset($list[$data['status']]) ? $list[$data['status']] : ''; } /** * 获取排序 */ public function defineSort() { $maxItem = self::field("sort")->where('uniacid', UNIACID)->order("sort desc")->find(); if (!$maxItem) { return 0; } return $maxItem['sort'] + 1; } }