where('level', $row['level']); if (isset($row['id'])) { $query->where('id', '<>', $row['id']); } })->find(); if ($exist) { throw new Exception("已经存在同等级VIP"); } $pricedata = (array)json_decode($row['pricedata'], true); if (!$pricedata) { throw new Exception("价格配置不能为空"); } }); } public function getStatusList() { return ['normal' => __('Normal'), 'hidden' => __('Hidden'), 'pulloff' => __('Pulloff')]; } public function getStatusTextAttr($value, $data) { $value = $value ? $value : (isset($data['status']) ? $data['status'] : ''); $list = $this->getStatusList(); return isset($list[$value]) ? $list[$value] : ''; } }