operator_id = Auth::user()->ope_id; } }); } * /** * 一覧検索・ソート処理 */ public static function search($inputs) { $list = self::query(); if ($inputs['isMethodPost'] ?? false) { // ここで条件検索処理を追加可能(例: $list->where(...);) } // 並び順 if (!empty($inputs['sort'])) { $list->orderBy($inputs['sort'], $inputs['sort_type'] ?? 'asc'); } if ($inputs['isExport'] ?? false) { return $list->get(); } else { return $list->paginate(Utils::item_per_page); } } /** * 主キーで取得 */ public static function getByPk($pk) { return self::find($pk); } /** * 主キー配列で一括削除 */ public static function deleteByPk($ids) { if (!is_array($ids)) { $ids = [$ids]; } return self::whereIn('pplace_id', $ids)->delete(); } /** * 選択リスト取得用(フォーム等) */ public static function getList() { return self::pluck('pplace_number', 'pplace_id'); } }