__('Level 1'), '2' => __('Level 2'), '3' => __('Level 3')]; } public function getLevelTextAttr($value, $data) { $value = $value ? $value : (isset($data['level']) ? $data['level'] : ''); $list = $this->getLevelList(); return isset($list[$value]) ? $list[$value] : ''; } public function findAreaByAdmin($admin) { $where = [ ["level", "=", 2], ["use", "=", 1] ]; $query = $this; if ($admin) { if (\E_IDENTITY_TYPE::Agency === $admin["type"]) { array_push($where, ["area_code", "in", explode(",", $admin["city_codes"])]); } if(\E_IDENTITY_TYPE::Store === $admin["type"]) { return []; } } foreach ($where as $item) { $query->where($item[0], $item[1], $item[2]); } return $query->select(); } }